Skip to content

osjurso/IKT440-Project

Repository files navigation

IKT440-Project

This repository contains code developed in the ICT440 project in the fall of 2019. The assignment was to compare different machine learning algorithms on the Connect-4 data set and create an AI player for the game.

Getting started

The game is by default set up to use SVM, just run MCTS.py and it should just work. To use Random forest, run export_models.py and change the filename on line 31 in MCTS.py.

The SVM model is small enough for git, in contrast to RF. But please note that saving the SVM model to files takes approximatley 80 minutes. probability is set to true in order for MCTS.py to use predict_proba(). Thus, the fit method performs an extra 5 crossfolds on the training data. Fitting and saving the SVM model is therefore commented out in export_models.py.

Contents of the repository

This repository contains the scripts used to generate results for the report, a script to tune hyper-parameters of the different algorithms and the Connect Four game with an AI opponent using a random forest model trained on the Connect-4 data set.

Algorithms

The algorithms folder contains scripts to train the baseline and optimized models in order to generate the results shown in the report.

Tune.py

The script Tune.py is used to perform hyper-parameter tuning on the different algorithms using GridSearchCV. The script is set up with hyper parameters for the different algorithms. Simply swap out the the estimator and params_grid parameters to tune the different algorithms.

MCTS.py

The Monte Carlo Tree Search AI player. To disable the Random Forest hybrid, set use_random_forest to 0. If you want to have the AI play itself set human_player to 0.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages