mirror of https://github.com/microsoft/autogen.git
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:
parent
fd136b02d1
commit
5dc948da18
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue