lazypredict icon indicating copy to clipboard operation
lazypredict copied to clipboard

Tuple model failed to execute

Open janaSunrise opened this issue 3 years ago • 4 comments

Describe the bug

I am trying to train model, and get the results, but I keep getting tuple model failed to execute.

Expected behavior

It's supposed to be trained, and give me all predictions and info.

Screenshots Screenshot from 2021-04-09 19-34-20 Screenshot from 2021-04-09 19-34-15

Desktop (please complete the following information):

  • OS: Linux
  • Browser Firefox
  • Version - Latest

Additional context Add any other context about the problem here.

janaSunrise avatar Apr 09 '21 14:04 janaSunrise

I found the cause by doing this Screenshot from 2021-04-10 00-07-37 Screenshot from 2021-04-10 00-07-31

Hope it helps!

janaSunrise avatar Apr 09 '21 18:04 janaSunrise

Hi @janaSunrise ,

I found the root cause of this issue and how to fix it. image

According to the image attached by you, you have used the fit function twice and the 1st red arrow signifies the wrong function call as X_train is used twice instead of X_test.

Replace the 2 red arrows with this line:

models_train, predictions_train = reg.fit(X_train, X_test, y_train, y_test)

I was also getting the same error previously because of the same mistake. On making these changes it's working fine for me. image

Hope it solves your issue also...

Deepankar-98 avatar Sep 09 '21 05:09 Deepankar-98

Hi there, I have both lines, because I want to predict on both Train and Test set, Because I have these lines,

st.subheader("Performance achieved by the model")

    st.write("Training section")
    st.write(predictions_train)
    st.markdown(
        download_file(predictions_train, "training.csv"), unsafe_allow_html=True
    )

    st.write("Testing")
    st.write(predictions_test)
    st.markdown(download_file(predictions_test, "test.csv"), unsafe_allow_html=True)

So, Instantiating 2 models helped instead!

janaSunrise avatar Sep 09 '21 06:09 janaSunrise

Yes in case you want both then creating 2 models will be better.

Deepankar-98 avatar Sep 09 '21 07:09 Deepankar-98