Published on March 19, 2018 by LearnCode.academy

In a few lines of code, we can tackle real browser or server challenges with machine learning and neural networks! Here’s the source code:

Machine learning is a fun new(er) way to solve problems.
Rather than programming an algorithm for answering a question about our data, we instead can train a “neural network” with a set of training data. Once we have a trained network, we can use it to predict outcomes.

In this example, we will train a neural network to distinguish between dark and light colors and pick the appropriate color of text to go over the top. To do this without machine learning, there is no single solution that will always get it right (see this blog post 24ways.org/2010/calculating-color-contrast)

Leave a Reply

252 Comments on "Machine Learning Tutorial for Beginners – USING JAVASCRIPT!"

Notify of
avatar

BRGameSoft
Guest
BRGameSoft
8 days 5 hours ago

What if I train my program to do something, then I wish to train him a few more things? Do I need to train EVERYTHING again or is it possible to train a few extra things only?

k camel
Guest
k camel
13 days 6 hours ago

thanks for this 👏👏👏

GeeksPort
Guest
GeeksPort
27 days 13 hours ago

That was awesome…

Ya shoe
Guest
Ya shoe
1 month 3 days ago

Damn, making machine learning perks & features available to everyone. Well done brain.js, well done.

Martin Naughton
Guest
Martin Naughton
1 month 8 days ago
Really good video and it was the first video i found to understand brain.js. It was confusing though when you used numbers largers than 1 to with brain.js I did not hear your point that it only works well with input between 1 and 0. I thought it would deal with height, width and weight data accurately like in your example with more data. Even when i put in the exact input data to run with that was in the training it never reaches over 90%. This because it was dealing with numbers over 1. Took me a few hours… Read more »
LearnCode.academy
Guest
LearnCode.academy
1 month 8 days ago

So sorry about that! I hate thinking that one bad explanation caused you some wasted time 🙁

J N
Guest
J N
1 month 12 days ago

so so cool

Ville-Matti Hakanpää
Guest
Ville-Matti Hakanpää
1 month 14 days ago

That was awesome! Thanks!

LostInAutism
Guest
LostInAutism
1 month 14 days ago

One thing that I've noticed is the lack of semicolons people use in JavaScript. I always thought it was just the way it works and that it's more lenient as opposed to other languages. As a C# developer it hurts my head and if there's a better understanding I would honestly like to know. Thanks.

Bracer Jack
Guest
Bracer Jack
1 month 16 days ago

I downloaded "brain.js-develop.zip", inside the folder there are many js files but no brain.js, please explain to me how to include it, I don't like to use npm.

Bracer Jack
Guest
Bracer Jack
1 month 16 days ago

Wow I fucking love your voice !

1 2 3 19
wpDiscuz