Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add logger support #116

Merged
merged 18 commits into from
Jun 17, 2019
Merged
Prev Previous commit
Next Next commit
remove label encode/decode
ajtritt committed Jun 17, 2019
commit 9d08a9cc0471f55bd4533c928a8a09eab9581635
10 changes: 0 additions & 10 deletions pyuoi/linear_model/logistic.py
Original file line number Diff line number Diff line change
@@ -202,16 +202,6 @@ def _pre_fit(self, X, y):
self.output_dim = 1
return X, y

def fit(self, X, y, verbose=False):
self._enc = LabelEncoder().fit(y)
self.classes_ = self._enc.classes_
return super(UoI_L1Logistic, self).fit(X, self._enc.transform(y), verbose=verbose)

def predict(self, X):
if self._enc is None:
raise ValueError("fit must be called before predict")
return self._enc.inverse_transform(super(UoI_L1Logistic, self).predict(X))


def fit_intercept_fixed_coef(X, coef_, y, output_dim):
"""Optimize the likelihood w.r.t. the intercept for a logistic