Skip to content
  • 📓 CIS 340 Notebook
  • 📋 CIS 340 Schedule
  • ▶ Group Assignments & Presentation Info
    • Group Assignments
    • Data Analysis Group Presentation
  • ▶ Labs
    • ▶ Lab 1: NumPy Arrays
      • Objective
    • ▶ Lab 2: Exploring Summary Statistics with Pandas
      • Objective
    • ▶ Lab 3: Filtering and Sorting
      • Objective
    • ▶ Lab 4: groupby()
      • Objective
    • ▶ Lab 5: Reading Tables from an Azure SQL Database
      • Objective
    • ▶ Lab 6: Matplotlib and Seaborn plots
      • Objective
    • ▶ Lab 7: Bar Chart Labels
      • Objective
    • ▶ Lab 8: Plots, Correlation and Regression
      • Objective
  • ▶ 1 Getting Started
    • ▶ Ex 1.1: Intro to Jupyter Notebooks
      • Objective
      • Class Workflow
      • CIS 340 Software and Installs
      • Jupyter Notebooks
      • Markdown
  • ▶ 2 NumPy
    • ▶ Ex 2.1: Intro to NumPy
      • Objective
      • The Data Analytics Ecosystem
      • NumPy ndarrays
    • ▶ 2.2: Indexing and Slicing
      • Objective
      • Basic Indexing and Slicing
      • Importing Data Into NumPy Arrays
  • ▶ 3 Pandas
    • ▶ Ex 3.1: Reading CSV Files
      • Objective
      • Pandas DataFrames
    • ▶ Ex 3.2: Reading Excel Files
      • Objective
      • Bringing Code into Notebooks
      • uv Package Manager
      • More on DataFrame Attributes
      • Understanding Data Types
      • Changing Data Types
    • ▶ Ex 3.3: Custom Datasets & Intro to Git
      • Objective
      • Examining Summary Statistics
      • Creating Custom Datasets
      • Git Version Control
    • ▶ Ex 3.4: Filtering
      • Objective
      • Filtering DataFrames
    • ▶ Ex 3.5: Sorting and Top N
      • Objective
      • Converting Types and Sorting
      • Top and Bottom N
    • ▶ Ex 3.6: Groupby Operations - One Column
      • Objective
      • groupby() One Column
      • Adding New Columns to a DataFrame
    • ▶ Ex 3.7: Groupby Operations - Two Columns
      • Objective
      • groupby() Two Columns
    • ▶ Ex 3.8: Screenscraping and Data Cleansing
      • Objective
      • Screenscraping
      • Using First Row as Column Names
      • Data Cleansing
    • ▶ Ex 3.9: Dealing with Missing Data
      • Objective
      • Missing Data
    • ▶ Ex 3.10: Data Cleansing II and MCP Development
      • Objective
      • Inconsistent Data
      • Introduction to MCP (Model Context Protocol)
      • Building an MCP Server for Claude Desktop
    • ▶ Ex 3.11: Reading Tables from a Database
      • Objective
      • Reading Tables from a Database
  • ▶ 4 Visualizing Data with Python
    • ▶ Ex 4.1: Matplotlib and Seaborn
      • Objective
      • Matplotlib
      • Seaborn
    • ▶ Ex 4.2: Working with Different Datasets
      • Objective
      • Visualizing Joined Datasets
    • ▶ Ex 4.3: Bokeh-LineChart
      • Objective
      • Intro to Bokeh
    • ▶ Ex 4.4: Time Series and Bokeh Layouts
      • Objective
      • Layouts
      • Hover Tooltip
    • ▶ Ex 4.5: Bar Charts with Plotly Express
      • Objective
      • Plotly Express Bar Charts
    • ▶ Ex 4.6: Formatting Bar Chart Labels with Plotly Express
      • Objective
      • Add and Format Labels
  • ▶ 5 Statistical Analysis and Visualization
    • ▶ Ex 5.1: Basic Statistical Analysis
      • Objective
      • Overview of the World Happiness Report (WHR)
    • ▶ Ex 5.2: Compute Correlations Among Variables
      • Objective
  • ▶ 6 Dash & Scikit-Learn
    • ▶ Ex 6.1: Dash App Layouts and Components
      • Objective
      • Intro to Dash
      • Create a Dash App
      • Dash Layouts and Components
    • ▶ Ex 6.2: Interactive Dash App with Callbacks
      • Objective
      • Callback Functions
      • Input and Output Callback Decorators
    • ▶ Ex 6.3: Machine Learning with Scikit-Learn
      • Objective
      • Predictive Models
      • Scikit-learn
    • ▶ Ex 6.4: Classification Using Scikit-Learn
      • Objective
      • Assessing Prediction Accuracy

Ex 6.3 Scikit-learn:

Objective: Explore the Scikit-learn package, built-in datasets, and build a classifier to learn and reliably identify a new handwritten digit that it has not been trained on.

  1. Download the Ex6.3_scikit_learn.ipynb file.
  2. Work through each of the steps in the Jupyter Notebook which should include both your code and the corresponding output that match the screengrabs of the completed steps 8, 12, 13, and 14 provided below.

Expected output: Jupyter Notebook step 8 showing scikit-learn digits dataset grid of handwritten digit images

 

Expected output: Jupyter Notebook step 12 showing SVM classifier trained and tested on scikit-learn digits dataset

 

Expected output: Jupyter Notebook step 13 showing classifier predictions on unseen handwritten digit test images

 

Expected output: Jupyter Notebook step 14 showing accuracy score of classifier on scikit-learn digits dataset

← Previous Input and Output Callback Decorators Next → Predictive Models

On this page

  • Ex 6.3 Scikit-learn:
  • Objective: Explore the Scikit-learn package, built-in datasets, and build a classifier to learn and reliably identify a new handwritten digit that it has not been trained on.