work work work

This commit is contained in:
LukaszChrostowski 2024-01-08 23:02:58 +01:00
parent f96465ed56
commit e03d8b48af
2 changed files with 6 additions and 3 deletions

BIN
.DS_Store vendored

Binary file not shown.

View File

@ -99,7 +99,7 @@ def xgboost_predict_proba_v2(shooter,goalkeeper,teamMatesList,opponentsList, min
'shot_open_goal','shot_follows_dribble', 'shot_redirect',
'x1', 'y1','number_of_players_opponents',
'number_of_players_teammates','angle', 'distance',
'x_player_opponent_Goalkeeper',
'x_player_opponent_Goalkeeper', 'x_player_opponent_8',
'x_player_opponent_1', 'x_player_opponent_2','x_player_opponent_3',
'x_player_opponent_4','x_player_opponent_5', 'x_player_opponent_6',
'x_player_teammate_2','x_player_opponent_9', 'x_player_opponent_10',
@ -156,7 +156,7 @@ def xgboost_predict_proba_v2(shooter,goalkeeper,teamMatesList,opponentsList, min
shot_open_goal,shot_follows_dribble, shot_redirect,
shooter[0], shooter[1],number_of_players_opponents,
number_of_players_teammates,angle, distance,
x_player_opponent_Goalkeeper,
x_player_opponent_Goalkeeper, opponentsList[8][0],
opponentsList[0][0], opponentsList[1][0], opponentsList[2][0],
opponentsList[3][0], opponentsList[4][0], opponentsList[5][0],
opponentsList[6][0], opponentsList[7][0], teamMatesList[8][0],
@ -176,6 +176,9 @@ def xgboost_predict_proba_v2(shooter,goalkeeper,teamMatesList,opponentsList, min
x_player_teammate_Goalkeeper, y_player_teammate_Goalkeeper,
shot_kick_off]
categorical_columns = ['position_name', 'shot_technique_name', 'shot_type_name', 'number_of_players_opponents', 'number_of_players_teammates', 'shot_body_part_name'] # list all your object columns here
# X_new = pd.get_dummies(X_new, columns=categorical_columns)
X_new[categorical_columns] = X_new[categorical_columns].astype('category')
return model.predict_proba(X_new)[0][1].round(2)