python+opencv+ml《Machine learing for opencv 2017》学习(一):1和2

文章目录

  • 引言
  • 1.A Taste of Machine Learning
    • 1.1机器学习的三种学习分类
  • 2.Working with Data in OpenCV and Python
    • 2.1workflow
    • 2.2.scipy
      • 2.2.1.sklearn.datasets
      • 2.2.2.sklearn.model_selection
    • 2.3matplotlib


引言

python+opencv+ml《Machine learing for opencv 2017》学习(一):1和2_第1张图片

1.A Taste of Machine Learning

python+opencv+ml《Machine learing for opencv 2017》学习(一):1和2_第2张图片

1.1机器学习的三种学习分类

python+opencv+ml《Machine learing for opencv 2017》学习(一):1和2_第3张图片

2.Working with Data in OpenCV and Python

python+opencv+ml《Machine learing for opencv 2017》学习(一):1和2_第4张图片

2.1workflow

python+opencv+ml《Machine learing for opencv 2017》学习(一):1和2_第5张图片

2.2.scipy

python+opencv+ml《Machine learing for opencv 2017》学习(一):1和2_第6张图片

2.2.1.sklearn.datasets

python+opencv+ml《Machine learing for opencv 2017》学习(一):1和2_第7张图片

from sklearn import datasets
import matplotlib.pyplot as plt

# load_
digits = datasets.load_digits()

# 获取第一张图片
img = digits.images[0, :, :]

# 显示图片
plt.imshow(img,cmap='gray')

python+opencv+ml《Machine learing for opencv 2017》学习(一):1和2_第8张图片
python+opencv+ml《Machine learing for opencv 2017》学习(一):1和2_第9张图片

2.2.2.sklearn.model_selection

python+opencv+ml《Machine learing for opencv 2017》学习(一):1和2_第10张图片

from sklearn import datasets
from sklearn import model_selection

# load_
digits = datasets.load_digits()

# X表示具体的数据data,y表示标签target。
# [训练集的数据][测试集的数据][训练集的标签][测试集的标签]
X_train, X_test, y_train, y_test = model_selection.train_test_split(
    digits.data, digits.target, test_size=0.1, random_state=42
)

python+opencv+ml《Machine learing for opencv 2017》学习(一):1和2_第11张图片

2.3matplotlib

python+opencv+ml《Machine learing for opencv 2017》学习(一):1和2_第12张图片

你可能感兴趣的:(AI)