Transformers are a powerful deep learning architecture that have revolutionized the field of Natural Language Processing (NLP). They have been used to achieve state-of-the-art results on a variety of tasks, including language translation, text classification, and text generation. One of the key strengths of transformers is their flexibility, as they can be adapted to a […]


In this blog post I will show how to implement OCR (optical character recognition) using a Random Forest classifier in Ruby. As our dataset we will be using the MNIST database of handwritten digits and for our Random Forest implementation we will be using Python’s sci-kit learn library. This post also shows how easy it […]


Scikit-learn is a set of simple and efficient tools for machine learning and artificial intelligence built with NumPy and SciPy in Python. This tutorial will walk you through how you can use these tools from Ruby using a gem called PyCall. PyCall will enable you to use the power of Scikit-learn from Python in your […]


In this blog post we will walk through how to build an AI that can play a computer game with a Neural Network and Q-Learning. We will expand our game from the Teaching an AI to play a simple game using Q-learning blog post to be more complex by introducing an extra dimension. To get the most […]


In this post I will walk you through how to teach a computer to master a simple video game using the q-learning reinforcement learning algorithm. We will implement the algorithm from scratch in Ruby without the use of external gems. To enable us to illustrate the inner workings of the algorithm we will be teaching […]


In this blog post we will solve a unsupervised clustering problem in Ruby. We will be using the rubygem kmeans-clusterer to setup the problem and cluster the data using the k-mean clustering algorithm. The k-mean clustering algorithm is an algorithm used to divide unlabeled data into a number of clusters of related data. It is […]


In this blog post I will show how to implement a support vector machine (SVM) in Ruby, and how to use it to solve a simple classification problem. We will be using the RubyGem rb-libsvm to help us setup a SVM, train it and make predictions in a minutes. For our dataset we will be using […]


When building machine learning and artificial intelligence models you’ll often run into situations where a model is not working as well as you would like. Maybe the error rate is too high or the model works fine on the training data, but fails when you apply real world data. What should you do to improve […]


In this blog post I will show how to use neural networks in Ruby to solve a simple classification problem. We will be using the RubyGem ruby-fann to help us setup a network, train and make predictions in a matter of minutes. For our dataset we will be using school admission data, this was also […]


This post will discuss how adding regularization to your machine learning algorithms can improve the accuracy of your algorithm. We will walk through an example of regularization in linear regression, and see how different amounts of regularization impact the accuracy.  Under-fitting and Over-fitting When we designing machine learning algorithms we risk over-fitting and under-fitting our […]