Python Forum
Win or Loss Prediction - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: Win or Loss Prediction (/thread-42026.html)



Win or Loss Prediction - ksasi2k3 - Apr-24-2024

I am trying to predict win or loss in ML using Python. Tried XGboost,Logistic and SVC method but getting struct in place where it says " estimators failed to fit".
Need help on this prediction.

I have given a sample data.. The first 6 Id have result known as either won or loss .. how can predict 7,8 and 9 on the sample data either won or loss and also any possibility to get the % of win or loss. we have Id, pl as place and tr as another categorical variable and based o n all the variable how can we predict Dealst....

your help would be greatly appreciated.

Id Pl tr days1 days2 days3 totaldays Dealst
1 ab bc2 25 30 48 103 won
2 ab1 bc3 26 30 148 203 won
3 ab3 bc4 26 30 148 203 Loss
4 ab4 bc5 26 30 148 203 won
5 ab5 bc6 26 30 148 203 Loss
6 ab6 bc7 26 30 148 203 won
7 ab7 bc8 26 30 148 203 Open
8 ab8 bc9 26 30 148 203 Open
9 ab9 bc1 26 30 148 203 Open


RE: Win or Loss Prediction - deanhystad - Apr-24-2024

Can you provide an example of what you tried?


RE: Win or Loss Prediction - ksasi2k3 - Apr-25-2024

(Apr-24-2024, 07:58 PM)deanhystad Wrote: Can you provide an example of what you tried?

Yes I have attached a sample data.. need to predict the Dealstate whether Won or Lost for the open state


RE: Win or Loss Prediction - Pedroski55 - Apr-25-2024

I believe deanhystad meant, "Why not post some Python code that you have tried?"

Just looking at the XL you posted, it is not clear to my befuddled brain how you arrive at "won" or "loss". (Maybe "gain" or "loss" might be better.)

Could you please explain how you decide upon "gain" or "loss"?


RE: Win or Loss Prediction - ksasi2k3 - Apr-25-2024

I used the below sample code (given only some part). Imported the data from excel and dropped few cols, just had the data as per attached file. Created train and test data and tried out Logistic, SVC and XGB method.. but am not sure how to arrive at a position in which I could see the list of IDs I have given is either Won or loss with percentage.

import xgboost as xgb
from sklearn.linear_model import LogisticRegression
from sklearn.svm import SVC
from IPython.display import display
......formatting and train,test code
finally

clf.fit(X_test,Y_test)
clf.predict(X_test)

I want to know in Python the process to do won Loss analysis with the uotput saying the opportunities can either be won or loss and also percentage included in it.