Code
Hub
Workspaces
Connect
Indexed graphs
Engine
MCP
copy
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
57
def
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
KNNRegressor
Class · 0.90
mean_squared_error
Function · 0.90
fit
Method · 0.45
predict
Method · 0.45
Tested by
no test coverage detected