Code Monkey home page Code Monkey logo

tictactoe's Introduction

TicTacToe

Tic Tac Toe game with a gist of machine learning

In 1959, Arthur Samuel defined machine learning as a "Field of study that gives computers the ability to learn without being explicitly programmed". He wrote a checkers program that learned by playing against itself and used that data when it played against a human.

#Approach Initially i was biased towards applying supervised learning (since i am following coursera Machine learning course). I used classification (logistic regression and also neural networks) to model if the next move leads to win or loss. But even though tictactoe has finite number of states and is deterministic there is no one optimal move for a perticular state.(atleast not initially) I didn't get the results i hoped for (maybe my model was not too good) and i wanted the program to learn the moves for which it would lose. So reinforcement learning came to my aid and i used temporal difference to solve my problem.

Temporal difference is essentially dynamic programming and greedy algorithm approach.(Both of which i knew) But since i restricted myself to applying machine learning concepts (biased towards supervised learning) i was blinded and couldn't bring myself to even think about those algorithms.

#About Code

(Code is now a little messy.) Havent tested it thoroughly but seems to work pretty well.(better than my previous approaches)

suggestions are very much appreciated.( email : [email protected]) #Acknowledgement Thanks to coursera for such a great course on Machine Learning and thanks to Prof.Andrew Ng for teaching it.

tictactoe's People

Contributors

sujay-m avatar

Watchers

James Cloos avatar  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.