FREE MACHINE LEARNING: REGRESSION LEARNING PATH

WikiFree original practice workbook

The model proving ground

CASE STATUS: fictional/synthetic teaching material. Do not present the example as real research, employment experience or measured business performance.

OUTCOME
Build and evaluate a small linear-regression experiment with a held-out test set, a mean baseline and a clear limitations note.

BEFORE YOU START
Python functions, lists and reading CSV files. Basic arithmetic. Complete the Python foundations path first if these are unfamiliar.

CASE
The fictional Alder Rental Lab studies a deliberately simple synthetic relationship. Training rows use activity index x=1 to 6 and demand y=12,14,16,18,20,22. Two held-out rows have x=7,8 and actual demand 25,27. This tiny pattern is for learning mechanics, not deployment.

INPUTS
Split,Activity index x,Observed demand y
train,1,12
train,2,14
train,3,16
train,4,18
train,5,20
train,6,22
test,7,25
test,8,27


ENTRY CHECK

Question: Can test labels be used to fit the model?

Self-check: No. They are reserved for evaluation.

Question: What is a baseline?

Self-check: A simple comparison method, here the training-target mean.

Question: Does low error on two rows establish production reliability?

Self-check: No.

STAGE 1: Define the prediction and split

Prerequisite: Python functions, lists and reading CSV files. Basic arithmetic. Complete the Python foundations path first if these are unfamiliar.

Instruction: Define the target, the available inputs and the point in time when a prediction is made. Separate training and test rows before estimating coefficients. An input derived from future demand would leak the answer. Our fixed split is an instructional convenience; it is not evidence that a two-row test represents real future conditions.

Practice task: Write a prediction brief, mark the split and identify two hypothetical leakage features to exclude.

Deliverable: A prediction contract and untouched test partition.

Acceptance check: Only x is used as an input and test y values do not affect fitting.

If stuck: If you tune repeatedly against these two test rows, reserve a new evaluation set.

Record your work, decisions and evidence:




Record your result against the acceptance check:



STAGE 2: Inspect and prepare the data

Prerequisite: Bring your previous output: A prediction contract and untouched test partition.

Instruction: Plot the training observations and inspect missing values, types and units. Cleaning rules should be chosen without using the held-out targets. Keep a record of every change, even when the clean synthetic dataset requires none. A perfect-looking line in training data may reflect how the teaching data was constructed rather than a natural process.

Practice task: Load the CSV, verify eight rows and plot only the six training points first. Add explicit checks for missing or nonnumeric fields.

Deliverable: A data inspection and training scatter plot.

Acceptance check: The training set has six points and no transformation uses test target values.

If stuck: Do not fill a missing training value using an average computed over the complete dataset.

Record your work, decisions and evidence:




Record your result against the acceptance check:



STAGE 3: Fit a baseline and line

Prerequisite: Bring your previous output: A data inspection and training scatter plot.

Instruction: The mean baseline predicts the training-target mean, 17, for every case. A least-squares line estimates slope and intercept from training rows. Here the line is y=10+2x. The supplied dependency-free Python reference shows the calculation; a scikit-learn implementation is an optional equivalent. Preserve both methods so improvement is measured against something simple.

Practice task: Implement the baseline and linear fit. Print coefficients and predictions for x=7 and x=8 without refitting.

Deliverable: Two prediction methods and saved outputs.

Acceptance check: The fitted intercept is 10, slope 2 and test predictions are 24 and 26.

If stuck: If predictions exactly match 25 and 27, inspect whether test targets entered fitting.

Record your work, decisions and evidence:




Record your result against the acceptance check:



STAGE 4: Evaluate absolute error

Prerequisite: Bring your previous output: Two prediction methods and saved outputs.

Instruction: Mean absolute error averages the absolute difference between prediction and actual value, retaining the target unit. On our held-out rows, the baseline errors are 8 and 10, while the line errors are 1 and 1. Report row-level errors alongside the average. Correlation alone cannot replace this error comparison, especially in a tiny, designed dataset.

Practice task: Calculate both MAEs by hand and in code. Create a two-row error table and explain what MAE means here.

Deliverable: A baseline-versus-model evaluation.

Acceptance check: Baseline MAE is 9 and linear MAE is 1 demand unit on exactly two test rows.

If stuck: Do not average signed errors, which can cancel and disguise mistakes.

Record your work, decisions and evidence:




Record your result against the acceptance check:



STAGE 5: Decide what the experiment supports

Prerequisite: Bring your previous output: A baseline-versus-model evaluation.

Instruction: A model card should state intended use, data origin, features, split, metric and limitations. This experiment demonstrates a pipeline; it does not justify scheduling real inventory. List plausible changes in season, demand or measurement that would break the synthetic relationship. A next experiment needs new representative data and a larger untouched evaluation set.

