icol 0.9.5__tar.gz → 0.9.6__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {icol-0.9.5 → icol-0.9.6}/PKG-INFO +1 -1
- {icol-0.9.5 → icol-0.9.6}/icol/logistic_icol.py +7 -7
- {icol-0.9.5 → icol-0.9.6}/icol.egg-info/PKG-INFO +1 -1
- {icol-0.9.5 → icol-0.9.6}/pyproject.toml +1 -1
- {icol-0.9.5 → icol-0.9.6}/LICENSE +0 -0
- {icol-0.9.5 → icol-0.9.6}/README.md +0 -0
- {icol-0.9.5 → icol-0.9.6}/icol/__init__.py +0 -0
- {icol-0.9.5 → icol-0.9.6}/icol/feature_expansion.py +0 -0
- {icol-0.9.5 → icol-0.9.6}/icol/icol.py +0 -0
- {icol-0.9.5 → icol-0.9.6}/icol.egg-info/SOURCES.txt +0 -0
- {icol-0.9.5 → icol-0.9.6}/icol.egg-info/dependency_links.txt +0 -0
- {icol-0.9.5 → icol-0.9.6}/icol.egg-info/requires.txt +0 -0
- {icol-0.9.5 → icol-0.9.6}/icol.egg-info/top_level.txt +0 -0
- {icol-0.9.5 → icol-0.9.6}/setup.cfg +0 -0
- {icol-0.9.5 → icol-0.9.6}/tests/test_icl.py +0 -0
|
@@ -123,10 +123,9 @@ class LOGISTIC_LASSO:
|
|
|
123
123
|
'clp': self.clp
|
|
124
124
|
}
|
|
125
125
|
|
|
126
|
-
def __repr__(self):
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
return f"LogisticLasso({params_str})"
|
|
126
|
+
def __repr__(self, prec=3):
|
|
127
|
+
coef = self.model.coef_.ravel()
|
|
128
|
+
return ''.join([('+' if c > 0 else '') + sci(c, sig=prec) + '(' + self.feature_names[i] + ')' for i, c in enumerate(coef) if (np.abs(coef[i]) > self.eps_nnz)])
|
|
130
129
|
|
|
131
130
|
def fit(self, X, y, d, feature_names=None, verbose=False):
|
|
132
131
|
self.feature_names = ['X_{0}'.format(i) for i in range(X.shape[1])] if feature_names is None else feature_names
|
|
@@ -152,9 +151,10 @@ class LOGISTIC_LASSO:
|
|
|
152
151
|
np.abs(np.ravel(coef)) > self.eps_nnz
|
|
153
152
|
))
|
|
154
153
|
|
|
155
|
-
def __str__(self
|
|
156
|
-
|
|
157
|
-
|
|
154
|
+
def __str__(self):
|
|
155
|
+
params = self.get_params()
|
|
156
|
+
params_str = ", ".join(f"{k}={params[k]!r}" for k in sorted(params))
|
|
157
|
+
return f"LogisticLasso({params_str})"
|
|
158
158
|
|
|
159
159
|
def decision_function(self, X):
|
|
160
160
|
return np.dot(X, self.model.coef_.ravel())
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|