初步接触要求时,从上图选自己数据所适用的方法,
首先看数据的样本是否 >50
,小于则需要收集更多的数据
然后看问题适合分类、回归、聚类、降维中的哪一大类
Sklearn解决问题的一般步骤:
1.导入模块
2.建立数据集
3.选择合适模型,进行fit,选择-训练-预测
4.评价模型
保存模型:
1 from sklearn.externals import joblib #jbolib模块 2 3 #保存Model(注:save文件夹要预先建立,否则会报错) 4 joblib.dump(clf, 'save/clf.pkl') 5 6 #读取Model 7 clf3 = joblib.load('save/clf.pkl') 8 9 #测试读取后的Model 10 print(clf3.predict(X[0:1]))