openml-labs/gama

Bug with LinearSVC training

prabhant opened this issue · 2 comments

This bug makes sense because LinearSVC does not support probabilities by default I think
reference here: https://stackoverflow.com/questions/47312432/attributeerrorlinearsvc-object-has-no-attribute-predict-proba

Traceback (most recent call last):
  File "/home/singhp/metalearning_experiments/gama/gama-warm-pretraining.py", line 35, in <module>
    probability_predictions = automl.predict_proba(X_test)
  File "/home/singhp/metalearning_experiments/gama/gama/GamaClassifier.py", line 94, in predict_proba
    return self._predict_proba(x)
  File "/home/singhp/metalearning_experiments/gama/gama/GamaClassifier.py", line 75, in _predict_proba
    return self.model.predict_proba(x)  # type: ignore
  File "/home/singhp/miniconda3/envs/imbalance/lib/python3.9/site-packages/sklearn/utils/metaestimators.py", line 114, in __get__
    getattr(delegate, self.attribute_name)
AttributeError: 'LinearSVC' object has no attribute 'predict_proba'

Maybe an IF Condition if GAMA outputs linear SVC can be inserted with extra arguments.

LinearSVC should have been excluded from the search space if you optimized towards a metric that requires probabilities. Is it the case that you optimized towards a metric that requires only labels (e.g., accuracy) and then call predict_proba? I guess the desired behavior would be to either fall back on the next-best model which supports probabilities or give a better error (probably the former, with a warning).

Maybe an IF Condition if GAMA outputs linear SVC can be inserted with extra arguments.

I am not sure what you mean with that

Can you confirm this happened when you optimized for a metric which requires predictions rather than probabilities?