Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass hyper params from client #21

Merged
merged 6 commits into from
May 13, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
updated test to include a test that an example param is passed to the…
… server
SamuelGabriel committed May 6, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit 70dd739aff5c32879df2dc07c6123df92d312ddc
7 changes: 5 additions & 2 deletions tabpfn_client/tests/unit/test_tabpfn_classifier.py
Original file line number Diff line number Diff line change
@@ -50,13 +50,14 @@ def test_init_remote_classifier(self, mock_server, mock_prompt_for_terms_and_con
mock_server.router.get(mock_server.endpoints.retrieve_greeting_messages.path).respond(
200, json={"messages": []})
mock_predict_response = [[1, 0.],[.9, .1],[0.01, 0.99]]
mock_server.router.post(mock_server.endpoints.predict.path).respond(
predict_route = mock_server.router.post(mock_server.endpoints.predict.path)
predict_route.respond(
200, json={"y_pred": mock_predict_response}
)

tabpfn_classifier.init(use_server=True)

tabpfn = TabPFNClassifier()
tabpfn = TabPFNClassifier(n_estimators=10)
self.assertRaises(
NotFittedError,
tabpfn.predict,
@@ -69,6 +70,8 @@ def test_init_remote_classifier(self, mock_server, mock_prompt_for_terms_and_con
y_pred = tabpfn.predict(self.X_test)
self.assertTrue(np.all(np.argmax(mock_predict_response, axis=1) == y_pred))

self.assertIn('n_estimators%22%3A%2010', str(predict_route.calls.last.request.url), "check that n_estimators is passed to the server")

@with_mock_server()
def test_reuse_saved_access_token(self, mock_server):
# mock connection and authentication
Loading