def rf_test(X,y):
X_train, X_test, y_train, y_test = train_test_split(X,y,random_state=10)
rf_model = RandomForestClassifier(n_estimators = 100, n_jobs=-1)
rf_model.fit(X_train, y_train)
y_pred = rf_model.predict(X_test)
print metrics.accuracy_score(y_test,y_pred)
#plot confusion_matrix, 'col' is the y target
recipe_classification.py 文件源码
python
阅读 27
收藏 0
点赞 0
评论 0
评论列表
文章目录