When fitting a data set with only one label (all entries in y are equal), the following error is raised:
UnboundLocalError: local variable 'objective' referenced before assignment
backtrace:
Training 1-slack dual structural SVM
iteration 0
no additional constraints
---------------------------------------------------------------------------
UnboundLocalError Traceback (most recent call last)
[..]
/usr/local/lib/python2.7/dist-packages/pystruct/learners/one_slack_ssvm.pyc in fit(self, X, Y, constraints, warm_start, initialize)
520 primal_objective = self._objective(X, Y)
521 self.primal_objective_curve_.append(primal_objective)
--> 522 self.objective_curve_.append(objective)
523 self.cached_constraint_.append(False)
524
It is reasonable that the model cannot be fit to this kind of labeled data but this situation should be caught and a more meaningful error should be raised.
When fitting a data set with only one label (all entries in y are equal), the following error is raised:
UnboundLocalError: local variable 'objective' referenced before assignment
backtrace:
It is reasonable that the model cannot be fit to this kind of labeled data but this situation should be caught and a more meaningful error should be raised.