Skip to content

Commit 525fdb0

Browse files
authored
Update build-a-k-nearest-neighbor-model-with-p5js.mdx
1 parent 214abe4 commit 525fdb0

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

projects/build-a-k-nearest-neighbor-model-with-p5js/build-a-k-nearest-neighbor-model-with-p5js.mdx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,15 +52,19 @@ To decide, you compare their stats to characters you've already created. If most
5252

5353
That's KNN: look at the most similar examples, count the votes, and classify the new datapoint as the majority class. If you'd like to learn more about Machine Learning models and KNN, check out our [ML course](https://www.codedex.io/machine-learning)!
5454

55+
So what's p5.js?
56+
5557
## Visualization with p5.js
5658

57-
So what's p5? [p5.js](https://www.codedex.io/p5js), a JavaScript library for creative coding, is one of my favorite programming tools, because it allows us to easily visualize complex ideas. When I was a high school computer science teacher, I would use p5.js in my classroom to introduce fundamental machine learning concepts to the students.
59+
[p5.js](https://www.codedex.io/p5js), a JavaScript library for creative coding, is one of my favorite programming tools, because it allows us to easily visualize complex ideas. When I was a high school computer science teacher, I would use p5.js in my classroom to introduce fundamental machine learning concepts to the students.
60+
61+
In this project, we'll do exactly that!
5862

59-
In this project, we'll do exactly that! We'll create a visual demo of a K-Nearest Neighbor machine learning model using p5.js. Like this:
63+
We'll create a visual demo of a K-Nearest Neighbor machine learning model using p5.js. Like this:
6064

6165
![](https://i.imgur.com/vc2Iy9j.gif)
6266

63-
Instead of warriors and wizards, our “characters” will simply be red 🔴 and green 🟢 points scattered across a canvas.
67+
Instead of warriors and wizards, our “characters” will simply be red 🔴 and green 🟢 dots scattered on a canvas.
6468

6569
Each character's "stats" are represented by its position on the canvas. For example, the `x` and `y` coordinates could represent a character's health and strength respectively.
6670

0 commit comments

Comments
 (0)