ML之SVM:基于SVM(支持向量机)之SVC算法对手写数字图片识别进行预测

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/qq_41185868/article/details/87879232

ML之SVM:基于SVM(支持向量机)之SVC算法对手写数字图片识别进行预测

输出结果

设计思路

核心代码


X_train = ss.fit_transform(X_train)
X_test = ss.transform(X_test)

lsvc = LinearSVC()
lsvc.fit(X_train, y_train)
y_predict = lsvc.predict(X_test)

print('The Accuracy of Linear SVC is', lsvc.score(X_test, y_test))

print(classification_report(y_test, y_predict, target_names=digits.target_names.astype(str)))

猜你喜欢

转载自blog.csdn.net/qq_41185868/article/details/87879232
今日推荐