classification.py 文件源码

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

项目:IDPanel 作者: CylanceSPEAR 项目源码 文件源码
def load_model(file_path):
        with open(file_path, "r") as f:
            decision_trees, sparse_features, total_feature_count = load(f)

        dts = {}
        for key in decision_trees.keys():
            dts[key] = []
            for dt in decision_trees[key]:
                d = DecisionTree([])
                for k in dt['model'].keys():
                    setattr(d, k, dt['model'][k])
                dt['model'] = d
                dts[key].append(dt)

        return ClassificationEngine(
            decision_trees=dts,
            sparse_features=sparse_features,
            total_feature_count=total_feature_count
        )
评论列表


问题


面经


文章

微信
公众号

扫码关注公众号