libscores.py 文件源码

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

项目:AutoML5 作者: djajetic 项目源码 文件源码
def a_metric (solution, prediction, task='regression'):
    ''' 1 - Mean absolute error divided by mean absolute deviation '''
    mae = mvmean(np.abs(solution-prediction))         # mean absolute error
    mad = mvmean(np.abs(solution-mvmean(solution))) # mean absolute deviation
    score = 1 - mae / mad
    return mvmean(score)

### END REGRESSION METRICS 

### CLASSIFICATION METRICS (work on solutions in {0, 1} and predictions in [0, 1])
# These can be computed for regression scores only after running normalize_array
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号