jgrid.py 文件源码

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

项目:jamespy_py3 作者: jskDr 项目源码 文件源码
def cv_Ridge_BIKE(A_list, yV, XX=None, alpha=0.5, n_folds=5, n_jobs=-1, grid_std=None):
    """
    Older version than cv_Ridge_BIKE
    """

    clf = binary_model.BIKE_Ridge(A_list, XX, alpha=alpha)
    ln = A_list[0].shape[0]  # ls is the number of molecules.
    kf_n_c = model_selection.KFold(n_splits=n_folds, shuffle=True)
    kf_n = kf_n_c.split(A_list)

    AX_idx = np.array([list(range(ln))]).T
    yV_pred = model_selection.cross_val_predict(
        clf, AX_idx, yV, cv=kf_n, n_jobs=n_jobs)

    print('The prediction output using cross-validation is given by:')
    jutil.cv_show(yV, yV_pred, grid_std=grid_std)

    return yV_pred
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号