Skip to content

Welcome

First Steps

If Python, the terminal, or machine learning all feel new — this is your page. No prior experience assumed. You will install what you need, run your first real model, and come out with something visible. After that, the rest of the academy will make sense.

Step 1

Get A Working Computer

Install Python and a terminal you are comfortable opening. No cloud accounts, no GPU.

Step 2

Run Your First Model

Train a tiny image classifier in about 15 minutes. See numbers change. See it get something right and something wrong.

Step 3

Choose Where To Go Next

Once the first model works, open the Study Plan at Phase 1. That is where the academy really begins.

What Is Machine Learning, Actually

A machine learning model is a program you never write line-by-line. Instead you give it examples — pictures of digits with their correct labels, or support tickets with their resolution times — and the model adjusts its own numbers until it can make reasonable guesses on examples it has not seen.

Three things make this different from normal programming:

  • You give data, not rules. You collect labeled examples. The model figures out the rule.
  • You check it on unseen examples. A model that memorizes the examples you showed it is useless. What matters is how it behaves on new ones.
  • It is usually wrong sometimes. The question is never "is it perfect?" but "is it right often enough, on the cases that actually matter?"

Everything in this academy is really about getting better at the second and third points. The first one is usually the easy part.

What You Need Before Anything Else

Three things:

  1. a computer you can type on
  2. Python 3.10 or newer installed
  3. a terminal window — Terminal on macOS, Terminal on most Linux distributions, PowerShell or Windows Terminal on Windows

That is the whole list. You do not need a GPU. You do not need a cloud account. You do not need to understand linear algebra yet.

Installing Python

macOS

Open Terminal (press Cmd+Space, type "Terminal", press Enter). Then type:

python3 --version

If you see something like Python 3.11.5, you already have Python. Skip to the next section.

If not, the simplest path is:

  1. go to python.org/downloads
  2. click the big button for the latest stable Python 3
  3. open the downloaded .pkg file and click through the installer
  4. close and reopen Terminal, then run python3 --version again

Windows

Open Windows Terminal (press the Windows key, type "Terminal", press Enter). Then type:

python --version

If you see a Python 3 version, you are set. If you see a message asking to open the Microsoft Store, or nothing useful:

  1. go to python.org/downloads
  2. download the latest Python 3 for Windows
  3. important: when the installer opens, tick the box "Add Python to PATH" before clicking Install
  4. close and reopen Windows Terminal, then try python --version again

Linux

Most distributions ship with Python 3. Open a terminal and run:

python3 --version

If the version is older than 3.10, install a newer one through your distribution's package manager (apt, dnf, pacman, etc.) or use pyenv.

Your First Working Command

Whichever OS you are on, you should now be able to run this and see a Python prompt:

python3 -c "print('hello')"

You should see hello printed. That is it — that is the whole "can I run Python" test.

If it did not work, do not panic. The most common causes:

  • you typed python on macOS or Linux when you meant python3
  • you did not tick "Add Python to PATH" during the Windows installer (reinstall and tick it)
  • you did not close and reopen the terminal after installing Python

Your First Model — About 15 Minutes

Now the fun part. We are going to download a tiny handwritten-digit dataset, train a model to recognize them, and look at what it got right and wrong.

In your terminal, pick a folder you do not mind putting files in (your Desktop is fine) and type:

cd Desktop
mkdir my-first-ai
cd my-first-ai
python3 -m venv .venv

That last command makes a private Python sandbox so the packages we install do not mess with anything else on your computer.

Activate it.

On macOS/Linux:

source .venv/bin/activate

On Windows:

.venv\Scripts\activate

Your prompt should now show (.venv) at the start of the line. That means you are inside the sandbox.

Install what we need.

pip install scikit-learn matplotlib

This will download a few libraries. Wait until the prompt comes back.

Save this as first_model.py in the same folder. Open a text editor (VS Code, Notepad, TextEdit in plain-text mode, anything), paste this in, and save:

