我已经从自动化的机器学习过程(使用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}')