, , , “Machine Learning Artificial Intelligence Deep Learning Data Science, Neural Networks” You must’ve surely read somewhere about how these things are gonna , overthrow us as on earth and how we’d have to find to save humanity. take away future jobs dominant species Arnold Schwarzenegger and John Connor _The booming growth in the Machine Learning industry has brought renewed interest in people about Artificial…_www.datadriveninvestor.com DDI Editor's Pick: 5 Machine Learning Books That Turn You from Novice to Expert - Data Driven… With , there is you might have. current hype no surprise But, what is and what is ? Machine Learning Artificial Intelligence is the scientific study of and that computer systems use to effectively perform a , relying on . It is seen as a . Machine learning algorithms statistical models specific task without using explicit instructions patterns and inference instead subset of artificial intelligence And what is ? Neural Network Artificial or connectionist systems are inspired by the s that constitute animal brains. The neural network itself is , but rather a to work together and . neural networks computing systems biological neural network not an algorithm framework for many different machine learning algorithms process complex data inputs Yes, machine learning is a subset of Artificial Intelligence, and no, AI does not mean who’ve spread using the internet and have a hub called Skynet. Terminators Traditional forms of programming rely on a for the computer in a specific language, which a which the CPU . specific set of instructions compiler turns to assembly and machine code understands and executes So, what computer would give us for output. in this process and exactly what to do and when to do it. we decide We’re the brain we tell computers That’s the general premise of traditional programming. Machine learning here is a bit different. You use your machine learning to let the machine make decisions based on the outcomes of this training. data to train model ? Here’s an example: Confused How do you understand any new as a human? You the concept, what it’s saying, see and understand how to do using the same concept. concept see try to figure out some examples similar examples Right? This is what machine learning is, except here we give the examples to our model which based on found in the data. exactly chunks out the output previous outputs Yes, this joke somewhat coarsely represents how machine learning works. Now that you t of machine learning, let’s get into some simple code examples. simply understand the concep Here, I’ll be using the machine learning library ‘ ’ and brain.js JavaScript and Node.js. For this example, we’d be . using a simple and very small amount of data So we have 4 , namely 1, 2, 3, 4. Why are these not interesting names and just numbers? football teams as input Well, I am not that innovative, blame my un-originality. So, if the , that means the and if the then that means the .E.g. input: [1, 3], output: [1] → Team “3" won. output is 0 first team won output is 1 second team won So, now let’s code this. // Here we used the brain.js library to get a ready neural networkconst brain = require('brain.js');const network = new brain.NeuralNetwork(); // Now let's train the datanetwork.train([{ input: [1, 2], output: [1] }, // team 2 wins{ input: [1, 3], output: [1] }, // team 3 wins{ input: [2, 3], output: [0] }, // team 2 wins{ input: [2, 4], output: [1] }, // team 4 wins{ input: [1, 2], output: [0] }, // team 1 wins{ input: [1, 3], output: [0] }, // team 3 wins{ input: [3, 4], output: [0] } // team 3 wins]); This code trained on the basis of the data provided. Now you can get for any team’s winning using machine learning. your neural network probable output How? Well, like this: const output = network.run([1, 4]);console.log(`Prob: ${output}`); And yes, you’ve built yourself a which has been trained using your data, which can based on that data. machine learning model predict which team would win But of course, real-world machine learning of input data. is used to get desirable results with the maximum accuracy possible. can’t rely on 7 lines Lots of data So let’s get into with a larger amount of . another example data We’d use this for our input data. Naming the file as (data.json). data file [{ "text": "my unit test failed","category": "software"},{ "text": "tried the program, but it was buggy","category": "software"},{ "text": "i need a new power supply","category": "hardware"},{ "text": "the drive has a 2TB capacity","category": "hardware"},{ "text": "unit-tests","category": "software"},{ "text": "program","category": "software"},{ "text": "power supply","category": "hardware"},{ "text": "drive","category": "hardware"},{ "text": "it needs more memory","category": "hardware"},{ "text": "code","category": "software"},{ "text": "i found some bugs in the code","category": "software"},{ "text": "i swapped the memory","category": "hardware"},{ "text": "i tested the code","category": "software"}] The above data file has some sentences and a category has been allocated to it. JSON Our will take a line as input and tell the category it belongs to. machine learning model So let’s get into some . code const brain = require('brain.js');const data = require('./data.json'); const network = new brain.recurrent.LSTM(); const trainingData = data.map(item => ({input: item.text,output: item.category})); network.train(trainingData, { iterations: 2000}); This above code uses the library to create a neural network which is trained with about data for 2000 iterations. long short term memory (LSTM) For better results, we train our model to get more accuracy in results. Think of it like doing the same example question many times, until you get it perfect without making any mistakes. many times with the same data You can your network like this: test const output = network.run('I fixed the power suppy');// Category: hardware const output = network.run('The code has some bugs');// Category: software console.log(`Category: ${output}`); And yes, you’ve built yourself a machine learning model which statement belongs to. more complex computes category based on the What are you waiting for? Go and Show Off your neural networks !! In case we’re meeting for the first time here, and I mostly write about and sometimes about . I am Pradyuman Dixit Machine learning, Android Development Web Development You can read my other posts here: Machine Learning How to make a simple Machine Learning Website from Scratch How to make a Machine Learning Android Game as a beginner