1 of 19

MMA classifier

If it looks like a duck, swims like a duck, and quacks like a duck, then it probably is a duck.

Duck test

From Wikipedia, the free encyclopedia

​

2 of 19

�Mixed Martial Arts = Judo + boxing + karate + kickboxing + greco-roman wrestling + jiu-jitsu + sambo…�����

3 of 19

4 of 19

Het idee:

5 of 19

Wat weet ik?

  • Basale kennis Machine Learning: Masterclass van Arno Knobbe in 2012, Leiden Institute of Advanced Computer Science, UL
  • Geen Python ervaring, wel 20 jaar programmeerervaring in o.a. Java, C, C#...

​

​

Doel

Rijk worden ☺

maar ook leren…

Python

API, JSON

Toepassing ML

​

​

6 of 19

Python libraries��Web scraper �BeautifulSoup ��ML classifier�Scikit-learn��Automatic betting �Urllib (Betfair Eschange API� via Jason-RPC)

7 of 19

Webscraping

http://www.sherdog.com/robots.txt

8 of 19

ML: Data, data, data

  • Feature selection
  • Imputation
  • Normalization

​

9 of 19

Dummy (uniform)��Dummy (most frequent)��DecisionTree��Naive Bayes��K-Nearest Neighbor��Neural Network��Support Vector Machine��Random Forest�

​

Accuracy per classifier, 10 splits Cross validation

​

10 of 19

K Nearest Neighbors��“Simple and lazy learner”�generaliseert (leert) niet, geen echte trainingsfase�heeft de hele training set nodig tijdens testing

11 of 19

12 of 19

K - te klein: overfitting�K - te groot ?��weights = 'distance'

Cross validation voor KNN

K: 1..19�

13 of 19

Confusion matrix

Accuracy: 0.60

Predicted

Actual 0 1

0 TN: 59 FP: 33

1 FN: 41 TP: 54

`precision recall f1-score support

0 0.59 0.64 0.61 92

1 0.62 0.57 0.59 95

avg /

total 0.61 0.60 0.60 187

Accuracy

It is the number of correct predictions made divided by the total number of predictions made

Precision

the number of positive predictions divided by the total number of positive class values predicted. It is also called the Positive Predictive Value (PPV).

Precision can be thought of as a measure of a classifiers exactness. A low precision can also indicate a large number of False Positives.

Recall

Recall is the number of True Positives divided by the number of True Positives and the number of False Negatives. Put another way it is the number of positive predictions divided by the number of positive class values in the test data. It is also called Sensitivity or the True Positive Rate.

Recall can be thought of as a measure of a classifiers completeness. A low recall indicates many False Negatives.

F1 Score

The F1 Score is the 2*((precision*recall)/(precision+recall)). It is also called the F Score or the F Measure. Put another way, the F1 score conveys the balance between the precision and the recall.

​

​

​

​

​

​

​

​

​

​

​

14 of 19

Real data…

  • knn = KNeighborsClassifier(n_neighbors=3, weights = 'distance')
  • knn.fit(rescaledX, Y)
  • predictions = knn.predict(X_real)
  • print(predictions)
  • [0]

​

MMA Classifier: Amirkhani wins !

15 of 19

16 of 19

Jason

{

   "params": {

      "filter": {

         "eventTypeIds": [1]

      }

   },

   "jsonrpc": "2.0",

   "method": "SportsAPING/v1.0/listCompetitions",

   "id": 1

}

  • Application key
  • Session token
  • Certificates

17 of 19

Python rules! ��Long live Internet ☺�

Conclusie

18 of 19

OSTAGRAM.RU

19 of 19