GithubHelp home page GithubHelp logo

vivienneprince / nbclassifier-lol Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 1.94 MB

Testing Naive Bayes Classifier model on predicting League of Legends game outcomes. Can be used to classify other datasets.

Python 27.62% Jupyter Notebook 72.38%

nbclassifier-lol's Introduction

Getting started

Run LoL_NB_Demo.py

Gaussian Naive Bayes Classifier Demo

Naive Bayes classifier implemented in python using numpy and pandas (+joblib parallel and tqdm) packages. With some adjustments, this code can be used to perform classification on any dataset using only numerical features (binary & multiclass).

It is currently configured to predict League of Legends game outcomes using information from the first 10 minutes of the game.

An .arff version of the LoL data file, as well as a weka model is included in the weka test folder if you want to validate the results using weka.

About the data

Each game has two teams (blue, red) and generally lasts between 20-50 mintues.

Class: blueWins (0 if team blue loses, and 1 if they win)
Omitted variables: gameID
The rest of the features are data about the first 10 minutes of a game, and this is what is used to predict the winner.

Asumptions

We assume that all relevant variables are conditionally independent given the class, and that they all have equal effect on the outcome.

How it works

This algorithm calculates and records the mean and standard deviation for each relevant variable for each class in the training set.

When given new data to classify, the algorithm will calculate the likilihoods of the variables taking those values given each class using the probablity density function:

p-density-function

The class with the largest resulting likelihood is what it will predict, in other words:

classifier

  • note in my code I use notation Y = (y1,y2,...,yj,...,yk) and X = (x1,x2,...,xi,...,xn) instead of just y or C
  • I also took ln of each likelihood and summed instead since some values got really small

References:

Data:
https://www.kaggle.com/bobbyscience/league-of-legends-diamond-ranked-games-10-min

Resources
https://towardsdatascience.com/naive-bayes-classifier-81d512f50a7c
https://en.wikipedia.org/wiki/Naive_Bayes_classifier
https://www.geeksforgeeks.org/naive-bayes-classifiers/

nbclassifier-lol's People

Contributors

vivienneprince avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.