Course home · 14 lectures in 19 parts · 3 practice classes · 17 labs

Introduction to Data Science and Machine Learning

Md Mahbub E Noor · Assistant Professor, Department of CSE, University of Barishal

>>> model.fit(X_train, y_train) → Python · pandas · charts · regression · classification · evaluation · features · clustering · responsible ML

How to use

Slides: →/Space next step, ← back, F full screen, a number and Enter to jump, S slide list. The bar on top switches sessions ([ ]) and opens the lab (L). Press ? for all keys.

Labs: each lab runs Python ideas in the browser and checks every number against real Python and scikit-learn. Its bar goes back to the slides, or to the previous or next lab. Then write the same code in Jupyter or Colab.

Offline: everything is in this folder: slides, videos, labs, data and fonts. Copy it to a lab PC and open index.html in any browser, no internet needed.

Instructor: press N on any slide to show or hide the speaker notes under the slide (your choice is remembered). PPTX downloads the PowerPoint deck with notes. The student edition has neither.

Part 1 · Data science: from Python to a spam detector lectures 1–6

  1. 1
    Turning data into decisionsWhat data science is, and why it matters13 slides · recap video
  2. 2.1
    Getting startedRunning Python online in Colab and offline in Jupyter Notebook20 slides · recap video
  3. 2.2
    Hello, PythonYour first lines of code: numbers, variables and text16 slides · lab: Variables Lab · recap video
  4. 2.3
    Finding and fixing mistakesReading error messages and debugging, step by step26 slides · lab: Debugging Lab · recap video
  5. 3.1
    Making decisionsif, elif, else, and match: teaching Python to choose28 slides · lab: Decisions Lab · recap video
  6. 3.2
    Lists and tuplesStoring many values: a whole inbox in one variable29 slides · lab: Lists Lab · recap video
  7. 3.3
    Loopsfor, while, range, break: judging a whole inbox35 slides · lab: Loops Lab · recap video
  8. 4.1
    FunctionsWrite once, use everywhere, and how Python passes arguments39 slides · lab: Functions Lab · recap video
  9. 4.2
    Counting words with dictionariesThe idea behind real spam filters17 slides · lab: Word Counting Lab · recap video
  10. 5
    Real data with pandasExploring 5,572 real text messages18 slides · lab: Real Data Lab · recap video
  11. 6
    Build a real spam detectorFrom 5,169 messages to a working model, step by step21 slides · lab: Spam Model Lab · recap video

Part 2 · Machine learning lectures 7–14 · practice classes

  1. 7
    Seeing dataCharts and basic statistics: the foundation of machine learning20 slides · lab: Charts Lab · recap video
  2. 8
    What is machine learning?Learning from examples: the ideas behind every model19 slides · lab: What is ML? Lab · recap video
  3. 9
    RegressionPredicting numbers with a straight line20 slides · lab: Regression Lab · recap video
  4. 10
    Classificationk-nearest neighbours and decision trees20 slides · lab: Classifier Lab · recap video
  5. P1
    Regression and classificationpractice classHand calculations first, then code14 slides
  6. 11
    Evaluating models properlyOverfitting, cross-validation, precision and recall22 slides · lab: Evaluation Lab · recap video
  7. 12
    Preparing featuresMissing values, categories, scaling and pipelines19 slides · lab: Feature Prep Lab · recap video
  8. P2
    Evaluation clinicpractice classFind the mistakes in four experiments, then fix them16 slides
  9. 13
    Unsupervised learningFinding groups without labels: k-means clustering17 slides · lab: Clustering Lab · recap video
  10. P3
    A complete mini-projectpractice classRecognising handwritten digits, from question to report14 slides
  11. 14
    Responsible ML and what's nextFairness, privacy, and a first look at neural networks17 slides · lab: Responsible ML Lab · recap video

Your project

  1. ★
    Your machine learning projectprojectChoosing a question, finding data, and planning honest evaluation9 slides

Works offlineInteractive labs · 17 labs

One lab per lecture from 2.2 on, opened from the lab slide in each lecture. On a lab PC, students can also start from labs/START_HERE.html.

  1. 2.2
    Variables LabMemory boxes · Operators · Text tools · f-strings
  2. 2.3
    Debugging LabError decoder · Logic error hunt · Notebook trap
  3. 3.1
    Decisions LabGrade machine · and · or · not · Spam rule tester · match-case
  4. 3.2
    Lists LabList playground · Slicing · Ask the list · Two names, one list
  5. 3.3
    Loops LabLoop stepper · range() explorer · Nested loop grid · Predict the loop
  6. 4.1
    Functions LabCall visualiser · Argument matcher · Change or move? · Write and test
  7. 4.2
    Word Counting LabSplit and clean · Dictionary builder · Spam vs normal · Spam score
  8. 5
    Real Data LabLook inside · Word clues · Group and compare · Duplicates
  9. 6
    Spam Model LabSplit · Words to numbers · Train and evaluate · Try your own
  10. 7
    Charts LabMean, median, spread · Histogram · Scatter and correlation · Box plot
  11. 8
    What is ML? LabSort the tasks · Be the model · Same pattern, any model · Memorise or generalise
  12. 9
    Regression LabFit by hand · Outliers and extrapolation · Real data: diabetes · What R² means
  13. 10
    Classifier Labk-NN by hand · Decision boundaries · Read the tree · Compare the models
  14. 11
    Evaluation LabUnderfit and overfit · Choose depth honestly · Precision and recall · The accuracy trap
  15. 12
    Feature Prep LabMissing values · Categories to numbers · Scaling and neighbours · Data leakage
  16. 13
    Clustering Labk-means by hand · Watch k-means · Choose k · Limits of k-means
  17. 14
    Responsible ML LabCheck every group · Privacy · One neuron · A small network

Data and extras