15. Machine Learning: Classification, Regression and Clustering

Objectives

  • Use scikit-learn with popular datasets to perform machine learning studies.
  • Use Seaborn and Matplotlib to visualize and explore data.
  • Perform supervised machine learning with k-nearest neighbors classification and linear regression.
  • Perform multi-classification with Digits dataset.
  • Divide a dataset into training, test and validation sets.
  • Tune model hyperparameters with k-fold cross-validation.
  • Measure model performance.
  • Display a confusion matrix showing classification prediction hits and misses.
  • Perform multiple linear regression with the California Housing dataset.
  • Perform dimensionality reduction with PCA and t-SNE on the Iris and Digits datasets to prepare them for two-dimensional visualizations.
  • Perform unsupervised machine learning with k-means clustering and the Iris dataset.

Outline

Outline (cont.)

Outline (cont.)

  • 15.5 Case Study: Multiple Linear Regression with the California Housing Dataset
    • 15.5.1 Loading the Dataset
    • 15.5.2 Exploring the Data with Pandas
    • 15.5.3 Visualizing the Features
    • 15.5.4 Splitting the Data for Training and Testing
    • 15.5.5 Training the Model
    • 15.5.6 Testing the Model
    • 15.5.7 Visualizing the Expected vs. Predicted Prices
    • 15.5.8 Regression Model Metrics
    • 15.5.9 Choosing the Best Model

Outline (cont.)


©1992–2020 by Pearson Education, Inc. All Rights Reserved. This content is based on Chapter 5 of the book Intro to Python for Computer Science and Data Science: Learning to Program with AI, Big Data and the Cloud.

DISCLAIMER: The authors and publisher of this book have used their best efforts in preparing the book. These efforts include the development, research, and testing of the theories and programs to determine their effectiveness. The authors and publisher make no warranty of any kind, expressed or implied, with regard to these programs or to the documentation contained in these books. The authors and publisher shall not be liable in any event for incidental or consequential damages in connection with, or arising out of, the furnishing, performance, or use of these programs.