PythonによるAI・機械学習・真相学習アプリの作り方

プログラミング

OpenCVで画像を操作

!pip install opencv-pythonimport cv2import urllib.request as requrl = ""req.urlretrieve(url, "test.png")# OpenCVで読み込むimp...
プログラミング

NumPyについて

import numpy as np# 最初に配列を作るa = np.array([1,2,3,4,5])print(a)print(type(a))# 2次元配列を作るb = np.array([[1,2,3],[4,5,6]])prin...
プログラミング

機械学習 最適なアルゴリズムとパラメーターを見つける

import pandas as pdfrom sklearn.model_selection import train_test_splitfrom sklearn.metrics import accuracy_scorefrom sk...
プログラミング

機械学習 回帰分析

in_file = "data.csv"out_file = "kion10y.csv"#CSVファイルを1行づつ読み込むwith open(in_file, "rt", encoding="Shift_JIS") as fr: lines...
プログラミング

機械学習 ランダムフォレスト ワイン

import pandas as pdfrom sklearn.model_selection import train_test_splitfrom sklearn.ensemble import RandomForestClassifi...
プログラミング

機械学習 scikit-learn あやめ

アルゴリズムの選択を行い、ここではLinearSVCを使う。X and Y# ライブラリーのインポートfrom sklearn.svm import LinearSVCfrom sklearn.metrics import accuracy...