Ready to use algorithms to train your own models with Tensorflow for NodeJS.
Basic scripts:
# Install dependencies
npm install # Important: do NOT use yarn as it doesn't support npm_config variables!!!
# Build app
npm run build
Train model:
npm run model:train --name=NAME_OF_MODEL
- Copy
cars.json
fromsrc/models/examples/cars
intomodels
folder in your project root - Run
npm run model:train --name=example/cars
- Get familiar with the tabular data in the output
You should notice 6 columns:
(index)
- just a row numberAcc
- car acceleration - first input dataWeight
- car's weight in lbs - seconds input dataHP
- car's horsepower - output record from the test dataHP (pred)
- car's horsepower - predicted by your AI modelDiff
- difference betweenHP
andHP (pred)
In this case - definitely not!
First of all the model is trained only on 320 records. 80 were used to test model accuracy.
Secondly, we can see model isn't overtrained which is a good sign
Lastly, the difference between HP
and HP (pred)
is not that big. It's just ~12-15 on average.
Imagine you have a car, the has 2074lbs weight and accelerates to 100mph in 19 seconds. Is it possible to predict its actual horsepower? Definitely not! In this case the model predicts it as similar as human would so we can consider this as an expected result.
- Read CSV
- Simplify code more and more
- Add classification algorithms (SVM and KNN)
- Add Image recognition algorithms (using CNN)
- Add NLP algorithms (probably using RNN)
- Add more examples