parent
0100b87fea
commit
b81bae49b7
@ -1,17 +0,0 @@
|
||||
# LISTE DES VISUALISATIONS A PREVOIR
|
||||
|
||||
**Taux de victoire par méthode de finition** : Analyser la fréquence à laquelle les combats se terminent par soumission, KO, décision unanime, décision partagée, etc
|
||||
|
||||
**Durée moyenne des combats** : Calculer la durée moyenne des combats pour différentes catégories de poids ou pour l'ensemble de l'UFC
|
||||
|
||||
**Taux de réussite des takedowns** : Examiner le pourcentage de tentatives de takedown réussies par les combattants
|
||||
|
||||
**Taux de réussite des frappes** : Analyser le pourcentage de coups réussis par rapport au nombre total de coups tentés
|
||||
|
||||
**Distribution des finitions par round** : Déterminer dans quel round les combats sont le plus souvent terminés (par exemple, soumission au premier round, KO au deuxième round, etc.)
|
||||
|
||||
**Variation des performances avec l'âge** : Vérifier s'il existe une corrélation entre l'âge des combattants et leur succès dans l'UFC
|
||||
|
||||

|
||||
|
||||
# DANA CACA WHITE
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,59 +0,0 @@
|
||||
import pandas as pd
|
||||
import numpy as np
|
||||
import matplotlib.pyplot as plt
|
||||
from sklearn.tree import DecisionTreeClassifier
|
||||
from sklearn.metrics import accuracy_score, confusion_matrix
|
||||
from sklearn import metrics
|
||||
from sklearn.model_selection import train_test_split
|
||||
|
||||
|
||||
dataframe = pd.read_csv("archive/data.csv")
|
||||
|
||||
# Change bool values to int (0/1)
|
||||
dataframe = dataframe.rename(columns={'Winner': 'Blue_Corner_Win'})
|
||||
dataframe['Blue_Corner_Win'] = (dataframe['Blue_Corner_Win'] == 'Blue').astype(int)
|
||||
dataframe['title_bout'] = dataframe['title_bout'].astype(int)
|
||||
|
||||
# Select datas for Yi (blue corner win ?) and columns for stat
|
||||
Yi = dataframe[["Blue_Corner_Win"]]
|
||||
colonnes = ['B_avg_BODY_landed', 'B_avg_HEAD_landed', 'B_avg_TD_att', 'B_avg_TOTAL_STR_landed',
|
||||
'B_avg_opp_BODY_att', 'B_avg_opp_HEAD_landed', 'B_avg_opp_LEG_landed',
|
||||
'B_avg_opp_SIG_STR_att', 'B_avg_opp_TOTAL_STR_att', 'R_avg_TD_att', 'R_avg_opp_GROUND_att',
|
||||
'R_avg_opp_SIG_STR_landed', 'B_age', 'R_age']
|
||||
|
||||
Xi = dataframe[colonnes]
|
||||
|
||||
Xtrain, Xtest, ytrain, ytest = train_test_split(Xi, Yi,test_size=0.20, random_state=42)
|
||||
print(Xtrain.shape)
|
||||
print(Xtest.shape)
|
||||
|
||||
Arbre_decision = DecisionTreeClassifier(random_state=0, max_depth=20)
|
||||
clf = Arbre_decision.fit(Xtrain, Yi)
|
||||
|
||||
ypredict = clf.predict(Xtest)
|
||||
accuracy = accuracy_score(ytest, ypredict)
|
||||
matriceConfusion = confusion_matrix(ytest, ypredict)
|
||||
|
||||
incorrect=matriceConfusion[0][1] + matriceConfusion[1][0]
|
||||
total = matriceConfusion.sum()
|
||||
|
||||
print("\nNumber of incorrect classifications: " + str(incorrect))
|
||||
print("Number of classifications total: " + str(total))
|
||||
|
||||
print("Percent: "+ str((total-incorrect)/total*100))
|
||||
|
||||
fighter_data = dataframe[dataframe['R_fighter'] == 'Adrian Yanez']
|
||||
average_fighter_data = fighter_data[colonnes].mean()
|
||||
|
||||
fighter_data_2 = dataframe[dataframe['R_fighter'] == 'Gustavo Lopez']
|
||||
average_fighter_data_2 = fighter_data_2[colonnes].mean()
|
||||
|
||||
combined_features = pd.concat([average_fighter_data, average_fighter_data_2])
|
||||
|
||||
prediction = clf.predict([combined_features])
|
||||
if prediction[0] == 1:
|
||||
winner = "Blue Corner"
|
||||
else:
|
||||
winner = "Red Corner"
|
||||
|
||||
print(f"The predicted winner is: {winner}")
|
Loading…
Reference in new issue