base_pareto.py 文件源码

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

项目:MetaHeuristic 作者: gonzalesMK 项目源码 文件源码
def score_func_to_gridsearch(estimator, X_test=None, y_test=None):
        """ Function to be given as a scorer function to Grid Search Method.
        It is going to transform the matrix os predicts generated by 'all' option
        to an final accuracy score. Use a high value to CV
        """
        if not hasattr(estimator, 'fitnesses_'):
            raise ValueError("Fit")

        obj1=[]
        obj2=[]
        for i in range(len(estimator.best_pareto_front_)):
            obj1.append(estimator.best_pareto_front_[i].fitness.values[0])
            obj2.append(estimator.best_pareto_front_[i].fitness.values[1])

        obj1.append(obj1[0])
        obj2.append(1)

        return auc(obj2, obj1, reorder=True)
评论列表


问题


面经


文章

微信
公众号

扫码关注公众号