def __init__(self, isTrain):
super(RegressionKNN, self).__init__(isTrain)
# data preprocessing
#self.dataPreprocessing()
# Create KNN regression object
# first parameter is the K neighbors
# 'uniform' assigns uniform weights to each neighbor
# 'distance' assigns weights proportional to the inverse of the distance from the query point
# default metric is euclidean distance
self.regr = neighbors.KNeighborsRegressor(86, weights='distance')
评论列表
文章目录