We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 49d15fd commit cd87725Copy full SHA for cd87725
dataikuapi/dss/ml.py
@@ -437,9 +437,11 @@ def use_sample_weighting(self, feature_name):
437
Uses a feature as sample weight
438
:param str feature_name: Name of the feature to use
439
"""
440
- self.remove_sample_weighting()
441
if not feature_name in self.mltask_settings["preprocessing"]["per_feature"]:
442
raise ValueError("Feature %s doesn't exist in this ML task, can't use as weight" % feature_name)
+
443
+ self.remove_sample_weighting()
444
445
self.mltask_settings['weight']['weightMethod'] = 'SAMPLE_WEIGHT'
446
self.mltask_settings['weight']['sampleWeightVariable'] = feature_name
447
self.mltask_settings['preprocessing']['per_feature'][feature_name]['role'] = 'WEIGHT'
0 commit comments