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

Issues when implementing 'predict_model' #1

Open
tueseu opened this issue Jan 5, 2022 · 1 comment
Open

Issues when implementing 'predict_model' #1

tueseu opened this issue Jan 5, 2022 · 1 comment

Comments

@tueseu
Copy link

tueseu commented Jan 5, 2022

Thank you for the instruction about integrating Pytorch models into the Pycaret workflow. The example you provide works well. But when I go further to implement the developed skorch_model for prediction, an error arises. Do you have any idea how to fix it?

The error is shown as follows:

predict = predict_model(skorch_model, data)

---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
<ipython-input-16-74e96e3a1dc7> in <module>
----> 1 predict = predict_model(skorch_model, data)

C:\Program Files\Python38\lib\site-packages\pycaret\classification.py in predict_model(estimator, data, probability_threshold, encoded_labels, raw_score, round, verbose)
   2003     """
   2004 
-> 2005     return pycaret.internal.tabular.predict_model(
   2006         estimator=estimator,
   2007         data=data,

C:\Program Files\Python38\lib\site-packages\pycaret\internal\tabular.py in predict_model(estimator, data, probability_threshold, encoded_labels, raw_score, round, verbose, ml_usecase, display)
   8712 
   8713         if is_sklearn_pipeline(estimator) and hasattr(estimator, "predict"):
-> 8714             dtypes = estimator.named_steps["dtypes"]
   8715         else:
   8716             try:

KeyError: 'dtypes'

Thank you for your kind help!

@pranaymodukuru
Copy link
Owner

Hi @tueseu is the variable data here a dataframe?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants