Uploaded March 2023 | Updated September 2026, 2 weeks ago
A generalization of the nearest neighbor classifier is the k nearest neighbors classifier (KNN for sort). K is the number of neighbors that will play a role in the classification.
I'll teach you how to implement the K Nearest Neighbors classifier in JavaScript and use it for drawing recognition.
The Course: youtube.com/playlist?list=PLB0Tybl0UNfYe9aJXfWw-Dw_4VnFrqRC4
⭐️HOMEWORK⭐️
Try to calculate a probability for the classification to be correct, based on the number of neighbors of the predicted class. Most libraries (tensorflow, scikit-learn) support this feature and it can be a useful thing to have. Other variants of nearest neighbor classifiers exist as well, like a version weighted by distance or one that considers a fixed size neighborhood. Think you can implement any of these? Share your code with me on Discord
discord.com/invite/gJFcF5XVn9
I’ll showcase my favorite implementations in a future video.
⭐️LINKS⭐️
📁 Data
github.com/gniziemazity/drawing-data
💻 Code
tps://github.com/gniziemazity/ml-course
✔️ Use P5 to follow along
✔️ P6 is the code after this lesson
⭐️TIMESTAMPS⭐️
00:00 Introduction
00:47 Intuition for the K Nearest Neighbors
01:50 Implementing the K Nearest Neighbors Classifier
06:32 Visualizing the K Nearest Neighbors on the Chart
09:44 Homework (Neighbors)
A generalization of the nearest neighbor classifier is the k nearest neighbors classifier (KNN for sort). K is the number of neighbors that will play a role in the classification.
I'll teach you how to implement the K Nearest Neighbors classifier in JavaScript and use it for drawing recognition.
The Course: youtube.com/playlist?list=PLB0Tybl0UNfYe9aJXfWw-Dw_4VnFrqRC4
⭐️HOMEWORK⭐️
Try to calculate a probability for the classification to be correct, based on the number of neighbors of the predicted class. Most libraries (tensorflow, scikit-learn) support this feature and it can be a useful thing to have. Other variants of nearest neighbor classifiers exist as well, like a version weighted by distance or one that considers a fixed size neighborhood. Think you can implement any of these? Share your code with me on Discord
discord.com/invite/gJFcF5XVn9
I’ll showcase my favorite implementations in a future video.
⭐️LINKS⭐️
📁 Data
github.com/gniziemazity/drawing-data
💻 Code
tps://github.com/gniziemazity/ml-course
✔️ Use P5 to follow along
✔️ P6 is the code after this lesson
⭐️TIMESTAMPS⭐️
00:00 Introduction
00:47 Intuition for the K Nearest Neighbors
01:50 Implementing the K Nearest Neighbors Classifier
06:32 Visualizing the K Nearest Neighbors on the Chart
09:44 Homework (Neighbors)




![AI Racing Game in JavaScript [Understanding AI - Lesson 8 / 15]
PLAYLIST: https://www.youtube.com/playlist?list=PLB0Tybl0UNfYbL1vDNrfHoYOKf1Sn0A81
Welcome to Lesson 8 of the Understanding AI course, where Ill guide you through the process of transforming a self-driving car simulation into an exhilarating racing game using JavaScript! In this tutorial, Ill show you how to take control of the main car while letting AI handle the others. Well implement crucial features like a countdown timer, progress monitoring, and a scoreboard for a complete gaming experience.
In our racing game, Ive made a deliberate choice to exclude collisions between cars, ensuring a fair and competitive environment. After all, who wants their AI-controlled car to be unexpectedly smashed by others on race day?
Now, fire up your JavaScript editors, as its time to dive into the world of racing game development! Join me as we code the non-collision racing experience youve been eagerly waiting for. Let the race begin, and dont forget to like, share, and subscribe for more lessons on AI and game development in JavaScript!
💻CODE💻
https://github.com/gniziemazity/understanding_ai
Follow Along: 3. Dijkstra Part 2
Code After This Lesson: 4. Racing Game
💬DISCORD💬
discord.gg/gJFcF5XVn9
⭐LINKS⭐
Self-driving Car Course: https://www.youtube.com/playlist?list=PLB0Tybl0UNfYoJE7ZwsBQoDIG4YN9ptyY
Trackmania Video: https://youtu.be/Dw3BZ6O_8LY
#RacingGame #RacingGameJavaScript #UnderstandingAI #LearnJavaScript
⭐TIMESTAMPS⭐
00:00 Introduction
01:36 Racing Game Interface
11:20 Measuring the Progress
25:02 Showing the Stats
41:04 Fine-tuning
45:11 Start Counter
51:20 Extending the Road at the End AI Racing Game in JavaScript [Understanding AI - Lesson 8 / 15]](https://i.ytimg.com/vi/R1e3OwuzwU8/mqdefault.jpg)


![A Virtual World - JavaScript Course: Lesson 3 / 11 [Pan & Zoom with JavaScript]
Welcome to the course where we build a self-driving car simulation in a virtual world. In this video Ill teach you how to add a dynamic viewport to our graph editor using basic HTML, CSS and JavaScript.
While the current editor may be great for smaller tasks, the dynamic viewport will be really useful if you want to create larger graphs that extend beyond your screens boundaries. The viewport will allow zooming and panning, just like the editing experience you find in software like Photoshop.
By the end of this tutorial, youll have the ability to work on expansive graphs with ease, making your editing process incredibly flexible. But thats not all – well also ensure that your hard work doesnt vanish into thin air. Ill teach you how to save your graph so that it remains intact even after refreshing the page.
Its time to get that birds eye view of your graphs, quite literally! 🦅 Lets dive in and make your graph editing experience more versatile and persistent.
Have Fun! :-)
⭐PLAYLIST⭐
https://www.youtube.com/playlist?list=PLB0Tybl0UNfZtY5IQl1aNwcoOPJNtnPEO
⭐FINAL APP⭐
https://radufromfinland.com/projects/virtualworld
💻CODE💻
https://github.com/gniziemazity/virtual-world
2. Graph Editor = follow along
3. Dynamic Viewport = code after this lesson
⭐ALL PREREQUISITES⭐
https://www.youtube.com/playlist?list=PLB0Tybl0UNfZ3nnHVg8SJ4uK3R4QD6R0H
⭐Emojis I used in the video⭐
🗑️💾
⭐My Video on 2D Vectors⭐
https://youtu.be/nzyOCd9FcCA
☕Buy me a Coffee?☕
https://www.buymeacoffee.com/radum
⚡️Join this Channel⚡️
https://youtube.com/@radu/join
⭐Timestamps⭐
00:00 Introduction
01:06 Top-level Code Structure
02:01 Zoom Functionality
09:47 Drag / Pan Functionality
26:30 Saving and Loading A Virtual World - JavaScript Course: Lesson 3 / 11 [Pan & Zoom with JavaScript]](https://i.ytimg.com/vi/S4HMcN2YlgU/mqdefault.jpg)

![Fine-Tuning the Racing Game with Self-driving Cars [Understanding AI - Lesson 15 / 15]
PLAYLIST: https://www.youtube.com/playlist?list=PLB0Tybl0UNfYbL1vDNrfHoYOKf1Sn0A81
Welcome to the grand finale, Lesson 15 of the Understanding AI course! In this concluding update, well add some finishing touches to our racing game. Well play around with styles to give the game a polished look, integrate cars into the minimap, explore a simple collision handling method, and finally, Ill share a neat trick on making the car visually impressive.
Get your editors fired up and join me for one last ride!
I really hope you enjoyed this course. If you found it helpful, please remember to like and share it with others so they too can embark on this learning adventure. Stay tuned for an upcoming live stream event!
💻CODE 💻
https://github.com/gniziemazity/understanding_ai
Follow Along: 10. Camera Input
Code After This Lesson: 11. Fine Tuning
💬DISCORD💬
discord.gg/gJFcF5XVn9
⭐LINKS⭐
Self-driving Car Course: https://www.youtube.com/playlist?list=PLB0Tybl0UNfYoJE7ZwsBQoDIG4YN9ptyY
#RacingGame #RacingGameJavaScript #Collisions #JavaScriptCollisions #3DJavaScript #3DNoLibraries #JavaScriptMiniMap
⭐TIMESTAMPS⭐
00:00 Introduction
01:02 De-emphasizing the Other Cars
05:26 Showing all Cars on MiniMap
11:30 Background and Buildings Style
16:26 Restyling the Stats
17:36 Collision Handling
26:47 Styling the Car
49:10 Fine-Tuning Fine-Tuning the Racing Game with Self-driving Cars [Understanding AI - Lesson 15 / 15]](https://i.ytimg.com/vi/SHrIPpbElkY/mqdefault.jpg)
