Posts

Showing posts from January, 2017

grandmaster level chess ai using python - Part 1: Outlining the Rough Design

Inspired by AlphaGo, I am starting to work on building a basic chess computer using Python. I will design this chess computer based off of first principles.  I will try not to consult any online guides.  I won't use any libraries and will only rely on basic data structures and algorithms to build it. The first iteration of this chess computer will work by brute force alongside a simple heuristic algorithm.  After the first iteration is complete, I will try to improve on it. My goal here is to create a grandmaster level chess ai (elo > 2500).  I think the key to creating a very strong chess ai is the combination of the tree search and the heuristic algorithm. Below is a rough outline of how I will design this engine.  This design will compute N moves into the future, and then use a simple scoring method to choose the best moves out of the future states. Chess set design A 2D 8x8 matrix to represent all the spaces on the chess board. letters ...

Best Resources for Machine Learning and AI

As I learn more about ML and AI, I will try to compile the best resources that I come across here. Machine Learning Theory: Andrew NG machine learning course https://www.coursera.org/learn/machine-learning comment: Andrew Ng is an excellent teacher and explains complicated machine learning concepts in a very simple way.  This course will teach the basics of machine learning including the core algorithms and the mathematics behind them.  This is an essential course for any person interested in machine learning. machine learning notes:  http://www.holehouse.org/mlclass/ comment: invaluable notes to complement Andrew Ng's machine learning course.  Refer to these to review what you learned in the video lectures Neural Networks and Artificial Intelligence: Coursera Deep Learning http://deeplearning.ai This course is amazing!  Another gem from Andrew Ng.  Gives you a comprehensive deep dive into neural networks. Backwards Propagatio...

Using sqldf and RPostgreSQL for data manipulation in R

In R, I prefer to use the sqldf library to manipulate data.  Sqldf allows me to use SQL syntax to directly query and manipulate dataframes.  It works by connecting to RDBMS of your choosing and using that to manipulate your dataframes. I personally like to use PostgreSQL with sqldf but you can use many others depending on what you are used to(mysql, sqlite, etc.) Below are instructions on how to configure sqldf using PostgreSQL: 1. Install PostgreSQL and setup on your computer. 2. Install RPostgreSQL and sqldf packages in R install.packages("RPostgreSQL") install.packages("sqldf") 3. Now you can directly query data frames in R!  Post in the comments if you run into any issues! library(RPostgreSQL) library(sqldf) options(sqldf.driver = "RPostgreSQL") options(sqldf.RPostgreSQL.user = "postgres", sqldf.RPostgreSQL.password = <your password here>, sqldf.RPostgreSQL.dbname = "postgres", sqldf.RPostgreSQL.hostname ...