Products
Features
YouTube Video Summarizer
Summarize YouTube videos
Web & PDF Highlighter
Highlight web pages & PDFs
Chat with PDF
Ask any PDF questions with AI
Ask AI Clone
Chat with your highlights & memories
Audio Transcriber
Transcribe audio files to text
Glasp Reader
Read and highlight articles
Kindle Highlight Export
Export your Kindle highlights
Idea Hatch
Hatch ideas from your highlights
Integrations
Obsidian Plugin
Notion Integration
Pocket Integration
Instapaper Integration
Medium Integration
Readwise Integration
Snipd Integration
Hypothesis Integration
Apps & Extensions
Chrome Extension
Safari Extension
Edge Add-ons
Firefox Add-ons
iOS App
Android App
Discover
Discover
Ideas
Discover new ideas and insights
Articles
Curated articles and insights
Books
Book recommendations by great minds
Posts
Essays and notes from readers
Quotes
Inspiring quotes collection
Videos
Curated videos and summaries
Explore Glasp
Glasp Newsletter
Weekly insights and updates
Glasp Talk
Interview series with great minds
Glasp Blog
Latest news and articles
Glasp Use Cases
Learn how others use Glasp
Build & Support
Glasp API
Access Glasp's API for developers
MCP Connector
Connect Glasp to Claude & ChatGPT
Community
Glasp Reddit Community
Students
Student discount and benefits
FAQs
Frequently Asked Questions
AboutPricing
DashboardLog inSign up

Applying our K Nearest Neighbors Algorithm - Practical Machine Learning Tutorial with Python p.18

84.5K views
•
May 9, 2016
by
sentdex
YouTube video player
Applying our K Nearest Neighbors Algorithm - Practical Machine Learning Tutorial with Python p.18

TL;DR

In this tutorial, we test the K nearest neighbors algorithm on the breast cancer Wisconsin dataset and compare our accuracy to scikit-learn's accuracy.

Transcript

what is going on everybody Welcome To Part 18 of our machine learning with Python tutorial Series in this tutorial we're going to take the K nearest neighbors algorithm that we wrote it appears to be working and then we're going to be testing it on some real world data and we're going to use that exact same data set that breast cancer data set and ... Read More

Key Insights

  • 😉 The K nearest neighbors algorithm is being tested on the breast cancer Wisconsin dataset.
  • 💁 The code is cleaned up and unnecessary information is removed.
  • 😫 The data is converted to float, shuffled, and split into train and test sets.
  • 👌 Dictionaries are populated with the data to prepare for the K nearest neighbors classification.
  • ❓ The accuracy of the algorithm is calculated and compared with scikit-learn's accuracy.
  • 🏆 The tutorial highlights the need to test custom implementations against established libraries to ensure accuracy.
  • 💁 The importance of cleaning up code and removing irrelevant information is emphasized.

Install to Summarize YouTube Videos and Get Transcripts

Explore YouTube Video Summarizer or Get YouTube Transcript Extractor

Questions & Answers

Q: What is the purpose of testing the K nearest neighbors algorithm on real-world data?

The purpose is to evaluate the accuracy of our implementation compared to the scikit-learn library and determine if we get similar results.

Q: Why is it necessary to clean up the code and remove unnecessary information?

Cleaning up the code helps improve readability and removes any clutter that is not relevant to the specific task of testing the algorithm on the breast cancer dataset.

Q: What is the role of the train and test sets in this tutorial?

The train and test sets are used to evaluate the accuracy of the K nearest neighbors algorithm. The algorithm is trained on the train set and then tested on the test set to determine its performance.

Q: How is the accuracy of the K nearest neighbors classifier calculated?

The accuracy is calculated by comparing the predicted class labels from the algorithm with the actual class labels in the test set and calculating the ratio of correct predictions to the total number of predictions.

Summary & Key Takeaways

  • The tutorial focuses on testing the K nearest neighbors algorithm on real-world data, specifically the breast cancer Wisconsin dataset.

  • The code is cleaned up to remove unnecessary information and imported libraries are added.

  • The data is converted to float, shuffled, and split into training and test sets. Dictionaries are then populated with the data.

  • The accuracy of the K nearest neighbors classifier is calculated and compared with scikit-learn's accuracy.


Read in Other Languages (beta)

English

Share This Summary 📚

Summarize YouTube Videos and Get Video Transcripts with 1-Click

Download browser extensions on:

Try YouTube Summary with ChatGPT & Claude or YouTube Transcript Generator

Explore More Summaries from sentdex 📚

Python Generator Functions for massive Performance Improvements with Lists thumbnail
Python Generator Functions for massive Performance Improvements with Lists
sentdex
How to Train a Chatbot Using TensorFlow and Python thumbnail
How to Train a Chatbot Using TensorFlow and Python
sentdex
Python: How to Graph the Chaikin Money Flow Trading Indicator in Matplotlib thumbnail
Python: How to Graph the Chaikin Money Flow Trading Indicator in Matplotlib
sentdex
How to Parse Twitter Data Using Python Effectively thumbnail
How to Parse Twitter Data Using Python Effectively
sentdex
Python: How to Program the Chaikin Money Flow Trading Indicator thumbnail
Python: How to Program the Chaikin Money Flow Trading Indicator
sentdex
Parsing XML - Go Lang Practical Programming Tutorial p.11 thumbnail
Parsing XML - Go Lang Practical Programming Tutorial p.11
sentdex

Summarize YouTube Videos and Get Video Transcripts with 1-Click

Download browser extensions on:

Try YouTube Summary with ChatGPT & Claude or YouTube Transcript Generator

Apps & Extensions

  • Chrome Extension
  • Safari Extension
  • Edge Add-ons
  • Firefox Add-ons
  • iOS App
  • Android App

Key Features

  • YouTube Video Summarizer
  • Web & PDF Summarizer
  • Web & PDF Highlighter
  • Chat with PDF
  • Ask AI Clone
  • Audio Transcriber
  • Glasp Reader
  • Kindle Highlight Export
  • Idea Hatch

Integrations

  • Obsidian Plugin
  • Notion Integration
  • Pocket Integration
  • Instapaper Integration
  • Medium Integration
  • Readwise Integration
  • Snipd Integration
  • Hypothesis Integration

More Features

  • APIs
  • MCP Connector
  • Blog & Post
  • Embed Links
  • Image Highlight
  • Personality Test
  • Quote Shots

Company

  • About us
  • Blog
  • Community
  • FAQs
  • Job Board
  • Newsletter
  • Pricing
Terms

•

Privacy

•

Guidelines

© 2026 Glasp Inc. All rights reserved.