Machine Learning Tutorial for Beginners – USING JAVASCRIPT!




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 https://24ways.org/2010/calculating-color-contrast)

-~-~~-~~~-~~-~-
Learning Web Development? Watch the FREE COURSE:
“Web Development for Absolute Beginners”!

-~-~~-~~~-~~-~-

Original source


38 responses to “Machine Learning Tutorial for Beginners – USING JAVASCRIPT!”

  1. I almost never comment or react in here but this time I have to. I’m a developer for years now and I was looking to get into AI development and try to understand the principles. It’s quite difficult to actually find a “simple but understandable” example out there. They are often more show of video that at the end you think “damn that’s difficult”. This video is perfect because it’s highlights exactly what it is about and let us start with something a developer gets right out of the bat. Thank you for the video.

  2. Great example, thanks a lot! Just one idea, I think that you cannot spread colors into light and dark ones. Aren't there neutral colors? Based on this hypothesis, some very similar colours will suddenly jump from being light to being dark. I think the IA should be trained based on the relation between the text color and the background color, and the important thing is not if is dark or light, but if its readable

  3. Great video thank you very much!!! One question, how are you serving your static file? I didnt see you run the server or give it a port yet in the browser you have a port. Interesting way of doing it

  4. 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 to find out why. Just a bit of feedback.

  5. 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.

Leave a Reply