Machine Learning (AI Models) Over-simplified

Machine learning is a branch of AI that creates predictive models. A model is a spreadsheet with conditions in the left columns with a probability in the right column. A predictive model is where the guesses have been run enough times to become fairly accurate guesses or predictions.

Increasing the sampling or number of data samples increases the reliability of the model. Testing a million pictures of a cat is more reliable than testing 10 pictures.

AI has come of age because computers are fast enough and cheap enough to make the tech widespread.

Data modeling is the transformation of raw data into something useful.  A model relative to machine learning is the end result of the transformation process- sometimes known as “output” in computer parlance.

A model starts its life with rows and columns of data. For example, your credit card statement might have columns for titles like date, transaction name, transaction type, and amount. Where Transaction Type could be Clothing, Entertainment, Utilities, and so on.

In this example, it is easy to study your spending habits and guess the probability of what percent you could spend on Entertainment in the future. You could very well drop this data into an Excel spreadsheet and slice-n-dice into summarized groups. If you study these summations sliced by year and type, you should be able to figure out how much you are spending on what. 

Or to make the computer do it for you, you could save your data in a comma-separated-variable file and feed it to an AI algorithm. To prepare the data in Excel, do a “Save-As” and select the file type of “CSV”.

One of the tools data scientists use is a Python user interface called Jupyter. Overall, Jupyter empowers developers to combine code, visualizations, and explanatory text in a single interactive user environment.

An Algorithm

You don’t need to understand the following code, but it may give you an idea about what is meant by the term “machine learning algorithm:” The output is a score or grade of how well the model is doing with the data it was given. [1]

import pandas as pd

from sklearn.tree import DecisionTreeClassifier

from sklearn.model_selection import train_test_split

from sklearn.metrics import accuracy_score

music_data = pd.read_csv(‘music.csv’)

X = music_data.drop(columns=[‘genre’])

y = music_data[‘genre’]

X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.3)

model = DecisionTreeClassifier(), y_train)

predictions = model.predict(X_test)


score = accuracy_score(y_test, predictions)


What this code is doing is importing a spreadsheet about music sales by gender, age, and genre. It uses the data to learn how to predict genre by age and gender. It splits off 30% of the rows for testing and uses the remaining 70% for validation. So the algorithm is learning probabilities about genre, in this case, based on age and gender. You could manually do this yourself with a small sampling but what if there were millions of records? That’s where modern AI computers come into play.

AI uses a field called Machine Learning where probabilities about things are learned. It is somewhat what we do, for example, when we see a pedestrian on the street. If we see an old lady approaching the crosswalk, we figure she probably won’t dart into traffic so we continue on. However, if it is a young boy or a dog near the crosswalk, we probably use more caution and slow down a bit.

What Tesla does is use billions of miles of car video against how the car was operated to learn how to operate the car given the situation and road conditions. Using machine learning and probabilities provides more smooth and human-like transitions on the roadway. When we drive, we can tell when a driver is erratic. That driver has a probability to cause an accident, so we steer clear. The Tesla algorithms do the same thing.

In conclusion: Try looking at data and think about probabilities. See patterns in the data and use AI as a tool. There are large language models like chatGPT available to get up to speed quickly. “AI won’t take your job but a person using AI will.”

Leave a Comment

Your email address will not be published.