from sklearn.datasets import load_digits
from sklearn.model_selection import train_test_split
from sklearn.linear_model import LogisticRegression
from sklearn.metrics import accuracy_score, confusion_matrix
import matplotlib.pyplot as plt

# 1. Load 1797 tiny images of handwritten digits (0-9)
digits = load_digits()
X, y = digits.data, digits.target
print(f"We have {len(X)} images, each one is {X.shape[1]} pixels flattened.")

# 2. Split into a part to learn from, and a part we hide to test fairly
X_train, X_test, y_train, y_test = train_test_split(
    X, y, test_size=0.2, random_state=42
)

# 3. Train a simple model
model = LogisticRegression(max_iter=5000)
model.fit(X_train, y_train)

# 4. See how well it does on the hidden part
preds = model.predict(X_test)
print(f"Accuracy on unseen digits: {accuracy_score(y_test, preds):.3f}")

# 5. Show a few predictions so we can actually see what it did
fig, axes = plt.subplots(2, 5, figsize=(10, 4))
for ax, img, true, pred in zip(axes.flatten(),
                               X_test[:10].reshape(-1, 8, 8),
                               y_test[:10], preds[:10]):
    ax.imshow(img, cmap="gray")
    color = "green" if true == pred else "red"
    ax.set_title(f"true {true} / pred {pred}", color=color)
    ax.axis("off")
plt.tight_layout()
plt.savefig("predictions.png")
print("Saved predictions.png — open it and have a look.")

Run it.

python first_model.py

Expected output (roughly):

We have 1797 images, each one is 64 pixels flattened.
Accuracy on unseen digits: 0.972
Saved predictions.png — open it and have a look.

Open the predictions.png file that was saved next to your script. You should see ten tiny digit images, each labeled with what the model thought and what the correct answer was. Green means it got it right. Red means it got it wrong.

Congratulations. You just trained a real machine learning model. It is not a toy — the algorithm underneath is the same family used in production systems all over the world. You just used a small dataset so it fits on your laptop in seconds.

What To Notice

Before moving on, sit with the output for a minute.

  • The model was right about 97% of the time on digits it had never seen. That number came from the hidden 20% we split off before training. We never let the model see those during training.
  • Some of the red ones probably look genuinely hard — a messy 7 that could be a 1, or a 4 that looks like a 9. The model is not stupid. It is making the kind of mistakes a tired human would also make.
  • The whole thing — load data, split it, train, evaluate, inspect — is the skeleton of almost every real AI project. The rest of the academy is about making each of those steps honest, disciplined, and defensible.

Where To Go Next

You have Python working and a model running. Pick the next page based on what you want to do:

  • Keep building intuition. Open Getting Started and set up the academy's local preview so you can read the rest of the pages with working links and examples.
  • Start the real curriculum. Open the Study Plan at Phase 1. The first phase teaches you to inspect tables and data cleanly, which is what the first_model.py script skipped over to keep things short.
  • See what a full workflow looks like. Open Python, NumPy, Pandas, Visualization — the first track — once the Getting Started preview is running.
  • Preparing for IOAI. Once you are comfortable with the terminal and Python, also read IOAI Competition Surface to see what olympiad problems actually look like.

If Something Broke

The most common issues on this page and how to fix them:

  • python3: command not found. Python did not install, or the terminal cannot find it. Reinstall from python.org, and on Windows make sure "Add Python to PATH" is ticked.
  • pip: command not found or No module named pip. Try python3 -m pip install scikit-learn matplotlib instead.
  • ModuleNotFoundError: No module named 'sklearn'. You are running Python from outside the virtual environment. Make sure you activated it (source .venv/bin/activate or .venv\Scripts\activate) and see (.venv) at the start of your terminal prompt.
  • predictions.png did not appear. Look for it in the folder where you ran the script. If you are on a headless Linux machine, the savefig call should still work even if no window appears.
  • Everything looks fine but the accuracy is very low. Double-check you copied the script exactly — especially the model.fit(X_train, y_train) line.

If you are still stuck after trying the above, ask someone who has written Python before for 10 minutes of help. Every working programmer has been where you are. This part is supposed to be hard once, then easy forever.