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