recipe_classification.py 文件源码

python
阅读 27 收藏 0 点赞 0 评论 0

项目:Flavor-Network 作者: lingcheng99 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号