Browse Source

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
changes/71/437271/2
Hiroyuki Eguchi 2 years ago
parent
commit
856f767a81

+ 3
- 3
meteos_ui/static/dashboard/machine_learning/datasets/create/dataset-model.js View File

@@ -41,8 +41,8 @@
41 41
         source_dataset_url: null,
42 42
         experiment_id: null,
43 43
         params: null,
44
-        percent_train: null,
45
-        percent_test: null,
44
+        percent_train: 0.8,
45
+        percent_test: 0.2,
46 46
         swift_tenant: null,
47 47
         swift_username: null,
48 48
         swift_password: null
@@ -50,7 +50,7 @@
50 50
 
51 51
       model.newCommonDataset = {
52 52
         location: null,
53
-        format: null,
53
+        format: 'csv',
54 54
         dataset_uuid: null,
55 55
         container_name: null,
56 56
         object_name: null,

+ 1
- 1
meteos_ui/static/dashboard/machine_learning/learnings/create/learning-model.js View File

@@ -37,7 +37,7 @@
37 37
         display_name: null,
38 38
         display_description: null,
39 39
         model_id: null,
40
-        method: null,
40
+        method: 'predict',
41 41
         args: null
42 42
       };
43 43
     }

+ 1
- 1
meteos_ui/static/dashboard/machine_learning/model_evaluations/create/model_evaluation-model.js View File

@@ -46,7 +46,7 @@
46 46
 
47 47
       model.newCommonDataset = {
48 48
         location: null,
49
-        format: null,
49
+        format: 'csv',
50 50
         dataset_uuid: null,
51 51
         dataset_format: null,
52 52
         container_name: null,

+ 15
- 14
meteos_ui/static/dashboard/machine_learning/models/create/model-model.js View File

@@ -50,7 +50,7 @@
50 50
 
51 51
       model.newCommonDataset = {
52 52
         location: null,
53
-        format: null,
53
+        format: 'csv',
54 54
         dataset_uuid: null,
55 55
         dataset_format: null,
56 56
         container_name: null,
@@ -61,20 +61,21 @@
61 61
       };
62 62
 
63 63
       model.newParamsSpec = {
64
-        numIterations: null,
65
-        lambda: null,
66
-        numClasses: null,
67
-        runs: null,
68
-        mode: null,
69
-        rank: null,
70
-        step: null,
64
+        numIterations: '10',
65
+        lambda: '1.0',
66
+        numClasses: '2',
67
+        runs: '10',
68
+        mode: 'random',
69
+        rank: '10',
70
+        step: '0.00000001',
71 71
         impurity: null,
72
-        maxDepth: null,
73
-        maxBins:null,
74
-        learningRate: null,
75
-        minCount: null,
76
-        minSupport: null,
77
-        limits:null
72
+        numTrees: '3',
73
+        maxDepth: '5',
74
+        maxBins: '32',
75
+        learningRate: '0.025',
76
+        minCount: '5',
77
+        minSupport: '0.2',
78
+        limits: '10'
78 79
       };
79 80
 
80 81
     }

+ 17
- 5
meteos_ui/static/dashboard/machine_learning/models/create/spec/spec.html View File

@@ -21,7 +21,7 @@
21 21
         </label>
22 22
         <input name="model-model-numIterations" type="text" class="form-control" id="model-model-numIterations"
23 23
                ng-model="model.newParamsSpec.numIterations"
24
-                placeholder="{$ 'Parameters when creating model.'|translate $}">
24
+               placeholder="{$ 'Parameters when creating model.'|translate $}">
25 25
       </div>
26 26
     </div>
27 27
     <div class="col-xs-12"
@@ -37,7 +37,7 @@
37 37
       </div>
38 38
     </div>
39 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 41
       <div class="form-group">
42 42
         <label class="control-label" for="model-model-numClasses">
43 43
           <translate>NumClasses</translate>
@@ -85,7 +85,7 @@
85 85
       </div>
86 86
     </div>
87 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 89
       <div class="form-group">
90 90
         <label class="control-label" for="model-model-step">
91 91
           <translate>Step</translate>
@@ -109,7 +109,19 @@
109 109
       </div>
110 110
     </div>
111 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 125
       <div class="form-group">
114 126
         <label class="control-label" for="model-model-maxDepth">
115 127
           <translate>MaxDepth</translate>
@@ -121,7 +133,7 @@
121 133
       </div>
122 134
     </div>
123 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 137
       <div class="form-group">
126 138
         <label class="control-label" for="model-model-maxBins">
127 139
           <translate>MaxBins</translate>

+ 4
- 0
meteos_ui/static/dashboard/machine_learning/models/create/spec/template.spec.controller.js View File

@@ -38,7 +38,11 @@
38 38
       'LogisticRegression',
39 39
       'NaiveBayes',
40 40
       'DecisionTreeRegression',
41
+      'DecisionTreeClassification',
42
+      'RandomForestRegression',
43
+      'RandomForestClassification',
41 44
       'LinearRegression',
45
+      'RidgeRegression',
42 46
       'KMeans',
43 47
       'Recommendation',
44 48
       'Word2Vec',

+ 8
- 4
meteos_ui/static/dashboard/machine_learning/models/details/drawer.html View File

@@ -1,4 +1,12 @@
1 1
 <div ng-controller="horizon.dashboard.machine_learning.models.DrawerController as drawerCtrl">
2
+  <div class="row">
3
+    <span class="rsp-alt-p3">
4
+      <dl class="col-md-4">
5
+        <dt translate>Model Params</dt>
6
+        <dd>{$ item.params $}</dd>
7
+      </dl>
8
+    </span>
9
+  </div>
2 10
   <div class="row">
3 11
     <span class="rsp-alt-p3">
4 12
       <dl class="col-md-4">
@@ -9,10 +17,6 @@
9 17
         <dt translate>ID</dt>
10 18
         <dd>{$ item.id $}</dd>
11 19
       </dl>
12
-      <dl class="col-md-4">
13
-        <dt translate>Model Params</dt>
14
-        <dd>{$ item.params $}</dd>
15
-      </dl>
16 20
     </span>
17 21
   </div>
18 22
 </div>

+ 1
- 1
meteos_ui/static/dashboard/machine_learning/templates/create/template-model.js View File

@@ -41,7 +41,7 @@
41 41
         master_flavor_id: null,
42 42
         worker_nodes_num: null,
43 43
         worker_flavor_id: null,
44
-        spark_version: null,
44
+        spark_version: '1.6.0',
45 45
         floating_ip_pool: null
46 46
       };
47 47
     }

Loading…
Cancel
Save