โก Machine Learning With Javascript
- Javascript code following a Udemy Machine Learning course.
- Note: to open web links in a new window use: ctrl+click on link
- K-Nearest Neighbor (KNN) used to try to predict which bucket a ball will land in when dropped from a height of 300px.
- Open 'index.html' in terminal to run program.
function knn(data, point, k) {
return _.chain(data)
.map((row) => {
return [distance(_.initial(row), point), _.last(row)];
})
.sortBy((row) => row[0])
.slice(0, k)
.countBy((row) => row[1])
.toPairs()
.sortBy((row) => row[1])
.last()
.first()
.parseInt()
.value();
}
- Content Delivery Network (CDN) used to deliver faster performance
- Semantic UI components
- Status: Working
- To-Do: nothing