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.
评论列表
文章目录