MCPcopy Index your code
hub / github.com/rushter/MLAlgorithms / test_knn

Function test_knn

mla/tests/test_regression_accuracy.py:57–61  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

55
56
57def test_knn():
58 model = KNNRegressor(k=5)
59 model.fit(X_train, y_train)
60 predictions = model.predict(X_test)
61 assert mean_squared_error(y_test, predictions) < 10000

Callers

nothing calls this directly

Calls 4

KNNRegressorClass · 0.90
mean_squared_errorFunction · 0.90
fitMethod · 0.45
predictMethod · 0.45

Tested by

no test coverage detected