kNN1.py 文件源码

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

项目:website-fingerprinting 作者: AxelGoetz 项目源码 文件源码
def __init__(self, is_multiclass=True, K_CLOSEST_NEIGHBORS=2):
        # Constants
        self.K_RECO = 5.0 # Num of neighbors for weight learning
        self.K_CLOSEST_NEIGHBORS = K_CLOSEST_NEIGHBORS

        self.weights = None

        self.kNN_finder = NearestNeighbors(
            n_neighbors=K_CLOSEST_NEIGHBORS,
            metric=self._calculate_dist,
            metric_params=None, # Dict otherwise
            n_jobs=-1
        )
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号