lazypredict
lazypredict copied to clipboard
Tuple model failed to execute
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
Desktop (please complete the following information):
- OS: Linux
- Browser Firefox
- Version - Latest
Additional context Add any other context about the problem here.
I found the cause by doing this
Hope it helps!
Hi @janaSunrise ,
I found the root cause of this issue and how to fix it.
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.
Hope it solves your issue also...
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!
Yes in case you want both then creating 2 models will be better.