classifier.py 文件源码

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

项目:ClassifyHub 作者: Top-Ranger 项目源码 文件源码
def _get_input(self, github_object):
        try:
            metadata = github_object.get_repository_data()
            input = [
                metadata['fork'],
                True if metadata['homepage'] is not None else False,
                metadata['size'],
                metadata['stargazers_count'],
                metadata['watchers_count'],
                metadata['has_wiki'],
                metadata['has_pages'],
                metadata['forks_count'],
                metadata['open_issues_count'],
                metadata['subscribers_count']
            ]
            return input
        except github.GithubError:
            return [0.0 for _ in range(10)]

    ##
    # \brief Classifies the repository based on the learned <em>Decision Tree</em>.
    #
    # \param data GitHub repository as github.Github object.
    # \return Dictionary {CLASS: PROBABILITY}, where CLASS is a string containing the class label and
    #         PROBABILITY is a float in [0.0, 1.0] containing the probability that the repository belongs to the class.
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号