如何可视化来自scikitlearn的最近邻居算法

时间:2019-02-13 14:30:08

标签: scikit-learn regression knn

我已经从自动化的机器学习过程(使用TPOT)获得了KNeighborsRegressor。现在,我想可视化数据何时通过算法:

exported_pipeline = KNeighborsRegressor(n_neighbors=6, p=1, weights="distance")
exported_pipeline.fit(training_features, training_target)
results = exported_pipeline.predict(testing_features)

max_error = (results-testing_target).argmax()
idx = (results-testing_target).argmax()   # maximum prediction error occurs here
print(f'MAX_ERROR={max_error} at index={idx}')

0 个答案:

没有答案