Created
September 4, 2018 18:18
-
-
Save kmaher9/f8c67a85ab6f327b59a0c22d8bd1c589 to your computer and use it in GitHub Desktop.
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
net.train(inputs, { | |
log: true, // prints to the screen the error rate, and current iteration | |
errorThresh: 0.05, // a relatively high error margin - but I'm not shooting for 100% accuracy (and it's merely a test) | |
}) | |
var testFileContent = fs.readFileSync(testFile) // read the entire sample file into memory | |
var output = net.run(testFileContent) // and then run it! This will predict the class for the testFile | |
console.log(output) | |
// output: | |
// [ business: 0.0043, tech: 0.8552] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment