You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
var google = require('googleapis');
var prediction = google.prediction('v1.6');
var train =
'...';
var authClient = new google.auth.JWT(
'5578575756-balblabla@developer.gserviceaccount.com',
// use the PEM file we generated from the downloaded key
"g_privatekey.pem",
// Contents of private_key.pem if you want to load the pem file yourself
// (do not use the path parameter above if using this param)
// Scopes can be specified either as an array or as a single, space-delimited string
null,
['https://www.googleapis.com/auth/prediction']
// User to impersonate (leave empty if no impersonation needed)
);
authClient.authorize(function(err, tokens) {
if (err) {
console.log(err);
return;
} else {
console.log(tokens);
prediction.trainedmodels.insert({
auth: authClient,
project: 'projectAppTest',
id: '152fdh621r2ref1262',
resource: train}, function(err, result) {
console.log('Result: ' + (err ? err.message : result));
});
}
});
But I have as result log message: "Model name is empty", why? It's missing some parameters?
It may have been that your model hadn't finished training yet. If the model is done training, then analyze should return more information about the model, like its confusion matrix. Instead of analyze you could simply call get with the model id to get its status. When it's done, the response to a get call would look something like this:
Activity
davidemiceli commentedon Dec 9, 2014
I have as result for training "insert": {"kind":"prediction#training","id":"tuytyfdt6758","selfLink":"https://www.googleapis.com/prediction/v1.6/projects/predictapptest-876/trainedmodels/tuytyfdt6758"}
Result analyze:
{"kind":"prediction#analyze","id":"tuytyfdt6758","selfLink":"https://www.googleapis.com/prediction/v1.6/projects/predictapptest-876/trainedmodels/tuytyfdt6758/analyze"}
Result predict: Model is empty. Please update it first.
My predict Model is:
Why "Model is empty. Please update it first." if insert goes ok?
JustinBeckwith commentedon Mar 4, 2016
Greetings! Apologies for taking so long to get back to you. Since this was filed, we released a proper API for using the prediction API:
https://github.com/GoogleCloudPlatform/gcloud-node#google-prediction-api
Could you give that a try instead? If this is still an issue, please feel free to re-open.
Thanks!
jmdobry commentedon Mar 4, 2016
It may have been that your model hadn't finished training yet. If the model is done training, then
analyzeshould return more information about the model, like its confusion matrix. Instead ofanalyzeyou could simply callgetwith the model id to get its status. When it's done, the response to agetcall would look something like this:At which point you should be able to use
predict.