Paul's Python CoursePPC

Project 10 of 10, for Paul

Fishing Forecast

The Act VI capstone, an end-to-end machine learning project. Good fishing or not, from what's known at dawn: three years of the fleet's log, features a skipper would recognise, a model chosen by cross-validation, one honest look at the last year, and a write-up of what worked and what didn't.

About 10 hours, in 10 steps.

Sign up free to open itLog in

Act 6 needs a free account, so your work is saved as you go. Act 1 is open to everyone.

The brief

  • PaulA fishing co-op on the coast wrote to me. They want to know if fishing's good from the weather and the tide.
  • PaulAnd who's going to use it? Six boats, and the café by the water that cooks whatever they land.
  • CaitlinThat café does the best chips on the coast, so we really need to get this right.
  • PaulThere's three years of the fleet's log, and this one's yours start to finish. Then write down what worked and what didn't.

The fleet's log is in fishing.csv: every day from 2023 to 2025, with what was known at dawn and how many boxes each boat landed. A good day is eight boxes a boat or more.

  1. In features.py, turn the log into what a dawn forecast can use: the wind as an arrow, the high water as hours from dawn, the pressure's change since yesterday, and whether each day was good. Nothing that's only known later.
  2. In forecast.py, lock 2025 away, choose between three models by cross-validation on 2023 and 2024, then test the chosen one on 2025, once, beside the skipper's rule and always saying no.
  3. Write it up: what worked, what didn't, and what the forecast can't know.
What it prints
Training days: 730, test days: 365
logistic   0.860
forest     0.842
boosting   0.853
Chosen: logistic
On 2025: 0.852
Skipper's rule: 0.723
Always saying no: 0.575
When it says good, it's right: 0.81
Good days it caught: 0.85

What you learn

What's in it

  1. The brief
  2. Compared with what?
  3. Eighty-eight in a hundred
  4. Readings a model can use
  5. Round the compass
  6. Make the features
  7. Make the forecast
  8. Milestone: the write-up
  9. Ship it