THIS PROJECT WILL TAKE VERY LITTLE TIME. IT NEED TO BE DONE WITHIN THE NEXT FEW HOURS.
Custom Objective and Metrics for XGBOOST
I have built an XGBOOST model, and currently use softmax and softprob. The data predicts 1 of 3 outcomes - “0,1,2”.
The model is getting 55% accuracy, which is great for my purpose.
However, I want the model to not optimize for accuracy.
I have a data set of sports betting data. The data contains features, with the result of each match (Home win, Away win, Draw). There is also, in the table, odds for each bet. There are odds for Home Win, Away Win, and Draw.
The model I have built uses softmax, and returns an accuracy of 55%. However, win % is not what I am looking for. As some bets are worth more than others, in order to maximize profit, the model needs to taken into account the odds for each bet.
I have taken the odds for all the bets and stored them in a (X,3) numpy array. Looks like this: ([2.5,18.104.22.168],[2.6,1.9,2.7],…..) The format is Home Odds, Away Odds, Draw Odds
For each incorrect choice made by the model, the custom loss should penalize the model by a factor of one (1 unit bet).
For each correct choice made by the model, the custom loss should reward the model by the odds factor, which is store in the numpy array.
Since the objective is maximize profit, you may need to multiply x -1 or invert it 1/x so that you can minimize the model, but maximize the profit.
The custom metric would need to be total profit. This is equal to:
Correct Answer choices (sum of all their coefficients in the numpy array)
Incorrect answers (simply the number of incorrect answers)
Note, for this I can provide you with the XGBOOST code, but not the entire model code or data.
4 freelancer đang chào giá trung bình $73 cho công việc này
[login to view URL] this is my profile. Worked on a similar kind of problem to predict weather using a large dataset. Will ensure the work gets completed as per your satisfaction.