lightweight_classifier.py 文件源码

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

项目:BotBoosted 作者: brityboy 项目源码 文件源码
def evaluate_model(model, X_train, y_train):
    """
    Args:
        model (sklearn classification model): this model from sklearn that
        will be used to fit the data and to see the 10 fold cross val score of
        X_train (2d numpy array): this is the feature matrix
        y_train (1d numpy array): this is the array of targets
    Returns:
        prints information about the model's accuracy using 10
         fold cross validation
        model (sklearn classification model): the model that has already been
        fit to the data
    """
    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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号