-
Notifications
You must be signed in to change notification settings - Fork 555
features: Manually setting the validation set for multi-output task #1302
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -230,5 +230,28 @@ def test_multioutput(): | |
| print(model.predict(X_test)) | ||
|
|
||
|
|
||
| def test_multioutput_train_size(): | ||
| import numpy as np | ||
| from sklearn.datasets import make_regression | ||
| from sklearn.model_selection import train_test_split | ||
| from sklearn.multioutput import MultiOutputRegressor | ||
|
|
||
| # create regression data | ||
| X, y = make_regression(n_targets=3) | ||
|
|
||
| # split into train and test data | ||
| X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.20, random_state=42) | ||
| X_train, X_val, y_train, y_val = train_test_split(X_train, y_train, test_size=0.1, random_state=42) | ||
|
|
||
| # train the model | ||
| model = MultiOutputRegressor( | ||
| AutoML(task="regression", time_budget=1, eval_method="holdout", multioutput_train_size=len(X_train)) | ||
| ) | ||
| model.fit(np.concatenate([X_train, X_val], axis=0), np.concatenate([y_train, y_val], axis=0)) | ||
|
|
||
| # predict | ||
| print(model.predict(X_test)) | ||
|
Comment on lines
+233
to
+253
|
||
|
|
||
|
|
||
| if __name__ == "__main__": | ||
| unittest.main() | ||
Uh oh!
There was an error while loading. Please reload this page.