- Train a machine learning model to predict something
These are the activities for this lesson:
3 PARTS OF MACHINE LEARNING
Recall that Articifical Intelligence, specifically Machine Learning, has 3 main parts.
Dataset
Find Patterns
Make Prediction
In this lesson, we’re going to focus on the second part, Find Patterns, by training our own AI model that will be able to make a prediction.
There are many free online platforms where you can train an AI model, using supervised learning.
There are two main types of machine learning – supervised learning and unsupervised learning.
Supervised learning is just as it sounds – you supervise how the model learns by telling it the correct answer.
Unsupervised learning takes a different approach. The model is provided data, but with no guidance or supervision. The AI model finds its own patterns. This method allows the AI model to discover new groupings, similarities and differences between data without any preconceived knowledge.
In this curriculum, we will used the supervised learning approach to machine learning. For example, say you want an AI model to tell if a picture is a dog or a cat.
Your dataset will be lots and lots of pictures of dogs and cats.
You will help train the model by telling it which pictures are dogs and which are cats
PLANNING FOR YOUR MODEL
Your model will predict, or classify something. Often these models are called classification models, for that reason.
First steps:
- What you are classifying? Are they images, text, sounds? This is your data type.
- What are the different possible classifications? For example, dogs and cats. These are your classes. They are also sometimes referred to as labels.
- Gather the appropriate data to train your model. Find lots and lots of varied data to represent each class. For example, lots and lots of pictures of different types of dogs and cats!
RECOMMENDED PLATFORMS
There are many free and open source platforms available to create AI classification models.
We have curated a list of programs and platforms where you can:
- build your model to make a prediction
- then use your model in a mobile or web app to perform an action based on the prediction
Here is a quick overview of what each platform can classify and integrate with.
| Platform | Classification Types | Technovation Integration |
|---|---|---|
| Teachable Machine by Google | images, sounds, poses | App Inventor, Python, other integrations possible |
| MachineLearningForKids | images, sounds, text, numbers | Python, App Inventor (for some data types) |
| MIT App Inventor | images, sounds, poses | App Inventor |
| Ximilar | images | Thunkable, App Inventor, wep apps, using APIs |
ACTIVITY: TRAIN A MACHINE LEARNING MODEL
Build a Rock, Paper Scissors model
Then see your model in action with a simple pre-built javascript interaction.
PRE-BUILT MODELS
Now that you have built your first AI model and as you start to plan your own model for your project, you might consider using a model that is already built.
Why reinvent the wheel, right?
There are many sites that provide AI models that are public and shared. You might consider using them if they provide the classification you are looking for. Here are some sites providing public ML models.
To use these models, you most likely will need to use a text-based language like Python or Javascript.
If you are completely new to coding, building your own model is a great option. You will be in control, and you will learn a lot about AI in the process!
REFLECTION
You’ve made your first AI model! This should give you a glimpse into the process for making an AI model. All the model creation platforms work in a similar way, although the interfaces may differ slightly.
REVIEW OF KEY TERMS
- AI (or machine learning) Model – artificial intelligence that is trained on a dataset to recognize patterns to predict or classify something
- Supervised Learning – machine learning where a model is trained by telling it correct or incorrect result
- Unsupervised Learning – machine learning where a model discovers patterns on its own, without any intervention
- Class – a label that is provided to an AI model so it learns how to classify inputs by its class
ADDITIONAL RESOURCES
If you want to learn more about artificial intelligence and machine learning, here is a great playlist from Daniel Schiffman of New York University.
