Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(575)

Side by Side Diff: generated/googleapis/lib/prediction/v1_6.dart

Issue 559053002: Generate 0.1.0 version of googleapis/googleapis_beta (Closed) Base URL: git@github.com:dart-lang/googleapis.git@master
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 library googleapis.prediction.v1_6;
2
3 import "dart:core" as core;
4 import "dart:collection" as collection;
5 import "dart:async" as async;
6 import "dart:convert" as convert;
7
8 import "package:crypto/crypto.dart" as crypto;
9 import 'package:http/http.dart' as http;
10 import '../src/common_internal.dart' as common_internal;
11 import '../common/common.dart' as common;
12
13 export '../common/common.dart' show ApiRequestError;
14 export '../common/common.dart' show DetailedApiRequestError;
15
16 /**
17 * Lets you access a cloud hosted machine learning service that makes it easy to
18 * build smart apps
19 */
20 class PredictionApi {
21 /** Manage your data and permissions in Google Cloud Storage */
22 static const DevstorageFullControlScope = "https://www.googleapis.com/auth/dev storage.full_control";
23
24 /** View your data in Google Cloud Storage */
25 static const DevstorageReadOnlyScope = "https://www.googleapis.com/auth/devsto rage.read_only";
26
27 /** Manage your data in Google Cloud Storage */
28 static const DevstorageReadWriteScope = "https://www.googleapis.com/auth/devst orage.read_write";
29
30 /** Manage your data in the Google Prediction API */
31 static const PredictionScope = "https://www.googleapis.com/auth/prediction";
32
33
34 final common_internal.ApiRequester _requester;
35
36 HostedmodelsResourceApi get hostedmodels => new HostedmodelsResourceApi(_reque ster);
37 TrainedmodelsResourceApi get trainedmodels => new TrainedmodelsResourceApi(_re quester);
38
39 PredictionApi(http.Client client) :
40 _requester = new common_internal.ApiRequester(client, "https://www.googlea pis.com/", "/prediction/v1.6/projects/");
41 }
42
43
44 /** Not documented yet. */
45 class HostedmodelsResourceApi {
46 final common_internal.ApiRequester _requester;
47
48 HostedmodelsResourceApi(common_internal.ApiRequester client) :
49 _requester = client;
50
51 /**
52 * Submit input and request an output against a hosted model.
53 *
54 * [request] - The metadata request object.
55 *
56 * Request parameters:
57 *
58 * [project] - The project associated with the model.
59 *
60 * [hostedModelName] - The name of a hosted model.
61 *
62 * Completes with a [Output].
63 *
64 * Completes with a [common.ApiRequestError] if the API endpoint returned an
65 * error.
66 *
67 * If the used [http.Client] completes with an error when making a REST call,
68 * this method will complete with the same error.
69 */
70 async.Future<Output> predict(Input request, core.String project, core.String h ostedModelName) {
71 var _url = null;
72 var _queryParams = new core.Map();
73 var _uploadMedia = null;
74 var _uploadOptions = null;
75 var _downloadOptions = common.DownloadOptions.Metadata;
76 var _body = null;
77
78 if (request != null) {
79 _body = convert.JSON.encode((request).toJson());
80 }
81 if (project == null) {
82 throw new core.ArgumentError("Parameter project is required.");
83 }
84 if (hostedModelName == null) {
85 throw new core.ArgumentError("Parameter hostedModelName is required.");
86 }
87
88
89 _url = common_internal.Escaper.ecapeVariable('$project') + '/hostedmodels/' + common_internal.Escaper.ecapeVariable('$hostedModelName') + '/predict';
90
91 var _response = _requester.request(_url,
92 "POST",
93 body: _body,
94 queryParams: _queryParams,
95 uploadOptions: _uploadOptions,
96 uploadMedia: _uploadMedia,
97 downloadOptions: _downloadOptions);
98 return _response.then((data) => new Output.fromJson(data));
99 }
100
101 }
102
103
104 /** Not documented yet. */
105 class TrainedmodelsResourceApi {
106 final common_internal.ApiRequester _requester;
107
108 TrainedmodelsResourceApi(common_internal.ApiRequester client) :
109 _requester = client;
110
111 /**
112 * Get analysis of the model and the data the model was trained on.
113 *
114 * Request parameters:
115 *
116 * [project] - The project associated with the model.
117 *
118 * [id] - The unique name for the predictive model.
119 *
120 * Completes with a [Analyze].
121 *
122 * Completes with a [common.ApiRequestError] if the API endpoint returned an
123 * error.
124 *
125 * If the used [http.Client] completes with an error when making a REST call,
126 * this method will complete with the same error.
127 */
128 async.Future<Analyze> analyze(core.String project, core.String id) {
129 var _url = null;
130 var _queryParams = new core.Map();
131 var _uploadMedia = null;
132 var _uploadOptions = null;
133 var _downloadOptions = common.DownloadOptions.Metadata;
134 var _body = null;
135
136 if (project == null) {
137 throw new core.ArgumentError("Parameter project is required.");
138 }
139 if (id == null) {
140 throw new core.ArgumentError("Parameter id is required.");
141 }
142
143
144 _url = common_internal.Escaper.ecapeVariable('$project') + '/trainedmodels/' + common_internal.Escaper.ecapeVariable('$id') + '/analyze';
145
146 var _response = _requester.request(_url,
147 "GET",
148 body: _body,
149 queryParams: _queryParams,
150 uploadOptions: _uploadOptions,
151 uploadMedia: _uploadMedia,
152 downloadOptions: _downloadOptions);
153 return _response.then((data) => new Analyze.fromJson(data));
154 }
155
156 /**
157 * Delete a trained model.
158 *
159 * Request parameters:
160 *
161 * [project] - The project associated with the model.
162 *
163 * [id] - The unique name for the predictive model.
164 *
165 * Completes with a [common.ApiRequestError] if the API endpoint returned an
166 * error.
167 *
168 * If the used [http.Client] completes with an error when making a REST call,
169 * this method will complete with the same error.
170 */
171 async.Future delete(core.String project, core.String id) {
172 var _url = null;
173 var _queryParams = new core.Map();
174 var _uploadMedia = null;
175 var _uploadOptions = null;
176 var _downloadOptions = common.DownloadOptions.Metadata;
177 var _body = null;
178
179 if (project == null) {
180 throw new core.ArgumentError("Parameter project is required.");
181 }
182 if (id == null) {
183 throw new core.ArgumentError("Parameter id is required.");
184 }
185
186 _downloadOptions = null;
187
188 _url = common_internal.Escaper.ecapeVariable('$project') + '/trainedmodels/' + common_internal.Escaper.ecapeVariable('$id');
189
190 var _response = _requester.request(_url,
191 "DELETE",
192 body: _body,
193 queryParams: _queryParams,
194 uploadOptions: _uploadOptions,
195 uploadMedia: _uploadMedia,
196 downloadOptions: _downloadOptions);
197 return _response.then((data) => null);
198 }
199
200 /**
201 * Check training status of your model.
202 *
203 * Request parameters:
204 *
205 * [project] - The project associated with the model.
206 *
207 * [id] - The unique name for the predictive model.
208 *
209 * Completes with a [Insert2].
210 *
211 * Completes with a [common.ApiRequestError] if the API endpoint returned an
212 * error.
213 *
214 * If the used [http.Client] completes with an error when making a REST call,
215 * this method will complete with the same error.
216 */
217 async.Future<Insert2> get(core.String project, core.String id) {
218 var _url = null;
219 var _queryParams = new core.Map();
220 var _uploadMedia = null;
221 var _uploadOptions = null;
222 var _downloadOptions = common.DownloadOptions.Metadata;
223 var _body = null;
224
225 if (project == null) {
226 throw new core.ArgumentError("Parameter project is required.");
227 }
228 if (id == null) {
229 throw new core.ArgumentError("Parameter id is required.");
230 }
231
232
233 _url = common_internal.Escaper.ecapeVariable('$project') + '/trainedmodels/' + common_internal.Escaper.ecapeVariable('$id');
234
235 var _response = _requester.request(_url,
236 "GET",
237 body: _body,
238 queryParams: _queryParams,
239 uploadOptions: _uploadOptions,
240 uploadMedia: _uploadMedia,
241 downloadOptions: _downloadOptions);
242 return _response.then((data) => new Insert2.fromJson(data));
243 }
244
245 /**
246 * Train a Prediction API model.
247 *
248 * [request] - The metadata request object.
249 *
250 * Request parameters:
251 *
252 * [project] - The project associated with the model.
253 *
254 * Completes with a [Insert2].
255 *
256 * Completes with a [common.ApiRequestError] if the API endpoint returned an
257 * error.
258 *
259 * If the used [http.Client] completes with an error when making a REST call,
260 * this method will complete with the same error.
261 */
262 async.Future<Insert2> insert(Insert request, core.String project) {
263 var _url = null;
264 var _queryParams = new core.Map();
265 var _uploadMedia = null;
266 var _uploadOptions = null;
267 var _downloadOptions = common.DownloadOptions.Metadata;
268 var _body = null;
269
270 if (request != null) {
271 _body = convert.JSON.encode((request).toJson());
272 }
273 if (project == null) {
274 throw new core.ArgumentError("Parameter project is required.");
275 }
276
277
278 _url = common_internal.Escaper.ecapeVariable('$project') + '/trainedmodels';
279
280 var _response = _requester.request(_url,
281 "POST",
282 body: _body,
283 queryParams: _queryParams,
284 uploadOptions: _uploadOptions,
285 uploadMedia: _uploadMedia,
286 downloadOptions: _downloadOptions);
287 return _response.then((data) => new Insert2.fromJson(data));
288 }
289
290 /**
291 * List available models.
292 *
293 * Request parameters:
294 *
295 * [project] - The project associated with the model.
296 *
297 * [maxResults] - Maximum number of results to return.
298 *
299 * [pageToken] - Pagination token.
300 *
301 * Completes with a [List].
302 *
303 * Completes with a [common.ApiRequestError] if the API endpoint returned an
304 * error.
305 *
306 * If the used [http.Client] completes with an error when making a REST call,
307 * this method will complete with the same error.
308 */
309 async.Future<List> list(core.String project, {core.int maxResults, core.String pageToken}) {
310 var _url = null;
311 var _queryParams = new core.Map();
312 var _uploadMedia = null;
313 var _uploadOptions = null;
314 var _downloadOptions = common.DownloadOptions.Metadata;
315 var _body = null;
316
317 if (project == null) {
318 throw new core.ArgumentError("Parameter project is required.");
319 }
320 if (maxResults != null) {
321 _queryParams["maxResults"] = ["${maxResults}"];
322 }
323 if (pageToken != null) {
324 _queryParams["pageToken"] = [pageToken];
325 }
326
327
328 _url = common_internal.Escaper.ecapeVariable('$project') + '/trainedmodels/l ist';
329
330 var _response = _requester.request(_url,
331 "GET",
332 body: _body,
333 queryParams: _queryParams,
334 uploadOptions: _uploadOptions,
335 uploadMedia: _uploadMedia,
336 downloadOptions: _downloadOptions);
337 return _response.then((data) => new List.fromJson(data));
338 }
339
340 /**
341 * Submit model id and request a prediction.
342 *
343 * [request] - The metadata request object.
344 *
345 * Request parameters:
346 *
347 * [project] - The project associated with the model.
348 *
349 * [id] - The unique name for the predictive model.
350 *
351 * Completes with a [Output].
352 *
353 * Completes with a [common.ApiRequestError] if the API endpoint returned an
354 * error.
355 *
356 * If the used [http.Client] completes with an error when making a REST call,
357 * this method will complete with the same error.
358 */
359 async.Future<Output> predict(Input request, core.String project, core.String i d) {
360 var _url = null;
361 var _queryParams = new core.Map();
362 var _uploadMedia = null;
363 var _uploadOptions = null;
364 var _downloadOptions = common.DownloadOptions.Metadata;
365 var _body = null;
366
367 if (request != null) {
368 _body = convert.JSON.encode((request).toJson());
369 }
370 if (project == null) {
371 throw new core.ArgumentError("Parameter project is required.");
372 }
373 if (id == null) {
374 throw new core.ArgumentError("Parameter id is required.");
375 }
376
377
378 _url = common_internal.Escaper.ecapeVariable('$project') + '/trainedmodels/' + common_internal.Escaper.ecapeVariable('$id') + '/predict';
379
380 var _response = _requester.request(_url,
381 "POST",
382 body: _body,
383 queryParams: _queryParams,
384 uploadOptions: _uploadOptions,
385 uploadMedia: _uploadMedia,
386 downloadOptions: _downloadOptions);
387 return _response.then((data) => new Output.fromJson(data));
388 }
389
390 /**
391 * Add new data to a trained model.
392 *
393 * [request] - The metadata request object.
394 *
395 * Request parameters:
396 *
397 * [project] - The project associated with the model.
398 *
399 * [id] - The unique name for the predictive model.
400 *
401 * Completes with a [Insert2].
402 *
403 * Completes with a [common.ApiRequestError] if the API endpoint returned an
404 * error.
405 *
406 * If the used [http.Client] completes with an error when making a REST call,
407 * this method will complete with the same error.
408 */
409 async.Future<Insert2> update(Update request, core.String project, core.String id) {
410 var _url = null;
411 var _queryParams = new core.Map();
412 var _uploadMedia = null;
413 var _uploadOptions = null;
414 var _downloadOptions = common.DownloadOptions.Metadata;
415 var _body = null;
416
417 if (request != null) {
418 _body = convert.JSON.encode((request).toJson());
419 }
420 if (project == null) {
421 throw new core.ArgumentError("Parameter project is required.");
422 }
423 if (id == null) {
424 throw new core.ArgumentError("Parameter id is required.");
425 }
426
427
428 _url = common_internal.Escaper.ecapeVariable('$project') + '/trainedmodels/' + common_internal.Escaper.ecapeVariable('$id');
429
430 var _response = _requester.request(_url,
431 "PUT",
432 body: _body,
433 queryParams: _queryParams,
434 uploadOptions: _uploadOptions,
435 uploadMedia: _uploadMedia,
436 downloadOptions: _downloadOptions);
437 return _response.then((data) => new Insert2.fromJson(data));
438 }
439
440 }
441
442
443
444 /** Not documented yet. */
445 class AnalyzeDataDescriptionFeaturesCategoricalValues {
446 /** Number of times this feature had this value. */
447 core.String count;
448
449 /** The category name. */
450 core.String value;
451
452
453 AnalyzeDataDescriptionFeaturesCategoricalValues();
454
455 AnalyzeDataDescriptionFeaturesCategoricalValues.fromJson(core.Map _json) {
456 if (_json.containsKey("count")) {
457 count = _json["count"];
458 }
459 if (_json.containsKey("value")) {
460 value = _json["value"];
461 }
462 }
463
464 core.Map toJson() {
465 var _json = new core.Map();
466 if (count != null) {
467 _json["count"] = count;
468 }
469 if (value != null) {
470 _json["value"] = value;
471 }
472 return _json;
473 }
474 }
475
476
477 /** Description of the categorical values of this feature. */
478 class AnalyzeDataDescriptionFeaturesCategorical {
479 /** Number of categorical values for this feature in the data. */
480 core.String count;
481
482 /** List of all the categories for this feature in the data set. */
483 core.List<AnalyzeDataDescriptionFeaturesCategoricalValues> values;
484
485
486 AnalyzeDataDescriptionFeaturesCategorical();
487
488 AnalyzeDataDescriptionFeaturesCategorical.fromJson(core.Map _json) {
489 if (_json.containsKey("count")) {
490 count = _json["count"];
491 }
492 if (_json.containsKey("values")) {
493 values = _json["values"].map((value) => new AnalyzeDataDescriptionFeatures CategoricalValues.fromJson(value)).toList();
494 }
495 }
496
497 core.Map toJson() {
498 var _json = new core.Map();
499 if (count != null) {
500 _json["count"] = count;
501 }
502 if (values != null) {
503 _json["values"] = values.map((value) => (value).toJson()).toList();
504 }
505 return _json;
506 }
507 }
508
509
510 /** Description of the numeric values of this feature. */
511 class AnalyzeDataDescriptionFeaturesNumeric {
512 /** Number of numeric values for this feature in the data set. */
513 core.String count;
514
515 /** Mean of the numeric values of this feature in the data set. */
516 core.String mean;
517
518 /** Variance of the numeric values of this feature in the data set. */
519 core.String variance;
520
521
522 AnalyzeDataDescriptionFeaturesNumeric();
523
524 AnalyzeDataDescriptionFeaturesNumeric.fromJson(core.Map _json) {
525 if (_json.containsKey("count")) {
526 count = _json["count"];
527 }
528 if (_json.containsKey("mean")) {
529 mean = _json["mean"];
530 }
531 if (_json.containsKey("variance")) {
532 variance = _json["variance"];
533 }
534 }
535
536 core.Map toJson() {
537 var _json = new core.Map();
538 if (count != null) {
539 _json["count"] = count;
540 }
541 if (mean != null) {
542 _json["mean"] = mean;
543 }
544 if (variance != null) {
545 _json["variance"] = variance;
546 }
547 return _json;
548 }
549 }
550
551
552 /** Description of multiple-word text values of this feature. */
553 class AnalyzeDataDescriptionFeaturesText {
554 /** Number of multiple-word text values for this feature. */
555 core.String count;
556
557
558 AnalyzeDataDescriptionFeaturesText();
559
560 AnalyzeDataDescriptionFeaturesText.fromJson(core.Map _json) {
561 if (_json.containsKey("count")) {
562 count = _json["count"];
563 }
564 }
565
566 core.Map toJson() {
567 var _json = new core.Map();
568 if (count != null) {
569 _json["count"] = count;
570 }
571 return _json;
572 }
573 }
574
575
576 /** Not documented yet. */
577 class AnalyzeDataDescriptionFeatures {
578 /** Description of the categorical values of this feature. */
579 AnalyzeDataDescriptionFeaturesCategorical categorical;
580
581 /** The feature index. */
582 core.String index;
583
584 /** Description of the numeric values of this feature. */
585 AnalyzeDataDescriptionFeaturesNumeric numeric;
586
587 /** Description of multiple-word text values of this feature. */
588 AnalyzeDataDescriptionFeaturesText text;
589
590
591 AnalyzeDataDescriptionFeatures();
592
593 AnalyzeDataDescriptionFeatures.fromJson(core.Map _json) {
594 if (_json.containsKey("categorical")) {
595 categorical = new AnalyzeDataDescriptionFeaturesCategorical.fromJson(_json ["categorical"]);
596 }
597 if (_json.containsKey("index")) {
598 index = _json["index"];
599 }
600 if (_json.containsKey("numeric")) {
601 numeric = new AnalyzeDataDescriptionFeaturesNumeric.fromJson(_json["numeri c"]);
602 }
603 if (_json.containsKey("text")) {
604 text = new AnalyzeDataDescriptionFeaturesText.fromJson(_json["text"]);
605 }
606 }
607
608 core.Map toJson() {
609 var _json = new core.Map();
610 if (categorical != null) {
611 _json["categorical"] = (categorical).toJson();
612 }
613 if (index != null) {
614 _json["index"] = index;
615 }
616 if (numeric != null) {
617 _json["numeric"] = (numeric).toJson();
618 }
619 if (text != null) {
620 _json["text"] = (text).toJson();
621 }
622 return _json;
623 }
624 }
625
626
627 /** Description of the output values in the data set. */
628 class AnalyzeDataDescriptionOutputFeatureNumeric {
629 /** Number of numeric output values in the data set. */
630 core.String count;
631
632 /** Mean of the output values in the data set. */
633 core.String mean;
634
635 /** Variance of the output values in the data set. */
636 core.String variance;
637
638
639 AnalyzeDataDescriptionOutputFeatureNumeric();
640
641 AnalyzeDataDescriptionOutputFeatureNumeric.fromJson(core.Map _json) {
642 if (_json.containsKey("count")) {
643 count = _json["count"];
644 }
645 if (_json.containsKey("mean")) {
646 mean = _json["mean"];
647 }
648 if (_json.containsKey("variance")) {
649 variance = _json["variance"];
650 }
651 }
652
653 core.Map toJson() {
654 var _json = new core.Map();
655 if (count != null) {
656 _json["count"] = count;
657 }
658 if (mean != null) {
659 _json["mean"] = mean;
660 }
661 if (variance != null) {
662 _json["variance"] = variance;
663 }
664 return _json;
665 }
666 }
667
668
669 /** Not documented yet. */
670 class AnalyzeDataDescriptionOutputFeatureText {
671 /** Number of times the output label occurred in the data set. */
672 core.String count;
673
674 /** The output label. */
675 core.String value;
676
677
678 AnalyzeDataDescriptionOutputFeatureText();
679
680 AnalyzeDataDescriptionOutputFeatureText.fromJson(core.Map _json) {
681 if (_json.containsKey("count")) {
682 count = _json["count"];
683 }
684 if (_json.containsKey("value")) {
685 value = _json["value"];
686 }
687 }
688
689 core.Map toJson() {
690 var _json = new core.Map();
691 if (count != null) {
692 _json["count"] = count;
693 }
694 if (value != null) {
695 _json["value"] = value;
696 }
697 return _json;
698 }
699 }
700
701
702 /** Description of the output value or label. */
703 class AnalyzeDataDescriptionOutputFeature {
704 /** Description of the output values in the data set. */
705 AnalyzeDataDescriptionOutputFeatureNumeric numeric;
706
707 /** Description of the output labels in the data set. */
708 core.List<AnalyzeDataDescriptionOutputFeatureText> text;
709
710
711 AnalyzeDataDescriptionOutputFeature();
712
713 AnalyzeDataDescriptionOutputFeature.fromJson(core.Map _json) {
714 if (_json.containsKey("numeric")) {
715 numeric = new AnalyzeDataDescriptionOutputFeatureNumeric.fromJson(_json["n umeric"]);
716 }
717 if (_json.containsKey("text")) {
718 text = _json["text"].map((value) => new AnalyzeDataDescriptionOutputFeatur eText.fromJson(value)).toList();
719 }
720 }
721
722 core.Map toJson() {
723 var _json = new core.Map();
724 if (numeric != null) {
725 _json["numeric"] = (numeric).toJson();
726 }
727 if (text != null) {
728 _json["text"] = text.map((value) => (value).toJson()).toList();
729 }
730 return _json;
731 }
732 }
733
734
735 /** Description of the data the model was trained on. */
736 class AnalyzeDataDescription {
737 /** Description of the input features in the data set. */
738 core.List<AnalyzeDataDescriptionFeatures> features;
739
740 /** Description of the output value or label. */
741 AnalyzeDataDescriptionOutputFeature outputFeature;
742
743
744 AnalyzeDataDescription();
745
746 AnalyzeDataDescription.fromJson(core.Map _json) {
747 if (_json.containsKey("features")) {
748 features = _json["features"].map((value) => new AnalyzeDataDescriptionFeat ures.fromJson(value)).toList();
749 }
750 if (_json.containsKey("outputFeature")) {
751 outputFeature = new AnalyzeDataDescriptionOutputFeature.fromJson(_json["ou tputFeature"]);
752 }
753 }
754
755 core.Map toJson() {
756 var _json = new core.Map();
757 if (features != null) {
758 _json["features"] = features.map((value) => (value).toJson()).toList();
759 }
760 if (outputFeature != null) {
761 _json["outputFeature"] = (outputFeature).toJson();
762 }
763 return _json;
764 }
765 }
766
767
768 /** Description of the model. */
769 class AnalyzeModelDescription {
770 /**
771 * An output confusion matrix. This shows an estimate for how this model will
772 * do in predictions. This is first indexed by the true class label. For each
773 * true class label, this provides a pair {predicted_label, count}, where
774 * count is the estimated number of times the model will predict the predicted
775 * label given the true label. Will not output if more then 100 classes
776 * (Categorical models only).
777 */
778 core.Map<core.String, core.Map<core.String, core.String>> confusionMatrix;
779
780 /** A list of the confusion matrix row totals. */
781 core.Map<core.String, core.String> confusionMatrixRowTotals;
782
783 /** Basic information about the model. */
784 Insert2 modelinfo;
785
786
787 AnalyzeModelDescription();
788
789 AnalyzeModelDescription.fromJson(core.Map _json) {
790 if (_json.containsKey("confusionMatrix")) {
791 confusionMatrix = _json["confusionMatrix"];
792 }
793 if (_json.containsKey("confusionMatrixRowTotals")) {
794 confusionMatrixRowTotals = _json["confusionMatrixRowTotals"];
795 }
796 if (_json.containsKey("modelinfo")) {
797 modelinfo = new Insert2.fromJson(_json["modelinfo"]);
798 }
799 }
800
801 core.Map toJson() {
802 var _json = new core.Map();
803 if (confusionMatrix != null) {
804 _json["confusionMatrix"] = confusionMatrix;
805 }
806 if (confusionMatrixRowTotals != null) {
807 _json["confusionMatrixRowTotals"] = confusionMatrixRowTotals;
808 }
809 if (modelinfo != null) {
810 _json["modelinfo"] = (modelinfo).toJson();
811 }
812 return _json;
813 }
814 }
815
816
817 /** Not documented yet. */
818 class Analyze {
819 /** Description of the data the model was trained on. */
820 AnalyzeDataDescription dataDescription;
821
822 /** List of errors with the data. */
823 core.List<core.Map<core.String, core.String>> errors;
824
825 /** The unique name for the predictive model. */
826 core.String id;
827
828 /** What kind of resource this is. */
829 core.String kind;
830
831 /** Description of the model. */
832 AnalyzeModelDescription modelDescription;
833
834 /** A URL to re-request this resource. */
835 core.String selfLink;
836
837
838 Analyze();
839
840 Analyze.fromJson(core.Map _json) {
841 if (_json.containsKey("dataDescription")) {
842 dataDescription = new AnalyzeDataDescription.fromJson(_json["dataDescripti on"]);
843 }
844 if (_json.containsKey("errors")) {
845 errors = _json["errors"];
846 }
847 if (_json.containsKey("id")) {
848 id = _json["id"];
849 }
850 if (_json.containsKey("kind")) {
851 kind = _json["kind"];
852 }
853 if (_json.containsKey("modelDescription")) {
854 modelDescription = new AnalyzeModelDescription.fromJson(_json["modelDescri ption"]);
855 }
856 if (_json.containsKey("selfLink")) {
857 selfLink = _json["selfLink"];
858 }
859 }
860
861 core.Map toJson() {
862 var _json = new core.Map();
863 if (dataDescription != null) {
864 _json["dataDescription"] = (dataDescription).toJson();
865 }
866 if (errors != null) {
867 _json["errors"] = errors;
868 }
869 if (id != null) {
870 _json["id"] = id;
871 }
872 if (kind != null) {
873 _json["kind"] = kind;
874 }
875 if (modelDescription != null) {
876 _json["modelDescription"] = (modelDescription).toJson();
877 }
878 if (selfLink != null) {
879 _json["selfLink"] = selfLink;
880 }
881 return _json;
882 }
883 }
884
885
886 /** Input to the model for a prediction. */
887 class InputInput {
888 /**
889 * A list of input features, these can be strings or doubles.
890 *
891 * The values for Object must be JSON objects. It can consist of `num`,
892 * `String`, `bool` and `null` as well as `Map` and `List` values.
893 */
894 core.List<core.Object> csvInstance;
895
896
897 InputInput();
898
899 InputInput.fromJson(core.Map _json) {
900 if (_json.containsKey("csvInstance")) {
901 csvInstance = _json["csvInstance"];
902 }
903 }
904
905 core.Map toJson() {
906 var _json = new core.Map();
907 if (csvInstance != null) {
908 _json["csvInstance"] = csvInstance;
909 }
910 return _json;
911 }
912 }
913
914
915 /** Not documented yet. */
916 class Input {
917 /** Input to the model for a prediction. */
918 InputInput input;
919
920
921 Input();
922
923 Input.fromJson(core.Map _json) {
924 if (_json.containsKey("input")) {
925 input = new InputInput.fromJson(_json["input"]);
926 }
927 }
928
929 core.Map toJson() {
930 var _json = new core.Map();
931 if (input != null) {
932 _json["input"] = (input).toJson();
933 }
934 return _json;
935 }
936 }
937
938
939 /** Not documented yet. */
940 class InsertTrainingInstances {
941 /**
942 * The input features for this instance.
943 *
944 * The values for Object must be JSON objects. It can consist of `num`,
945 * `String`, `bool` and `null` as well as `Map` and `List` values.
946 */
947 core.List<core.Object> csvInstance;
948
949 /** The generic output value - could be regression or class label. */
950 core.String output;
951
952
953 InsertTrainingInstances();
954
955 InsertTrainingInstances.fromJson(core.Map _json) {
956 if (_json.containsKey("csvInstance")) {
957 csvInstance = _json["csvInstance"];
958 }
959 if (_json.containsKey("output")) {
960 output = _json["output"];
961 }
962 }
963
964 core.Map toJson() {
965 var _json = new core.Map();
966 if (csvInstance != null) {
967 _json["csvInstance"] = csvInstance;
968 }
969 if (output != null) {
970 _json["output"] = output;
971 }
972 return _json;
973 }
974 }
975
976
977 /** Not documented yet. */
978 class Insert {
979 /** The unique name for the predictive model. */
980 core.String id;
981
982 /** Type of predictive model (classification or regression). */
983 core.String modelType;
984
985 /** The Id of the model to be copied over. */
986 core.String sourceModel;
987
988 /** Google storage location of the training data file. */
989 core.String storageDataLocation;
990
991 /** Google storage location of the preprocessing pmml file. */
992 core.String storagePMMLLocation;
993
994 /** Google storage location of the pmml model file. */
995 core.String storagePMMLModelLocation;
996
997 /** Instances to train model on. */
998 core.List<InsertTrainingInstances> trainingInstances;
999
1000 /**
1001 * A class weighting function, which allows the importance weights for class
1002 * labels to be specified (Categorical models only).
1003 */
1004 core.List<core.Map<core.String, core.double>> utility;
1005
1006
1007 Insert();
1008
1009 Insert.fromJson(core.Map _json) {
1010 if (_json.containsKey("id")) {
1011 id = _json["id"];
1012 }
1013 if (_json.containsKey("modelType")) {
1014 modelType = _json["modelType"];
1015 }
1016 if (_json.containsKey("sourceModel")) {
1017 sourceModel = _json["sourceModel"];
1018 }
1019 if (_json.containsKey("storageDataLocation")) {
1020 storageDataLocation = _json["storageDataLocation"];
1021 }
1022 if (_json.containsKey("storagePMMLLocation")) {
1023 storagePMMLLocation = _json["storagePMMLLocation"];
1024 }
1025 if (_json.containsKey("storagePMMLModelLocation")) {
1026 storagePMMLModelLocation = _json["storagePMMLModelLocation"];
1027 }
1028 if (_json.containsKey("trainingInstances")) {
1029 trainingInstances = _json["trainingInstances"].map((value) => new InsertTr ainingInstances.fromJson(value)).toList();
1030 }
1031 if (_json.containsKey("utility")) {
1032 utility = _json["utility"];
1033 }
1034 }
1035
1036 core.Map toJson() {
1037 var _json = new core.Map();
1038 if (id != null) {
1039 _json["id"] = id;
1040 }
1041 if (modelType != null) {
1042 _json["modelType"] = modelType;
1043 }
1044 if (sourceModel != null) {
1045 _json["sourceModel"] = sourceModel;
1046 }
1047 if (storageDataLocation != null) {
1048 _json["storageDataLocation"] = storageDataLocation;
1049 }
1050 if (storagePMMLLocation != null) {
1051 _json["storagePMMLLocation"] = storagePMMLLocation;
1052 }
1053 if (storagePMMLModelLocation != null) {
1054 _json["storagePMMLModelLocation"] = storagePMMLModelLocation;
1055 }
1056 if (trainingInstances != null) {
1057 _json["trainingInstances"] = trainingInstances.map((value) => (value).toJs on()).toList();
1058 }
1059 if (utility != null) {
1060 _json["utility"] = utility;
1061 }
1062 return _json;
1063 }
1064 }
1065
1066
1067 /** Model metadata. */
1068 class Insert2ModelInfo {
1069 /**
1070 * Estimated accuracy of model taking utility weights into account
1071 * (Categorical models only).
1072 */
1073 core.String classWeightedAccuracy;
1074
1075 /**
1076 * A number between 0.0 and 1.0, where 1.0 is 100% accurate. This is an
1077 * estimate, based on the amount and quality of the training data, of the
1078 * estimated prediction accuracy. You can use this is a guide to decide
1079 * whether the results are accurate enough for your needs. This estimate will
1080 * be more reliable if your real input data is similar to your training data
1081 * (Categorical models only).
1082 */
1083 core.String classificationAccuracy;
1084
1085 /**
1086 * An estimated mean squared error. The can be used to measure the quality of
1087 * the predicted model (Regression models only).
1088 */
1089 core.String meanSquaredError;
1090
1091 /** Type of predictive model (CLASSIFICATION or REGRESSION). */
1092 core.String modelType;
1093
1094 /** Number of valid data instances used in the trained model. */
1095 core.String numberInstances;
1096
1097 /** Number of class labels in the trained model (Categorical models only). */
1098 core.String numberLabels;
1099
1100
1101 Insert2ModelInfo();
1102
1103 Insert2ModelInfo.fromJson(core.Map _json) {
1104 if (_json.containsKey("classWeightedAccuracy")) {
1105 classWeightedAccuracy = _json["classWeightedAccuracy"];
1106 }
1107 if (_json.containsKey("classificationAccuracy")) {
1108 classificationAccuracy = _json["classificationAccuracy"];
1109 }
1110 if (_json.containsKey("meanSquaredError")) {
1111 meanSquaredError = _json["meanSquaredError"];
1112 }
1113 if (_json.containsKey("modelType")) {
1114 modelType = _json["modelType"];
1115 }
1116 if (_json.containsKey("numberInstances")) {
1117 numberInstances = _json["numberInstances"];
1118 }
1119 if (_json.containsKey("numberLabels")) {
1120 numberLabels = _json["numberLabels"];
1121 }
1122 }
1123
1124 core.Map toJson() {
1125 var _json = new core.Map();
1126 if (classWeightedAccuracy != null) {
1127 _json["classWeightedAccuracy"] = classWeightedAccuracy;
1128 }
1129 if (classificationAccuracy != null) {
1130 _json["classificationAccuracy"] = classificationAccuracy;
1131 }
1132 if (meanSquaredError != null) {
1133 _json["meanSquaredError"] = meanSquaredError;
1134 }
1135 if (modelType != null) {
1136 _json["modelType"] = modelType;
1137 }
1138 if (numberInstances != null) {
1139 _json["numberInstances"] = numberInstances;
1140 }
1141 if (numberLabels != null) {
1142 _json["numberLabels"] = numberLabels;
1143 }
1144 return _json;
1145 }
1146 }
1147
1148
1149 /** Not documented yet. */
1150 class Insert2 {
1151 /** Insert time of the model (as a RFC 3339 timestamp). */
1152 core.DateTime created;
1153
1154 /** The unique name for the predictive model. */
1155 core.String id;
1156
1157 /** What kind of resource this is. */
1158 core.String kind;
1159
1160 /** Model metadata. */
1161 Insert2ModelInfo modelInfo;
1162
1163 /** Type of predictive model (CLASSIFICATION or REGRESSION). */
1164 core.String modelType;
1165
1166 /** A URL to re-request this resource. */
1167 core.String selfLink;
1168
1169 /** Google storage location of the training data file. */
1170 core.String storageDataLocation;
1171
1172 /** Google storage location of the preprocessing pmml file. */
1173 core.String storagePMMLLocation;
1174
1175 /** Google storage location of the pmml model file. */
1176 core.String storagePMMLModelLocation;
1177
1178 /** Training completion time (as a RFC 3339 timestamp). */
1179 core.DateTime trainingComplete;
1180
1181 /**
1182 * The current status of the training job. This can be one of following:
1183 * RUNNING; DONE; ERROR; ERROR: TRAINING JOB NOT FOUND
1184 */
1185 core.String trainingStatus;
1186
1187
1188 Insert2();
1189
1190 Insert2.fromJson(core.Map _json) {
1191 if (_json.containsKey("created")) {
1192 created = core.DateTime.parse(_json["created"]);
1193 }
1194 if (_json.containsKey("id")) {
1195 id = _json["id"];
1196 }
1197 if (_json.containsKey("kind")) {
1198 kind = _json["kind"];
1199 }
1200 if (_json.containsKey("modelInfo")) {
1201 modelInfo = new Insert2ModelInfo.fromJson(_json["modelInfo"]);
1202 }
1203 if (_json.containsKey("modelType")) {
1204 modelType = _json["modelType"];
1205 }
1206 if (_json.containsKey("selfLink")) {
1207 selfLink = _json["selfLink"];
1208 }
1209 if (_json.containsKey("storageDataLocation")) {
1210 storageDataLocation = _json["storageDataLocation"];
1211 }
1212 if (_json.containsKey("storagePMMLLocation")) {
1213 storagePMMLLocation = _json["storagePMMLLocation"];
1214 }
1215 if (_json.containsKey("storagePMMLModelLocation")) {
1216 storagePMMLModelLocation = _json["storagePMMLModelLocation"];
1217 }
1218 if (_json.containsKey("trainingComplete")) {
1219 trainingComplete = core.DateTime.parse(_json["trainingComplete"]);
1220 }
1221 if (_json.containsKey("trainingStatus")) {
1222 trainingStatus = _json["trainingStatus"];
1223 }
1224 }
1225
1226 core.Map toJson() {
1227 var _json = new core.Map();
1228 if (created != null) {
1229 _json["created"] = (created).toIso8601String();
1230 }
1231 if (id != null) {
1232 _json["id"] = id;
1233 }
1234 if (kind != null) {
1235 _json["kind"] = kind;
1236 }
1237 if (modelInfo != null) {
1238 _json["modelInfo"] = (modelInfo).toJson();
1239 }
1240 if (modelType != null) {
1241 _json["modelType"] = modelType;
1242 }
1243 if (selfLink != null) {
1244 _json["selfLink"] = selfLink;
1245 }
1246 if (storageDataLocation != null) {
1247 _json["storageDataLocation"] = storageDataLocation;
1248 }
1249 if (storagePMMLLocation != null) {
1250 _json["storagePMMLLocation"] = storagePMMLLocation;
1251 }
1252 if (storagePMMLModelLocation != null) {
1253 _json["storagePMMLModelLocation"] = storagePMMLModelLocation;
1254 }
1255 if (trainingComplete != null) {
1256 _json["trainingComplete"] = (trainingComplete).toIso8601String();
1257 }
1258 if (trainingStatus != null) {
1259 _json["trainingStatus"] = trainingStatus;
1260 }
1261 return _json;
1262 }
1263 }
1264
1265
1266 /** Not documented yet. */
1267 class List {
1268 /** List of models. */
1269 core.List<Insert2> items;
1270
1271 /** What kind of resource this is. */
1272 core.String kind;
1273
1274 /** Pagination token to fetch the next page, if one exists. */
1275 core.String nextPageToken;
1276
1277 /** A URL to re-request this resource. */
1278 core.String selfLink;
1279
1280
1281 List();
1282
1283 List.fromJson(core.Map _json) {
1284 if (_json.containsKey("items")) {
1285 items = _json["items"].map((value) => new Insert2.fromJson(value)).toList( );
1286 }
1287 if (_json.containsKey("kind")) {
1288 kind = _json["kind"];
1289 }
1290 if (_json.containsKey("nextPageToken")) {
1291 nextPageToken = _json["nextPageToken"];
1292 }
1293 if (_json.containsKey("selfLink")) {
1294 selfLink = _json["selfLink"];
1295 }
1296 }
1297
1298 core.Map toJson() {
1299 var _json = new core.Map();
1300 if (items != null) {
1301 _json["items"] = items.map((value) => (value).toJson()).toList();
1302 }
1303 if (kind != null) {
1304 _json["kind"] = kind;
1305 }
1306 if (nextPageToken != null) {
1307 _json["nextPageToken"] = nextPageToken;
1308 }
1309 if (selfLink != null) {
1310 _json["selfLink"] = selfLink;
1311 }
1312 return _json;
1313 }
1314 }
1315
1316
1317 /** Not documented yet. */
1318 class OutputOutputMulti {
1319 /** The class label. */
1320 core.String label;
1321
1322 /** The probability of the class label. */
1323 core.String score;
1324
1325
1326 OutputOutputMulti();
1327
1328 OutputOutputMulti.fromJson(core.Map _json) {
1329 if (_json.containsKey("label")) {
1330 label = _json["label"];
1331 }
1332 if (_json.containsKey("score")) {
1333 score = _json["score"];
1334 }
1335 }
1336
1337 core.Map toJson() {
1338 var _json = new core.Map();
1339 if (label != null) {
1340 _json["label"] = label;
1341 }
1342 if (score != null) {
1343 _json["score"] = score;
1344 }
1345 return _json;
1346 }
1347 }
1348
1349
1350 /** Not documented yet. */
1351 class Output {
1352 /** The unique name for the predictive model. */
1353 core.String id;
1354
1355 /** What kind of resource this is. */
1356 core.String kind;
1357
1358 /** The most likely class label (Categorical models only). */
1359 core.String outputLabel;
1360
1361 /**
1362 * A list of class labels with their estimated probabilities (Categorical
1363 * models only).
1364 */
1365 core.List<OutputOutputMulti> outputMulti;
1366
1367 /** The estimated regression value (Regression models only). */
1368 core.double outputValue;
1369
1370 /** A URL to re-request this resource. */
1371 core.String selfLink;
1372
1373
1374 Output();
1375
1376 Output.fromJson(core.Map _json) {
1377 if (_json.containsKey("id")) {
1378 id = _json["id"];
1379 }
1380 if (_json.containsKey("kind")) {
1381 kind = _json["kind"];
1382 }
1383 if (_json.containsKey("outputLabel")) {
1384 outputLabel = _json["outputLabel"];
1385 }
1386 if (_json.containsKey("outputMulti")) {
1387 outputMulti = _json["outputMulti"].map((value) => new OutputOutputMulti.fr omJson(value)).toList();
1388 }
1389 if (_json.containsKey("outputValue")) {
1390 outputValue = _json["outputValue"];
1391 }
1392 if (_json.containsKey("selfLink")) {
1393 selfLink = _json["selfLink"];
1394 }
1395 }
1396
1397 core.Map toJson() {
1398 var _json = new core.Map();
1399 if (id != null) {
1400 _json["id"] = id;
1401 }
1402 if (kind != null) {
1403 _json["kind"] = kind;
1404 }
1405 if (outputLabel != null) {
1406 _json["outputLabel"] = outputLabel;
1407 }
1408 if (outputMulti != null) {
1409 _json["outputMulti"] = outputMulti.map((value) => (value).toJson()).toList ();
1410 }
1411 if (outputValue != null) {
1412 _json["outputValue"] = outputValue;
1413 }
1414 if (selfLink != null) {
1415 _json["selfLink"] = selfLink;
1416 }
1417 return _json;
1418 }
1419 }
1420
1421
1422 /** Not documented yet. */
1423 class Update {
1424 /**
1425 * The input features for this instance.
1426 *
1427 * The values for Object must be JSON objects. It can consist of `num`,
1428 * `String`, `bool` and `null` as well as `Map` and `List` values.
1429 */
1430 core.List<core.Object> csvInstance;
1431
1432 /** The generic output value - could be regression or class label. */
1433 core.String output;
1434
1435
1436 Update();
1437
1438 Update.fromJson(core.Map _json) {
1439 if (_json.containsKey("csvInstance")) {
1440 csvInstance = _json["csvInstance"];
1441 }
1442 if (_json.containsKey("output")) {
1443 output = _json["output"];
1444 }
1445 }
1446
1447 core.Map toJson() {
1448 var _json = new core.Map();
1449 if (csvInstance != null) {
1450 _json["csvInstance"] = csvInstance;
1451 }
1452 if (output != null) {
1453 _json["output"] = output;
1454 }
1455 return _json;
1456 }
1457 }
1458
1459
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698