Practice task: Write a model card and a next-data plan. Evaluate x=20 as an extrapolation example and explain why its prediction needs caution.

Deliverable: A bounded model card and reproducible run instructions.

Acceptance check: The report discloses synthetic data, two test rows and extrapolation beyond the observed range.

If stuck: Replace claims of accuracy in the real world with the exact measured result on the test rows.

Record your work, decisions and evidence:




Record your result against the acceptance check:



WORKED CASE
Training produces y=10+2x. For test x values 7 and 8, predictions 24 and 26 differ from actual 25 and 27 by one each. MAE improves from baseline 9 to model 1 on this tiny synthetic holdout only.

FINAL PROJECT
Submit the data, runnable training/evaluation script, scatter plot, error table and model card. Add a separate challenge row x=9, y=35 without refitting and explain the resulting error and a possible distribution-shift concern.

REQUIRED CRITICAL CHECK
Held-out targets never enter fitting and the baseline and model use the same evaluation rows.

SCORING
Score each of the five stage acceptance checks from 0–16 (0 missing/incorrect; 8 partially supported; 16 complete and evidenced). Score the final integrated project from 0–20 (0 missing; 10 incomplete handover; 20 complete, reproducible and consistent with the case). Target: at least 80/100 AND the critical check must pass. A total score never overrides a failed critical check.

SCOPE LIMIT
This teaches regression experiment mechanics, not production forecasting, advanced ML, causal modeling or a professional credential.

SOURCES AND ACCESS
The public videos are free. The supplied reference runs with Python standard-library modules; a notebook and scikit-learn are optional. No cloud account, paid model API or GPU is required.

Free Machine Learning Course: Learn the Fundamentals
WikiFree: https://wikifree.com/courses/microsoft-machine-learning-for-beginners/
Official source: https://www.youtube.com/playlist?list=PLlrxD0HtieHjNnGcZ1TWzPjKYWgfXSiWG
Why selected: Selected Microsoft beginner lessons introduce regression, notebooks, cleaning, plotting and linear models; classification and ROC lessons are not assigned.

Stage 1 selected lessons:

1. Introduction to Machine Learning for Beginners [Part 1] (3:22)
https://www.youtube.com/watch?v=6mSx_KJxcHI&list=PLlrxD0HtieHjNnGcZ1TWzPjKYWgfXSiWG&index=1

3. Techniques for Machine Learning [Part 3] (4:07)
https://www.youtube.com/watch?v=4NGM0U2ZSHU&list=PLlrxD0HtieHjNnGcZ1TWzPjKYWgfXSiWG&index=3

5. Introduction to Regression models for Machine Learning [Part 5] (3:28)
https://www.youtube.com/watch?v=XA3OaoW86R8&list=PLlrxD0HtieHjNnGcZ1TWzPjKYWgfXSiWG&index=5

Stage 2 selected lessons:

6. Set up Jupyter Notebooks to start building regression models [Pt 6] (5:05)
https://www.youtube.com/watch?v=7E-jC8FLA2E&list=PLlrxD0HtieHjNnGcZ1TWzPjKYWgfXSiWG&index=6

8. How to Analyze and Clean a Dataset [Part 8] (3:33)
https://www.youtube.com/watch?v=5qGjczWTrDQ&list=PLlrxD0HtieHjNnGcZ1TWzPjKYWgfXSiWG&index=8

9. How to Visualize Data with Matplotlib [Part 9] (3:41)
https://www.youtube.com/watch?v=SbUkxH6IJo0&list=PLlrxD0HtieHjNnGcZ1TWzPjKYWgfXSiWG&index=9

Stage 3 selected lessons:

7. Your First Linear Regression Project in Python [Part 7] (4:11)
https://www.youtube.com/watch?v=2xkXL5EUpS0&list=PLlrxD0HtieHjNnGcZ1TWzPjKYWgfXSiWG&index=7

10. Understanding Linear Regression [Part 10] (2:54)
https://www.youtube.com/watch?v=CRxFT8oTDMg&list=PLlrxD0HtieHjNnGcZ1TWzPjKYWgfXSiWG&index=10

12. Linear and Polynomial Regression using Scikit-learn [Part 12] (5:02)
https://www.youtube.com/watch?v=e4c_UP2fSjg&list=PLlrxD0HtieHjNnGcZ1TWzPjKYWgfXSiWG&index=12

Stage 4 selected lessons:

11. Looking for Correlation: The Key to Linear Regression [Part 11] (3:36)
https://www.youtube.com/watch?v=uoRq-lW2eQo&list=PLlrxD0HtieHjNnGcZ1TWzPjKYWgfXSiWG&index=11

REUSE
Original WikiFree teaching text and synthetic fixtures are supplied for personal learning and adaptation with attribution. Provider lessons remain on their original sites and retain their own terms. No provider certificate is included.