Closed elcolie closed 3 years ago
the steps to change the model for predictions:
automl = AutoML(results_path="my_automl")
automl.fit(X_train, y_train)
params.json
file and change the best_model
utoml = AutoML(results_path="my_automl")
automl.predict(X)
Not quite easy, but it is okay 😓
@pplonski It does not work. It warns
2021-06-25 16:08:08,223 supervised.exceptions ERROR This model has not been fitted yet. Please call `fit()` first.
---------------------------------------------------------------------------
AutoMLException Traceback (most recent call last)
<ipython-input-47-4b2ef145420a> in <module>
----> 1 sixth_prediciton = sixth_ml.predict_all(X_test)
/i/pyenv/versions/py-default/lib/python3.8/site-packages/supervised/automl.py in predict_all(self, X)
394
395 """
--> 396 return self._predict_all(X)
397
398 def score(self, X, y=None, sample_weight=None):
/i/pyenv/versions/py-default/lib/python3.8/site-packages/supervised/base_automl.py in _predict_all(self, X)
1328 def _predict_all(self, X):
1329 # Make and return predictions
-> 1330 return self._base_predict(X)
1331
1332 def _score(self, X, y=None, sample_weight=None):
/i/pyenv/versions/py-default/lib/python3.8/site-packages/supervised/base_automl.py in _base_predict(self, X, model)
1240
1241 if model is None:
-> 1242 raise AutoMLException(
1243 "This model has not been fitted yet. Please call `fit()` first."
1244 )
AutoMLException: This model has not been fitted yet. Please call `fit()` first.
And show error
It will be added in https://github.com/mljar/mljar-supervised/issues/423 - closing as a duplicate.
It comes with best classifier. Then I have to change
best_model
inparams.json
to use another classifier.Is it possible to do like
automl.dtree.predict(X_test)
?