Tuesday, May 12, 2026

Machine Learning

After seven years of development PlumeriaSC 4.8 now supports machine learning! Currently we are using supervised learning with the k-nearest neighbor algorithm but it can also be used as reinforcement learning. One thing that we do not allow is for PlumeriaSC to train itself on people that play our games. All learning happens in the PlumeriaSC project files. Once the project is generated as html the training data is set and there is no code to create new training data. Since machine learning is an interesting subject I thought I would share my experience.

You may have heard that the coolest machine learning algorithms use neural networks, however, they are usually the worst place to start. The problem is when not used correctly they usually take too long to train if ever. So where is the best place to start? The first thing to know is that there are three main types of machine learning algorithms supervised, unsupervised, and reinforcement learning.

Supervised Learning (KNN is a good algorithm for this) is where the data is labeled then new data is added and labeled according to the original labeled data. An example would be a new color is presented and the computer has to figure out the closest color based on the labels it already has.

Unsupervised Learning (K-Means is a good algorithm for this) is where you group data into clusters. An example would be compressing an image file by finding similar colors then using the same color for them.

Reinforcement Learning (Q-Learning is a good algorithm for this) which is probably the most exciting one of the bunch. An example would be a game with a grid that needs to score different parts of the map whether they are good or bad. Variants of Q-Learning have been used to find the best action to take in a Mario game.

No comments:

Post a Comment