Update:
I have published a follow-up post that includes data scraping and implementation in PyTorch. The datasets used are also available now for downloading.
I am a huge UFC fan and I always wondered if one can predict UFC fights using machine learning. To address this, I crawled over 4000 UFC fights and the career statistics of over 2000 professional fighters using Scrapy. After a series of data cleaning steps, I obtained a training set with ~7000 training samples and 9 predictive features, which are the differences between the two fighters in 9 fighting metrics including striking and grappling. Finally, I used Keras to build a neural network model as following:
model = Sequential()
model.add(Dense(20, input_dim=X_train_scaled.shape[1],activation='relu'))
model.add(Dropout(0.5))
model.add(Dense(20, activation='relu'))
model.add(Dropout(0.5))
model.add(Dense(10, activation='relu'))
model.add(Dropout(0.5))
model.add(Dense(1, activation='sigmoid'))
model.compile(loss='binary_crossentropy', optimizer='Adam', metrics=['accuracy'])
My neural network has a quite simple structure with 1 input layer, 2 hidden layers, and 1 output layer with sigmoid activation since the outputs are binary (win or lose). Dropout layers were added to reduce overfitting.
After training, my model achieved an accuracy of 71% on the training set and an accuracy of 73% on the test set. Not too bad!
One of the most anticipated fights was Tony Ferguson vs. Khabib Nurmagomedov, which was scheduled for UFC 223 on April 7. But I just learned Tony Ferguson had withdrawn from the bout due to a torn knee ligament. What a bummer! Nevertheless, the featherweight champion Max Holloway has agreed to step in and fight Khabib for the lightweight title! My model predict that Khabib Nurmagomedov will win the fight with a probability of 67%. Let’s see what happens on April 7!
Source code can be found at https://github.com/naity/DeepUFC.