Skip to content
This repository has been archived by the owner on Oct 4, 2019. It is now read-only.

Added ML project #270

Merged
merged 5 commits into from
Oct 3, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .DS_Store
Binary file not shown.
1 change: 1 addition & 0 deletions Machine_Learning_Projects/ml_js/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/node_modules
22 changes: 22 additions & 0 deletions Machine_Learning_Projects/ml_js/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
there is some training data of teams A , B , C
<br>on past experiences of teams, as they played with each other and their wins are recorded as training data . <br>
it will tell the probabilty of winning the next games by both teams.<br>

INPUT DATA is :-<br>
match of A and B :- A wins<br>
match of A and B :- A wins<br>
match of A and B :- B wins<br>

match of A and C :- C wins<br>
match of A and C :- C wins<br>
match of A and C :- A wins <br>


match of C and B :- B wins<br>
match of C and B :- B wins<br>
match of C and B :- C wins<br>
<br>
To run the following code<br>
run command :-<br>
npm install<br>
node index.js<br>
24 changes: 24 additions & 0 deletions Machine_Learning_Projects/ml_js/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
const brain=require('brain.js')
var net = new brain.NeuralNetwork();
net.train([{input: [1,2], output: [0]},
{input: [1,2], output: [0]},
{input: [1,2], output: [1]},
{input: [1,3], output: [1]},
{input: [1,3], output: [1]},
{input: [1,3], output: [0]},
{input: [2,3], output: [0]},
{input: [2,3], output: [0]},
{input: [2,3], output: [1]}
]);
var output = net.run([1,2]);
console.log('after match of A and B');
console.log('winning prob of B is'+output);
console.log('winning prob of A is'+(1-output));
var output = net.run([1,3]);
console.log('after match of A and C');
console.log('winning prob of C is'+output);
console.log('winning prob of A is'+(1-output));
var output = net.run([2,3]);
console.log('after match of C and B');
console.log('winning prob of C is'+output);
console.log('winning prob of B is'+(1-output));
35 changes: 35 additions & 0 deletions Machine_Learning_Projects/ml_js/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions Machine_Learning_Projects/ml_js/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"name": "ml_js",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"dependencies": {
"brain.js": "^1.4.1"
}
}