Machine learning uses algorithms to find patterns in data and turn them into useful predictions or decisions. It is especially helpful when a dataset is too large or complex to inspect by eye. You still need data and a question the data might answer: the algorithm cannot produce useful answers by magic. section 8.1 section 8.2
Estimating apartment rent
Suppose a one-bedroom apartment in the city center costs $5,000 per month, while a similar apartment outside the center costs $3,000. A second bedroom and a garage also tend to raise the price. From these observations, you might estimate about $8,000 for a two-bedroom apartment in the center with a garage. Machine learning applies this kind of pattern-finding to larger, more complex collections of properties. section 8.1
Figure 8.2 Example visualization of relationships among data
The plotted properties make two relationships visible: rent tends to fall with distance from the city center, and apartments with more rooms tend to cost more. section 8.1
Choose an approach according to the question and the data available:
- Supervised learning trains on examples with known outcomes, such as fruit attributes paired with fruit labels. section 1.21
- Unsupervised learning looks for hidden relationships, such as groups of fruits with similar properties. section 1.21
- Reinforcement learning uses rewards and penalties to encourage useful actions. section 1.21
Keep the algorithm and the model distinct. The learning algorithm examines data and builds a model; the trained model is the resulting artifact used to solve problems. A practical workflow therefore includes preparing data and selecting an algorithm suited to the task, such as linear regression for prediction or a decision tree for classification. section 1.5 section 8.0









































