Skip to content

Commit 7062cfa

Browse files
authored
Merge pull request #118 from dataiku/fix/clustering-mltask
Fix clustering mltask
2 parents 3e60674 + fa68963 commit 7062cfa

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

dataikuapi/dss/ml.py

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1429,8 +1429,9 @@ class PredictionTypes:
14291429
def __init__(self, client, project_key, analysis_id, mltask_id, mltask_settings):
14301430
DSSMLTaskSettings.__init__(self, client, project_key, analysis_id, mltask_id, mltask_settings)
14311431

1432-
if self.get_prediction_type() not in [self.PredictionTypes.BINARY, self.PredictionTypes.REGRESSION, self.PredictionTypes.MULTICLASS]:
1433-
raise ValueError("Unknown prediction type: {}".format(self.prediction_type))
1432+
prediction_type = self.get_prediction_type()
1433+
if prediction_type not in [self.PredictionTypes.BINARY, self.PredictionTypes.REGRESSION, self.PredictionTypes.MULTICLASS]:
1434+
raise ValueError("Unknown prediction type: {}".format(prediction_type))
14341435

14351436
self.classification_prediction_types = [self.PredictionTypes.BINARY, self.PredictionTypes.MULTICLASS]
14361437

@@ -1632,8 +1633,18 @@ def remove_sample_weighting(self):
16321633
class DSSClusteringMLTaskSettings(DSSMLTaskSettings):
16331634
__doc__ = []
16341635
algorithm_remap = {
1635-
"DBSCAN" : "db_scan_clustering",
1636-
}
1636+
"DBSCAN": "db_scan_clustering",
1637+
"SPECTRAL": "spectral_clustering",
1638+
"WARD": "ward_clustering",
1639+
"KMEANS": "kmeans_clustering",
1640+
"MINIBATCH_KMEANS": "mini_batch_kmeans_clustering",
1641+
"GAUSSIAN_MIXTURE": "gmm_clustering",
1642+
"TWO_STEP": "two_step",
1643+
"ISOLATION_FOREST": "isolation_forest",
1644+
"MLLIB_KMEANS": "mllib_kmeans_clustering",
1645+
"MLLIB_GAUSSIAN_MIXTURE": "mllib_gaussian_mixture_clustering",
1646+
"H20_KMEANS": "h2o_kmeans"
1647+
}
16371648

16381649
def get_algorithm_settings(self, algorithm_name):
16391650
"""

0 commit comments

Comments
 (0)