Skip to content
Wildflower
Join free
Automated trading and AI

Free Trading School · Level 7 · Course 7.11

Machine learning in plain words

Lesson 11 of 19 in Automated trading and AIModule 3: AI and trading

Advanced · Automated trading and AI

Machine learning in plain words

Wildflower Trading School · Lesson 7.11.3.2

Wildflower

Machine learning sounds technical, but the core idea fits on one picture. By the end of this lesson, you'll know what training and testing mean. And you'll see why a model can shine on old data and fail on new data. You'll also see why more settings raise the risk of fooling yourself.

1 of 8

What you'll learn

  • Tell training from testing. Training fits past examples. Testing scores unseen ones.
  • Compare the two scores. A big gap means the settings fit noise.
  • Keep test data apart. Checking against it many times turns it into training data.
  • Hunt for leaks first. A score that looks too good may use future values.
  • Look past one score. Costs, move size and sample size come next.

Exercise

  1. Draw ten made-up dots on paper and split them: seven for training, three for testing.
  2. Draw a straight line and a wiggly line through the seven.
  3. Then see which line lands closer to the three you held back.

Next: Using AI chat tools to learn and code.

Quick check

  1. 1. Which score says something about new data?

  2. 2. A model scores 95% in training and 51% in testing. What does the gap suggest?

  3. 3. What does adding more settings to a model do?

0 of 3 answered.

Finished this lesson?

Tick it off and keep your place

Make a free account and we'll remember where you are, so “Using AI chat tools to learn and code” is waiting next time.

Read the full notes

Machine learning means a program adjusts its settings to fit past examples (training), then is scored on examples it never saw (testing). More settings can fit more noise, so a big gap between the training and test scores is the warning sign, and a leak from the future can make any score look too good.

  • : a program adjusts its own settings to fit examples. Each example is what was known at one moment and what happened next.
  • Training: adjusting the settings to fit the examples. Testing: scoring it on examples it never saw. The same idea as In-sample and out-of-sample data.
  • Made-up picture: a straight line (2 settings) misses most training dots by a little; a wiggly line through every dot is perfect on training data and worse on new dots. That's : What overfitting is.
  • More settings fit more of the . Warning sign: a big gap between training and test scores. Checking and changing against the test data many times turns it into training data.
  • Leaks: a value not yet known at that moment (Look-ahead bias), or test data mixed into training. A test score that looks too good is a reason to look for a leak first.
  • Made-up: training 900 of 1,000 (90%), test 130 of 250 (52%). The gap says noise; 52% alone ignores costs and move size, and 250 examples leave room for chance (Sample size). Answer to the drill: 56%. Guide: AI and machine learning in trading.

Worked example

Made-up numbers

Training score versus test score

Made-up numbers · up-or-down prediction for the next hour

  1. Training: 900 ÷ 1,000 = 90%.
  2. Test: 130 ÷ 250 = 52%.
  3. The big gap points to noise learned in training.

Only the test score speaks about new data, and even then costs, move size and sample size come next.

Your turn

Drill

Made-up numbers · a model is right on 140 of 250 test examples

Trading is risky. You can lose money, whatever method found the rules. Test results are hypothetical, and a test can’t tell you what will happen next. This lesson explains how things work. It isn’t advice.