β‘ 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
![GitHub last commit](https://camo.githubusercontent.com/419bef72e1381853c55108fa859f059f3c763fbc9cb698daa08036bdc3cdb31c/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6173742d636f6d6d69742f416e647265774a426174656d616e2f6a6176617363726970742d6d616368696e652d6c6561726e696e673f7374796c653d706c6173746963)
- K-Nearest Neighbor (KNN) used to try to predict which bucket a ball will land in when dropped from a height of 300px.
![Example screenshot](https://raw.githubusercontent.com/AndrewJBateman/javascript-machine-learning/master/./img/knn.png)
- 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