-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Neural Network - Machine Learning in JavaScript using Brain JS
- Loading branch information
0 parents
commit db3365b
Showing
5 changed files
with
109 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
[ | ||
{ | ||
"input": "Inside Chi's nursery", | ||
"output": "kardashian" | ||
}, | ||
{ | ||
"input": "Why I dyed my hair pink", | ||
"output": "kardashian" | ||
}, | ||
{ | ||
"input": "Feeling Blue (wearing @kkwbeauty powder contour in medium & dark contour kit as eye shadow, & a new lip coming soon)", | ||
"output": "kardashian" | ||
}, | ||
{ | ||
"input": "The Classic Blossom Palette is SOLD OUT 🌸 Can’t wait to see all your looks with this! Sign up for restock updates: https://kkwbeauty.com/pages/signup )", | ||
"output": "kardashian" | ||
}, | ||
{ | ||
"input": "Awww this part of GABBANA makes me so sad 😢😢😢", | ||
"output": "kardashian" | ||
}, | ||
|
||
|
||
{ | ||
"input": "Dem Memo: FBI did not disclose who the clients were - the Clinton Campaign and the DNC. Wow!", | ||
"output": "trump" | ||
}, | ||
{ | ||
"input": "Thank you to the great men and women of the United States @SecretService for a job well done!", | ||
"output": "trump" | ||
}, | ||
{ | ||
"input": "Congressman Lee Zeldin is doing a fantastic job in D.C. Tough and smart, he loves our Country and will always be there to do the right thing. He has my Complete and Total Endorsement!", | ||
"output": "trump" | ||
}, | ||
{ | ||
"input": "China is actually placing propaganda ads in the Des Moines Register and other papers, made to look like news. That’s because we are beating them on Trade, opening markets, and the farmers will make a fortune when this is over!", | ||
"output": "trump" | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
const brain = require('brain.js'); | ||
const data = require('./data.json'); | ||
|
||
const network = new brain.recurrent.LSTM(); | ||
|
||
const trainingData = data.map(item => ({ | ||
input : item.input, | ||
output : item.output | ||
})); | ||
|
||
network.train(trainingData,{ | ||
iterations : 100 | ||
}); | ||
|
||
const output = network.run("Jobless Claims fell to their lowest level in 49 years!"); | ||
|
||
|
||
console.log(`Person: ${output}`); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"name": "Machine_Learning_in_JavaScript", | ||
"version": "1.0.0", | ||
"description": "", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
}, | ||
"keywords": [], | ||
"author": "", | ||
"license": "ISC", | ||
"dependencies": { | ||
"brain.js": "^1.4.1" | ||
} | ||
} |