classification_model.py 文件源码

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

项目:BotBoosted 作者: brityboy 项目源码 文件源码
def evaluate_model(model, X_train, y_train):
    '''
    INPUT
         - model: this is a classification model from sklearn
         - X_train: 2d array of the features
         - y_train: 1d array of the target
    OUTPUT
         - information about the model's accuracy using 10
         fold cross validation
         - model: the fit model
    Returns the model
    '''
    print(np.mean(cross_val_score(model, X_train, y_train,
                                  cv=10, n_jobs=-1, verbose=10)))
    model.fit(X_train, y_train)
    return model
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号