Skip to content

Commit

Permalink
simplify model string representation (#48)
Browse files Browse the repository at this point in the history
  • Loading branch information
janoPig committed Jan 21, 2024
1 parent a970432 commit fc3a8c6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions HROCH/hroch.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,9 @@ def __eval(self, X: numpy.ndarray, y: numpy.ndarray, metric, c=None, sample_weig
if c is not None:
self.m.coeffs = c
return -metric(self, X, y, sample_weight=sample_weight)

def __str__(self):
return f"RegressorMathModel({self.m.str_representation})"


class ClassifierMathModel(MathModelBase, ClassifierMixin):
Expand Down Expand Up @@ -367,6 +370,9 @@ def predict_proba(self, X: numpy.ndarray, check_input=True):
preds = self._predict(X, check_input=check_input)
proba = numpy.vstack([1 - preds, preds]).T
return proba

def __str__(self):
return f"ClassifierMathModel({self.m.str_representation})"


# void * CreateSolver(solver_params * params)
Expand Down

0 comments on commit fc3a8c6

Please sign in to comment.