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

Compute predictions from selected model #423

Open
pplonski opened this issue Jun 25, 2021 · 10 comments
Open

Compute predictions from selected model #423

pplonski opened this issue Jun 25, 2021 · 10 comments
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@pplonski
Copy link
Contributor

Details in discussion #421

@pplonski pplonski added enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed labels Jun 25, 2021
@asuzukosi
Copy link

I'll like to work on this

@pplonski
Copy link
Contributor Author

@asuzukosi great!

Some tips:

  • You can pass model name in the predict() method. Model name will be simply a string that is displayed in the report.
  • When AutoML is loading models from the disk, only models needed by the best_model are loaded (for speed reason). You need to ensure that model selected for prediction is loaded. In the case of Ensemble that might be several models.

Please let me know if you need more help.

@pplonski pplonski pinned this issue Jul 12, 2021
@matrixhead
Copy link

hey, is this issue still open? can i work on this

@pplonski
Copy link
Contributor Author

hey @matrixhead!

the issue is still open, I'm assigning it to you

@pplonski pplonski assigned matrixhead and unassigned asuzukosi Aug 21, 2021
@matrixhead
Copy link

#460
I don't know this is the right way to do it

@pplonski
Copy link
Contributor Author

@matrixhead few comments:

  1. Have you tested the code? Did you write the unit tests? I would suggest to write unit tests. Do you have idea what units tests can be added to cover corner cases?
  2. I would name the argument model_name.
  3. When loading the model from hard drive the only models from load_on_predict parameter in params.json file are loaded. Those are models needed be best_model. We need to assure that selected model by user is loaded.
  4. There are predict(), predict_proba() and predict_all() methods. They should support the model_name parameter.

@matrixhead
Copy link

matrixhead commented Aug 27, 2021

  1. no I didn't write tests, I will try to do that.
  2. ok
  3. can I do it this way, first by calling load() from _predict() and then checking user-specified model is present in the _models or not
  4. okay i will do that

@matrixhead
Copy link

#460

@Kshitij68
Copy link

Hi @pplonski , I just opened a PR for this. I'm sure that more work would be required before we can merge it, but early feedback would be very helpful.
Thanks!

@dermodmaster
Copy link

Quick and dirty workaround until this is oficially implemented:

from supervised.model_framework import ModelFramework
model = ModelFramework.load("AUTOML_FOLDER_NAME_HERE", model_subpath="MODEL_FOLDER_NAME_HERE")

For regression results:

y_pred = automl._base_predict(qdqd_X_test, model=model)["prediction"].to_numpy()

For classification results:

y_pred = automl._base_predict(qdqd_X_test, model=model)["label"].to_numpy()

Hopefully i can save someones time. :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
mljar-supervised
  
Awaiting triage
Development

No branches or pull requests

5 participants