KeyError: 'predictionType' when calling .get_settings() in BINARY_CLASSIFICATION task

Bruce_li
Level 1
KeyError: 'predictionType' when calling .get_settings() in BINARY_CLASSIFICATION task

Hello,

I try to create 2 classification tasks using 1 dataset with different target column.

Work fine:

```mltask1 = project.create_prediction_ml_task(
input_dataset='Train',
target_variable='Label1',
ml_backend_type='PY_MEMORY', # ML backend to use
guess_policy='DEFAULT', # Template to use for setting default parameters
prediction_type='BINARY_CLASSIFICATION'
)```

Error:

```mltask2 = project.create_prediction_ml_task(
input_dataset='Train',
target_variable='Label2',
ml_backend_type='PY_MEMORY', # ML backend to use
guess_policy='DEFAULT', # Template to use for setting default parameters
prediction_type='BINARY_CLASSIFICATION'
)```

mltask2.wait_guess_complete()

mltask2.get_settings()


Error message:

```

KeyError                                  Traceback (most recent call last)
<ipython-input-37-7dc756ea5f8a> in <cell line: 1>()
----> 1 mltask2.get_settings()

~/Library/DataScienceStudio/kits/dataiku-dss-11.2.0-osx/python/dataikuapi/dss/ml.py in get_settings(self)
   3836 
   3837         if settings["taskType"] == "PREDICTION":
-> 3838             if settings["predictionType"] == DSSTimeseriesForecastingMLTaskSettings.PredictionTypes.TIMESERIES_FORECAST:
   3839                 return DSSTimeseriesForecastingMLTaskSettings(self.client, self.project_key, self.analysis_id, self.mltask_id, settings)
   3840             else:

KeyError: 'predictionType'

Both target column's dtype are int64 

Could someone help me? 

Thank you! 


Operating system used: Mac OS

0 Kudos
1 Reply
JordanB
Dataiker

Hi @Bruce_li,

I was not able to reproduce the error that you are receiving, however, it seems that it may be an issue with the target variable. My suggestion would be to use the Visual ML console to train mltask2 and view the logs to see where it may be failing.

Please let me know if you have questions.

Best,

Jordan

0 Kudos