admin管理员组文章数量:1023827
I am trying build predictive system into a MERN app. I am new to Tensorflow and just followed this tutorial which gets relation between Horsepower and Miles per gallon.
.html#6
I've not understood how to utilize this to get a predicted value. How do I enter a horsepower in input field and get predicted MPG.
const xs = tf.linspace(0, 1, 100);
const preds = model.predict(xs.reshape([100, 1]));
The above line is used to plot range of horsepower from low to high I guess. But how do I get a predicted value for entered value?
Please help
I am trying build predictive system into a MERN app. I am new to Tensorflow and just followed this tutorial which gets relation between Horsepower and Miles per gallon.
https://codelabs.developers.google./codelabs/tfjs-training-regression/index.html#6
I've not understood how to utilize this to get a predicted value. How do I enter a horsepower in input field and get predicted MPG.
const xs = tf.linspace(0, 1, 100);
const preds = model.predict(xs.reshape([100, 1]));
The above line is used to plot range of horsepower from low to high I guess. But how do I get a predicted value for entered value?
Please help
Share Improve this question asked Jul 19, 2019 at 15:07 Stacy JStacy J 2,78116 gold badges60 silver badges93 bronze badges1 Answer
Reset to default 5Given the model, the features are a 2d dimensional data.
If you have an input field value, you can find its prediction by using
const tensor = model.predict(tf.tensor([valueOfInput], [1, 1]))
// Get the value
const value = tensor.dataSync()[0]
I am trying build predictive system into a MERN app. I am new to Tensorflow and just followed this tutorial which gets relation between Horsepower and Miles per gallon.
.html#6
I've not understood how to utilize this to get a predicted value. How do I enter a horsepower in input field and get predicted MPG.
const xs = tf.linspace(0, 1, 100);
const preds = model.predict(xs.reshape([100, 1]));
The above line is used to plot range of horsepower from low to high I guess. But how do I get a predicted value for entered value?
Please help
I am trying build predictive system into a MERN app. I am new to Tensorflow and just followed this tutorial which gets relation between Horsepower and Miles per gallon.
https://codelabs.developers.google./codelabs/tfjs-training-regression/index.html#6
I've not understood how to utilize this to get a predicted value. How do I enter a horsepower in input field and get predicted MPG.
const xs = tf.linspace(0, 1, 100);
const preds = model.predict(xs.reshape([100, 1]));
The above line is used to plot range of horsepower from low to high I guess. But how do I get a predicted value for entered value?
Please help
Share Improve this question asked Jul 19, 2019 at 15:07 Stacy JStacy J 2,78116 gold badges60 silver badges93 bronze badges1 Answer
Reset to default 5Given the model, the features are a 2d dimensional data.
If you have an input field value, you can find its prediction by using
const tensor = model.predict(tf.tensor([valueOfInput], [1, 1]))
// Get the value
const value = tensor.dataSync()[0]
本文标签: javascriptHow to get predicted value in TensorflowjsStack Overflow
版权声明:本文标题:javascript - How to get predicted value in Tensorflow.js - Stack Overflow 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://it.en369.cn/questions/1745518765a2154216.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论