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

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)))
(0)

相关推荐