ML之SVM:利用SVM算法对手写数字图片识别数据集(PCA降维处理)进行预测并评估模型(两种算法)性能
生活随笔
收集整理的這篇文章主要介紹了
ML之SVM:利用SVM算法对手写数字图片识别数据集(PCA降维处理)进行预测并评估模型(两种算法)性能
小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
ML之SVM:利用SVM算法對(duì)手寫(xiě)數(shù)字圖片識(shí)別數(shù)據(jù)集(PCA降維處理)進(jìn)行預(yù)測(cè)并評(píng)估模型(兩種算法)性能
?
?
?
?
目錄
輸出結(jié)果
設(shè)計(jì)思路
核心代碼
?
?
?
?
?
?
輸出結(jié)果
?
設(shè)計(jì)思路
?
核心代碼
estimator = PCA(n_components=20) pca_X_train = estimator.fit_transform(X_train) pca_X_test = estimator.transform(X_test) pca_svc = LinearSVC() pca_svc.fit(pca_X_train, y_train) pca_y_predict = pca_svc.predict(pca_X_test) svc.score(X_test, y_test) classification_report(y_test, y_predict, target_names=np.arange(10).astype(str))pca_svc.score(pca_X_test, y_test) classification_report(y_test, pca_y_predict, target_names=np.arange(10).astype(str))?
?
?
?
總結(jié)
以上是生活随笔為你收集整理的ML之SVM:利用SVM算法对手写数字图片识别数据集(PCA降维处理)进行预测并评估模型(两种算法)性能的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: ML之DR之PCA:利用PCA对手写数字
- 下一篇: ML之NB:利用朴素贝叶斯NB算法(Co