python中predict函数_python - KNeighbors Regressor .predict()函数在用weights ='distance'进行训练时给出可疑的完美结果吗? - 堆...
如果我训练了一个KNeighborsRegressor(通过scikit-learn),然后想将其预测值与目标变量进行比较,则可以这样进行:#Initiate modelknn = neighbors.KNeighborsRegressor(n_neighbors=8)#Define independent and target variablesX = df[['var1', 'var2', '...