Update test_regression.py (#306)

* Update test_regression.py

There is a another way for mutioutput-model-trian.
RegressorChain is more adapting to the targets which are relavant.
This commit is contained in:
晓宇 2021-11-26 00:18:22 +08:00 committed by GitHub
parent fd136b02d1
commit 5dc948da18
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 1 deletions

View File

@ -198,7 +198,7 @@ class TestRegression(unittest.TestCase):
def test_multioutput():
from sklearn.datasets import make_regression
from sklearn.model_selection import train_test_split
from sklearn.multioutput import MultiOutputRegressor
from sklearn.multioutput import MultiOutputRegressor, RegressorChain
# create regression data
X, y = make_regression(n_targets=3)
@ -214,7 +214,15 @@ def test_multioutput():
# predict
print(model.predict(X_test))
#train the model
model = RegressorChain(AutoML(task="regression", time_budget=1))
model.fit(X_train, y_train)
# predict
print(model.predict(X_test))
if __name__ == "__main__":
unittest.main()