# The Data a Model Needs

A model only learns what its data shows it. Turn a table into features and a label, then learn the little statistics this course needs: the middle of a column and how spread out it is, and how two columns move together, with an honest warning that moving together isn't the same as causing. The running example is a town's apartment listings.

Updated: November 19, 2026

## [Features and Labels](https://www.ask-codey.com/courses/machine-learning-python/topics/ml-features-and-labels-topic)

1. [Features and Labels](https://www.ask-codey.com/lessons/ml-features-and-labels) (Apprentice): Before a model can learn, its table is split in two, X (capital X, the features, the columns it looks at) and y (the label, the one column it learns to guess), with ID columns left out, and with rows that are enough of the right kind.

## [The Statistics You Need](https://www.ask-codey.com/courses/machine-learning-python/topics/ml-statistics-you-need)

1. [The Middle and the Spread](https://www.ask-codey.com/lessons/ml-stats-center-and-spread) (Apprentice): A column of numbers is summed up by its middle, the mean (the average) or the median (the middle value, which one extreme value can't drag), and by its spread, the standard deviation (how far values typically sit from the mean), the percentiles and the range, which statistics and describe() work out and a histogram shows.
2. [How Two Columns Move Together](https://www.ask-codey.com/lessons/ml-stats-relationships) (Apprentice): A scatter plot shows whether two columns move together, and Pearson's correlation, read "r", puts it in one number from -1 to 1 (statistics.correlation for two lists, df.corr() for a whole table), but r only measures straight-line patterns, a weak r can hide a real effect, and moving together isn't causing.

## [Exercise: Know Your Listings](https://www.ask-codey.com/courses/machine-learning-python/topics/exercise-ml-know-your-listings)

1. [Exercise: Know Your Listings](https://www.ask-codey.com/lessons/exercise-ml-know-your-listings) (Apprentice): Write three functions that split Riverside's 300 apartment listings into features and a label, sum up a column's mean, median and standard deviation, and rank the features by how strongly each moves with the rent, and let pytest check them.

## [Up Next: Predicting Numbers](https://www.ask-codey.com/courses/machine-learning-python/topics/ml-up-next-predicting-numbers)

1. [Up Next: Predicting Numbers](https://www.ask-codey.com/lessons/ml-up-next-predicting-numbers) (Apprentice): Look back at what Module 1 taught you, from a model as a rule learned from examples to the statistics that describe a table, try a first look at a problem of your own, and see what Module 2 unlocks, a first real model that predicts a number such as a home's price.

Source: https://www.ask-codey.com/courses/machine-learning-python/chapters/ml-data-a-model-needs
