Start learning machine learning
Start learning machine learning
A school has past quiz results and wonders whether study time can help estimate a future score. You could write a fixed rule yourself, but you could also ask a program to fit a relationship from recorded examples. Machine learning is that second approach: choose a way to learn patterns from data, then check whether those patterns are useful on examples the program did not learn from.
This course starts with Python and the small amount of maths you need, then builds models and complete projects. You will read real Python programs, inspect their results and question their limitations. The classroom examples are invented for teaching; a few neat rows cannot establish how real students learn, and a prediction should never determine a student's opportunities by itself.
Give the model a clear job
An input measurement is called a feature. Study hours and practice attempts could be features if they are available before the quiz. The value we want to predict is the target, such as the quiz score. A row should represent a clearly defined observation: one student preparing for one quiz, for example.
A model is a fitted mathematical relationship, not a person who understands the school. Training adjusts that relationship using examples. Evaluation asks how it behaves on separate observations. The computer still needs people to decide what to measure, which mistakes matter and whether the task is appropriate.
What you’ll learn
- Distinguish features, targets and models.
- Choose a suitable place to run the examples.
- Explain why new observations are needed to evaluate learning.
Give the model a clear job
Define a task
Decide what will be available when the prediction is made.
study_hours → quiz_scoreLearn from past rows
Fit a relationship using training observations.
training data → fitted modelCheck separately
Compare predictions with held-out outcomes.
unseen rows → measured errors
Name the inputs before choosing an algorithm
Prepare and run
Use Python in the course environment. The input values are included in this program; no separate data file is needed.
Python · complete runnable example
features = ["study_hours", "practice_attempts"]
target = "quiz_score"
print("Inputs:", ", ".join(features))
print("What we predict:", target)Expected output
Inputs: study_hours, practice_attempts
What we predict: quiz_scoreFollow the result
These Python lists and strings describe a proposed task; they do not train a model. The printed names help us separate information available before the quiz from the result we want to estimate. This distinction will guide every dataset and project in the course.
Choose information available before the quiz
Your task: Could the final quiz score also be an input when predicting that same score?
Worked answer
No. You would be handing the program the answer. Include measurements available at the moment a prediction is needed, and keep the score as the target. This is our first example of data leakage: information makes evaluation look better than the real task allows.
Where to practise
Use a local Python environment or a notebook that supports pandas and scikit-learn. The website shows verified examples and quizzes; it does not execute these library-based models in its plain Python compiler. Most examples use tiny data embedded in the code. The Titanic and spam projects need files, and the housing project downloads a dataset on first use.
Follow the lessons in order if Python is new to you. If you already use Python, begin with the data preparation group, but do not skip train/test separation. A complicated algorithm cannot rescue a misleading experiment.
Check your understanding
Give the model a clear job: what to remember
A machine learning task starts with information available before an outcome and a clear definition of that outcome. Training fits a relationship; separate evaluation tests its usefulness. The next step is preparing an environment where you can inspect the complete examples.
Read further: official supporting documentation.
Reaching the recap and completing the quizzes are separate milestones.