RegressionKNN.py 文件源码

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

项目:AirTicketPredicting 作者: junlulocky 项目源码 文件源码
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')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号