summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHiroyuki Eguchi <h-eguchi@az.jp.nec.com>2017-02-23 17:20:30 +0900
committerHiroyuki Eguchi <h-eguchi@az.jp.nec.com>2017-02-23 17:22:50 +0900
commit856f767a81d440c98b504abb49b44eb7e2fecf7f (patch)
tree775cf28908d4dec16aadc5bb0454fa5fa1f75c35
parent9b9233a693cbff3aad5e4e898224c33152a50c2b (diff)
Support newly added models
Some models and parameters have been added by below bp. Add support models https://blueprints.launchpad.net/meteos/+spec/add-support-models Therefore, meteos-ui should support these models and params. And set a initial value each model parameter. These code are scheduled to be deleted in the future by the below bp. https://blueprints.launchpad.net/meteos/+spec/stored-model-type implements blueprint add-support-models Change-Id: Ia5788b63b76c703c54e3f5b92b81736111cfa065
Notes
Notes (review): Code-Review+2: Hiroyuki Eguchi <h-eguchi@az.jp.nec.com> Workflow+1: Hiroyuki Eguchi <h-eguchi@az.jp.nec.com> Verified+2: Jenkins Submitted-by: Jenkins Submitted-at: Thu, 23 Feb 2017 09:42:10 +0000 Reviewed-on: https://review.openstack.org/437271 Project: openstack/meteos-ui Branch: refs/heads/master
-rw-r--r--meteos_ui/static/dashboard/machine_learning/datasets/create/dataset-model.js6
-rw-r--r--meteos_ui/static/dashboard/machine_learning/learnings/create/learning-model.js2
-rw-r--r--meteos_ui/static/dashboard/machine_learning/model_evaluations/create/model_evaluation-model.js2
-rw-r--r--meteos_ui/static/dashboard/machine_learning/models/create/model-model.js29
-rw-r--r--meteos_ui/static/dashboard/machine_learning/models/create/spec/spec.html22
-rw-r--r--meteos_ui/static/dashboard/machine_learning/models/create/spec/template.spec.controller.js4
-rw-r--r--meteos_ui/static/dashboard/machine_learning/models/details/drawer.html12
-rw-r--r--meteos_ui/static/dashboard/machine_learning/templates/create/template-model.js2
8 files changed, 50 insertions, 29 deletions
diff --git a/meteos_ui/static/dashboard/machine_learning/datasets/create/dataset-model.js b/meteos_ui/static/dashboard/machine_learning/datasets/create/dataset-model.js
index 964c17c..c2299e8 100644
--- a/meteos_ui/static/dashboard/machine_learning/datasets/create/dataset-model.js
+++ b/meteos_ui/static/dashboard/machine_learning/datasets/create/dataset-model.js
@@ -41,8 +41,8 @@
41 source_dataset_url: null, 41 source_dataset_url: null,
42 experiment_id: null, 42 experiment_id: null,
43 params: null, 43 params: null,
44 percent_train: null, 44 percent_train: 0.8,
45 percent_test: null, 45 percent_test: 0.2,
46 swift_tenant: null, 46 swift_tenant: null,
47 swift_username: null, 47 swift_username: null,
48 swift_password: null 48 swift_password: null
@@ -50,7 +50,7 @@
50 50
51 model.newCommonDataset = { 51 model.newCommonDataset = {
52 location: null, 52 location: null,
53 format: null, 53 format: 'csv',
54 dataset_uuid: null, 54 dataset_uuid: null,
55 container_name: null, 55 container_name: null,
56 object_name: null, 56 object_name: null,
diff --git a/meteos_ui/static/dashboard/machine_learning/learnings/create/learning-model.js b/meteos_ui/static/dashboard/machine_learning/learnings/create/learning-model.js
index 7543bca..925482a 100644
--- a/meteos_ui/static/dashboard/machine_learning/learnings/create/learning-model.js
+++ b/meteos_ui/static/dashboard/machine_learning/learnings/create/learning-model.js
@@ -37,7 +37,7 @@
37 display_name: null, 37 display_name: null,
38 display_description: null, 38 display_description: null,
39 model_id: null, 39 model_id: null,
40 method: null, 40 method: 'predict',
41 args: null 41 args: null
42 }; 42 };
43 } 43 }
diff --git a/meteos_ui/static/dashboard/machine_learning/model_evaluations/create/model_evaluation-model.js b/meteos_ui/static/dashboard/machine_learning/model_evaluations/create/model_evaluation-model.js
index d056f32..3bbf9cb 100644
--- a/meteos_ui/static/dashboard/machine_learning/model_evaluations/create/model_evaluation-model.js
+++ b/meteos_ui/static/dashboard/machine_learning/model_evaluations/create/model_evaluation-model.js
@@ -46,7 +46,7 @@
46 46
47 model.newCommonDataset = { 47 model.newCommonDataset = {
48 location: null, 48 location: null,
49 format: null, 49 format: 'csv',
50 dataset_uuid: null, 50 dataset_uuid: null,
51 dataset_format: null, 51 dataset_format: null,
52 container_name: null, 52 container_name: null,
diff --git a/meteos_ui/static/dashboard/machine_learning/models/create/model-model.js b/meteos_ui/static/dashboard/machine_learning/models/create/model-model.js
index fb98e04..0fbda3e 100644
--- a/meteos_ui/static/dashboard/machine_learning/models/create/model-model.js
+++ b/meteos_ui/static/dashboard/machine_learning/models/create/model-model.js
@@ -50,7 +50,7 @@
50 50
51 model.newCommonDataset = { 51 model.newCommonDataset = {
52 location: null, 52 location: null,
53 format: null, 53 format: 'csv',
54 dataset_uuid: null, 54 dataset_uuid: null,
55 dataset_format: null, 55 dataset_format: null,
56 container_name: null, 56 container_name: null,
@@ -61,20 +61,21 @@
61 }; 61 };
62 62
63 model.newParamsSpec = { 63 model.newParamsSpec = {
64 numIterations: null, 64 numIterations: '10',
65 lambda: null, 65 lambda: '1.0',
66 numClasses: null, 66 numClasses: '2',
67 runs: null, 67 runs: '10',
68 mode: null, 68 mode: 'random',
69 rank: null, 69 rank: '10',
70 step: null, 70 step: '0.00000001',
71 impurity: null, 71 impurity: null,
72 maxDepth: null, 72 numTrees: '3',
73 maxBins:null, 73 maxDepth: '5',
74 learningRate: null, 74 maxBins: '32',
75 minCount: null, 75 learningRate: '0.025',
76 minSupport: null, 76 minCount: '5',
77 limits:null 77 minSupport: '0.2',
78 limits: '10'
78 }; 79 };
79 80
80 } 81 }
diff --git a/meteos_ui/static/dashboard/machine_learning/models/create/spec/spec.html b/meteos_ui/static/dashboard/machine_learning/models/create/spec/spec.html
index cd974be..54e31a9 100644
--- a/meteos_ui/static/dashboard/machine_learning/models/create/spec/spec.html
+++ b/meteos_ui/static/dashboard/machine_learning/models/create/spec/spec.html
@@ -21,7 +21,7 @@
21 </label> 21 </label>
22 <input name="model-model-numIterations" type="text" class="form-control" id="model-model-numIterations" 22 <input name="model-model-numIterations" type="text" class="form-control" id="model-model-numIterations"
23 ng-model="model.newParamsSpec.numIterations" 23 ng-model="model.newParamsSpec.numIterations"
24 placeholder="{$ 'Parameters when creating model.'|translate $}"> 24 placeholder="{$ 'Parameters when creating model.'|translate $}">
25 </div> 25 </div>
26 </div> 26 </div>
27 <div class="col-xs-12" 27 <div class="col-xs-12"
@@ -37,7 +37,7 @@
37 </div> 37 </div>
38 </div> 38 </div>
39 <div class="col-xs-12" 39 <div class="col-xs-12"
40 ng-if="model.newModelSpec.model_type == 'KMeans'"> 40 ng-if="model.newModelSpec.model_type == 'KMeans' || model.newModelSpec.model_type.indexOf('Classification') != -1">
41 <div class="form-group"> 41 <div class="form-group">
42 <label class="control-label" for="model-model-numClasses"> 42 <label class="control-label" for="model-model-numClasses">
43 <translate>NumClasses</translate> 43 <translate>NumClasses</translate>
@@ -85,7 +85,7 @@
85 </div> 85 </div>
86 </div> 86 </div>
87 <div class="col-xs-12" 87 <div class="col-xs-12"
88 ng-if="model.newModelSpec.model_type == 'LinearRegression'"> 88 ng-if="model.newModelSpec.model_type == 'LinearRegression' || model.newModelSpec.model_type == 'RidgeRegression'">
89 <div class="form-group"> 89 <div class="form-group">
90 <label class="control-label" for="model-model-step"> 90 <label class="control-label" for="model-model-step">
91 <translate>Step</translate> 91 <translate>Step</translate>
@@ -109,7 +109,19 @@
109 </div> 109 </div>
110 </div> 110 </div>
111 <div class="col-xs-12" 111 <div class="col-xs-12"
112 ng-if="model.newModelSpec.model_type == 'DecisionTreeRegression'"> 112 ng-if="model.newModelSpec.model_type.indexOf('RandomForest') != -1">
113 <div class="form-group">
114 <label class="control-label" for="model-model-numTrees">
115 <translate>NumTrees</translate>
116 <span class="hz-icon-required fa fa-asterisk"></span>
117 </label>
118 <input name="model-model-numTrees" type="text" class="form-control" id="model-model-numTrees"
119 ng-model="model.newParamsSpec.numTrees"
120 placeholder="{$ 'Parameters when creating model.'|translate $}">
121 </div>
122 </div>
123 <div class="col-xs-12"
124 ng-if="model.newModelSpec.model_type.indexOf('Tree') != -1">
113 <div class="form-group"> 125 <div class="form-group">
114 <label class="control-label" for="model-model-maxDepth"> 126 <label class="control-label" for="model-model-maxDepth">
115 <translate>MaxDepth</translate> 127 <translate>MaxDepth</translate>
@@ -121,7 +133,7 @@
121 </div> 133 </div>
122 </div> 134 </div>
123 <div class="col-xs-12" 135 <div class="col-xs-12"
124 ng-if="model.newModelSpec.model_type == 'DecisionTreeRegression'"> 136 ng-if="model.newModelSpec.model_type.indexOf('Tree') != -1">
125 <div class="form-group"> 137 <div class="form-group">
126 <label class="control-label" for="model-model-maxBins"> 138 <label class="control-label" for="model-model-maxBins">
127 <translate>MaxBins</translate> 139 <translate>MaxBins</translate>
diff --git a/meteos_ui/static/dashboard/machine_learning/models/create/spec/template.spec.controller.js b/meteos_ui/static/dashboard/machine_learning/models/create/spec/template.spec.controller.js
index 43583ca..83a5292 100644
--- a/meteos_ui/static/dashboard/machine_learning/models/create/spec/template.spec.controller.js
+++ b/meteos_ui/static/dashboard/machine_learning/models/create/spec/template.spec.controller.js
@@ -38,7 +38,11 @@
38 'LogisticRegression', 38 'LogisticRegression',
39 'NaiveBayes', 39 'NaiveBayes',
40 'DecisionTreeRegression', 40 'DecisionTreeRegression',
41 'DecisionTreeClassification',
42 'RandomForestRegression',
43 'RandomForestClassification',
41 'LinearRegression', 44 'LinearRegression',
45 'RidgeRegression',
42 'KMeans', 46 'KMeans',
43 'Recommendation', 47 'Recommendation',
44 'Word2Vec', 48 'Word2Vec',
diff --git a/meteos_ui/static/dashboard/machine_learning/models/details/drawer.html b/meteos_ui/static/dashboard/machine_learning/models/details/drawer.html
index 4b942b9..40aaeb2 100644
--- a/meteos_ui/static/dashboard/machine_learning/models/details/drawer.html
+++ b/meteos_ui/static/dashboard/machine_learning/models/details/drawer.html
@@ -2,6 +2,14 @@
2 <div class="row"> 2 <div class="row">
3 <span class="rsp-alt-p3"> 3 <span class="rsp-alt-p3">
4 <dl class="col-md-4"> 4 <dl class="col-md-4">
5 <dt translate>Model Params</dt>
6 <dd>{$ item.params $}</dd>
7 </dl>
8 </span>
9 </div>
10 <div class="row">
11 <span class="rsp-alt-p3">
12 <dl class="col-md-4">
5 <dt translate>Result</dt> 13 <dt translate>Result</dt>
6 <dd>{$ item.stdout $}</dd> 14 <dd>{$ item.stdout $}</dd>
7 </dl> 15 </dl>
@@ -9,10 +17,6 @@
9 <dt translate>ID</dt> 17 <dt translate>ID</dt>
10 <dd>{$ item.id $}</dd> 18 <dd>{$ item.id $}</dd>
11 </dl> 19 </dl>
12 <dl class="col-md-4">
13 <dt translate>Model Params</dt>
14 <dd>{$ item.params $}</dd>
15 </dl>
16 </span> 20 </span>
17 </div> 21 </div>
18</div> 22</div>
diff --git a/meteos_ui/static/dashboard/machine_learning/templates/create/template-model.js b/meteos_ui/static/dashboard/machine_learning/templates/create/template-model.js
index 8a0f82c..65fbf59 100644
--- a/meteos_ui/static/dashboard/machine_learning/templates/create/template-model.js
+++ b/meteos_ui/static/dashboard/machine_learning/templates/create/template-model.js
@@ -41,7 +41,7 @@
41 master_flavor_id: null, 41 master_flavor_id: null,
42 worker_nodes_num: null, 42 worker_nodes_num: null,
43 worker_flavor_id: null, 43 worker_flavor_id: null,
44 spark_version: null, 44 spark_version: '1.6.0',
45 floating_ip_pool: null 45 floating_ip_pool: null
46 }; 46 };
47 } 47 }