@@ -270,38 +270,27 @@ def get_version(x):
270
270
vars = model .get ('inputVariables' , [])[:]
271
271
vars += model .get ('outputVariables' , [])
272
272
273
- # Project Functions:
274
- # Analytical
275
- # Classification
276
- # Clustering
277
- # Forecasting
278
- # Prediction
279
- # Text Analytics
280
- # Transformation
281
-
282
- # Target Levels:
283
- # Binary
284
- # Nominal
285
- # Ordinal
286
- # Interval
287
-
288
- # project = mr.get_project(model.projectId)
289
- # # Update project properties
290
- # project['function'] = 'prediction'
291
- # project['targetLevel'] = 'interval'
292
- # project['targetVariable'] = 'Price'
293
- # project['predictionVariable'] = 'var1'
294
- # project = mr.update_project(project)
295
-
296
-
297
- if model .get ('function' ) == 'Regression' :
273
+ function = model .get ('function' , '' ).lower ()
274
+ algorithm = model .get ('algorithm' , '' ).lower ()
275
+
276
+ if function == 'classification' and 'logistic' in algorithm :
277
+ target_level = 'Binary'
278
+ elif function == 'prediction' and 'regression' in algorithm :
298
279
target_level = 'Interval'
299
280
else :
300
281
target_level = None
301
282
283
+ if len (model .get ('outputVariables' , [])) == 1 :
284
+ var = model ['outputVariables' ][0 ]
285
+ prediction_variable = var ['name' ]
286
+ else :
287
+ prediction_variable = None
288
+
302
289
project = mr .create_project (project , repo_obj ,
303
290
variables = vars ,
304
- targetLevel = target_level )
291
+ function = model .get ('function' ),
292
+ targetLevel = target_level ,
293
+ predictionVariable = prediction_variable )
305
294
306
295
model = mr .create_model (model , project )
307
296
0 commit comments