L06 | English F3 Student Learning Log

Persona: I'm a Form 3 (Grade 9) student and I only read English. I know basic Python (variables, for loops, lists) and school algebra up to quadratics. I learn from the official pages, the videos with captions, and the book. Kaggle notebook steps are written as a practice log that follows the official notebooks.

What I understood (in my own words)

  • A decision tree is like the game '20 Questions': each yes/no question splits the possibilities in two.
  • One tree makes plenty of mistakes, but many trees grown on different random data, averaged together, are much more accurate. That's a random forest.
  • A random forest can tell me which column matters most. For Titanic, sex is the most important.
  • In a competition, submit a simple version first, then improve it a little each day and watch the score.
  • At test time you can flip and crop an image a few ways, predict each, and average. That's TTA.

Where I got stuck, and how I got unstuck

Where I got stuckHow I solved it
I hadn't learned standard deviation yetI think of it as 'how spread out the numbers are'. If all values are the same it's 0. I checked my working with Python's statistics.pstdev.
Bagging and boosting sound alikeMy memory trick: bagging is a crowd guessing separately and averaging; boosting is a relay where each runner fixes the previous runner's mistakes.
Why shrink the images before training?Jeremy showed Kaggle's CPUs were too slow at reading big images, so the GPU sat waiting. Smaller images made it much faster.

My answers to the exercises

Q1. Split a small Titanic sample by sex: group A survived [1, 1, 1, 0], group B [0, 0, 0, 1]. Score the split as the sum of (population standard deviation × group size). What would a perfect split score?

Group A mean is 0.75, population SD ≈ 0.433, × 4 ≈ 1.732. Group B mean is 0.25, SD ≈ 0.433, × 4 ≈ 1.732. Total ≈ 3.464. A perfect split has every value in each group identical, so both SDs are 0 and the score is 0.

Q2. What is OneR? Why start every project with a baseline like this?

OneR uses one column and one split, e.g. 'predict female passengers survive'. It's very simple, but it sets the minimum bar: any fancier model has to beat it to be worth using.

Q3. Use 'guess how many sweets are in a jar' to explain why averaging many uncorrelated trees is more accurate.

If everyone in class guesses separately, some guess too high and some too low. As long as the guesses are independent, the average is usually close to the real number. Each tree is an independent guess, so their errors point different ways and cancel out.

Q4. Name at least three preprocessing steps a linear model needs that a random forest doesn't.

  1. No dummy variables for categories. 2) No log transform for long-tailed columns like Fare. 3) No normalization. 4) Less worry about outliers.

Q5. How can feature importance help you understand your data? Give an example of when you'd use it.

It shows which columns actually help and which you could drop. For example, to predict who joins the school badminton team, I'd include year group, height, weekly exercise hours and whether they own a racket, then see which matters most.

My Zettelkasten card

Card|Many independent ordinary guesses, averaged, can beat one expert

A random forest is simple at heart: many trees each judge using different data, and you average their answers. Each tree is flawed, but their mistakes differ, so averaging cancels them out. The key word is independent. If everyone copies one person, averaging doesn't help.

Our class did a 'guess the sweets in the jar' activity last term. Thirty people wrote down numbers; the closest guess was 40 off, but the class average was only 8 off. We thought it was luck. Now I know it's the same idea. I can also see where it breaks: if everyone had discussed it in our group chat first, our guesses would lean the same way and the average would be off. That's why random forests use random rows and random columns, to make each tree different on purpose.

Next time my group makes a decision, I'll ask everyone to write their own view first before we discuss it.

🔗 Related notes to grow next: → Teamwork: 'Think alone first, then discuss together' → Statistics: 'Averaging cancels random error, not shared bias' → Competitions: 'Small daily submissions beat one perfect attempt'


Back to lesson note:L06_隨機森林_202611041526

Built with LogoFlowershow