1. Home
  2. Explore
  3. Computer Science
  4. Machine Learning vs Deep Learning

Study methods

Flashcards
Quiz
Fill in the blanks
Written test
Lesson
Notes
Podcast
Content

Machine Learning vs Deep Learning

Speaker 1Speaker 2

Machine Learning vs Deep Learning

4:20
0:00-4:20
  1. Simon

    Alright Maria, let's kick things off with a big question: what actually is machine learning and deep learning? They're both forms of artificial intelligence, and believe it or not, AI has been around since the 1950s and 60s.

  2. Maria

    Yeah, I remember seeing that old chatbot Eliza that tried to act like a therapist. It's wild how far we've come. But at its core, AI is really just code and data making decisions—no magic involved.

  3. Simon

    Exactly. And to understand how machines learn to make decisions, let's start with something simple: predicting tomorrow's temperature. A super basic rule is to just say tomorrow will be the same as today. It's not clever, but it actually works okay.

  4. Maria

    And we can measure how good that rule is by calculating the error, right? Like, subtract the actual temperature from the prediction, take the absolute value, and average it out. That gives us a mean absolute error—in the example, it was 3.28 degrees.

  5. Simon

    Right. And to do better than that, people in the 1980s used expert systems. You come up with rules yourself—like 'take the average of the last five days' or 'if today is 5 degrees warmer than yesterday, add 2.' Then the computer just runs those rules. That dropped the error to 3.05.

  6. Maria

    So that's better, but writing hundreds of rules by hand sounds painful. That's where machine learning comes in—it automates rule generation. Instead of a human making rules, an algorithm learns them from data. That's supervised learning: give it data and something to predict, and it figures out the patterns.

  7. Simon

    A classic example is a decision tree for deciding who gets into an R-rated movie: check age, check if they're with an adult, check if they have enough money. But the algorithm we looked at in detail was linear regression. The idea is to learn a line—y equals m times x plus b—that best fits the data.

  8. Maria

    And with weather data, you can use today's maximum temperature to predict tomorrow's. Using scikit-learn, we trained a linear regression model and got coefficients: m was about 0.81 and b was around 12. That means multiply today's temp by 0.81 and add 12 to get tomorrow's prediction. And we evaluate on a separate test set so the model doesn't just memorize—it has to actually learn general rules.

  9. Simon

    That test set evaluation gave us a mean absolute error of 2.92—already better than the expert system. And we can do even better by adding more predictors. For instance, if we include rainfall, the coefficient for rain came out negative, meaning if it rained today, tomorrow is likely cooler. That dropped the error to 2.89.

  10. Maria

    But the real improvement came from feature engineering—creating new columns that give the model more insight. We added a 7-day rolling average temperature and the ratio of today's temp to that average. Just those two extra features pushed the error down to 2.69. That's a big jump without collecting new data.

  11. Simon

    And that's where deep learning steps in. With machine learning, you often have to engineer those features yourself. But deep learning—or neural networks—automatically creates new features in its hidden layers. It repeatedly applies linear transformations and non-linear activations like ReLU, building up complex representations.

  12. Maria

    So it's like the network learns its own feature engineering. We set up a small neural network with two hidden layers: the first created 20 features, the second turned those into 10, and then the output layer gave us a single prediction. The network trained using gradient descent to tweak all the weights and biases.

  13. Simon

    And after training on the same data, the neural network gave an error of 2.88—slightly worse than our engineered linear regression. That's because for structured, tabular data like weather tables, machine learning often performs better with less tuning. Deep learning shines when you have unstructured data like images or text, where it can learn the structure itself.

  14. Maria

    So the takeaway is: machine learning is great for tabular data because it's already structured and you can engineer features. Deep learning handles unstructured data automatically but needs more data, more tuning, and is harder to interpret—it's a black box. The best advice is to try both and see what works for your specific problem.

  15. Simon

    Exactly. And remember, always keep a strong error metric to compare approaches. That's how you know which method is truly better for your data. Hopefully this gives everyone a clear picture of when to use machine learning versus deep learning.

Ask anything

We've read this whole study set, so questions about it get the best answers.

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent