def cv_LinearRegression_It( xM, yV, n_splits = 5, scoring = 'median_absolute_error', N_it = 10, disp = False, ldisp = False):
"""
N_it times iteration is performed for cross_validation in order to make further average effect.
The flag of 'disp' is truned off so each iteration will not shown.
"""
cv_score_le = list()
for ni in range( N_it):
cv_score_l = cv_LinearRegression( xM, yV, n_splits = n_splits, scoring = scoring, disp = disp)
cv_score_le.extend( cv_score_l)
o_d = {'mean': np.mean( cv_score_le),
'std': np.std( cv_score_le),
'list': cv_score_le}
if disp or ldisp:
print('{0}: mean(+/-std) --> {1}(+/-{2})'.format( scoring, o_d['mean'], o_d['std']))
return o_d
评论列表
文章目录