You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 6, 2023. It is now read-only.
CDClassifier : error for penalty="l1" and penalty="l2", but no error for penalty="l1/l2"
from lightning.classification import CDClassifier #Estimator for learning linear classifiers by (block) coordinate descent
clf = CDClassifier(loss="squared_hinge",
penalty="l2",
#penalty="l1/l2", #
multiclass=False,
max_iter=20,
alpha=1e-4,
C=1.0 / X_train_vectorised.shape[0],
tol=1e-3,
n_jobs =5)
#
clf.fit(X_train_vectorised, y_train)
clf.fit(X_train_vectorised, y_train)
File "c:\my_py_environments\py310_env_apr2023\lib\site-packages\lightning\impl\primal_cd.py", line 258, in fit
y, n_classes, n_vectors = self._set_label_transformers(y,
File "c:\my_py_environments\py310_env_apr2023\lib\site-packages\lightning\impl\base.py", line 78, in _set_label_transformers
y = y.astype(np.int32)
builtins.AttributeError: 'list' object has no attribute 'astype'
The text was updated successfully, but these errors were encountered:
X_train_vectorised
<1177x4883 sparse matrix of type '<class 'numpy.float64'>'
with 87732 stored elements in Compressed Sparse Row format>
y_train
['0\n', '1\n', '0\n', '1\n', '1\n']
same error for reformating y_train = [int(x) for x in y_train]
CDClassifier : error for penalty="l1" and penalty="l2", but no error for penalty="l1/l2"
from lightning.classification import CDClassifier #Estimator for learning linear classifiers by (block) coordinate descent
clf = CDClassifier(loss="squared_hinge",
penalty="l2",
#penalty="l1/l2", #
multiclass=False,
max_iter=20,
alpha=1e-4,
C=1.0 / X_train_vectorised.shape[0],
tol=1e-3,
n_jobs =5)
#
clf.fit(X_train_vectorised, y_train)
clf.fit(X_train_vectorised, y_train)
File "c:\my_py_environments\py310_env_apr2023\lib\site-packages\lightning\impl\primal_cd.py", line 258, in fit
y, n_classes, n_vectors = self._set_label_transformers(y,
File "c:\my_py_environments\py310_env_apr2023\lib\site-packages\lightning\impl\base.py", line 78, in _set_label_transformers
y = y.astype(np.int32)
builtins.AttributeError: 'list' object has no attribute 'astype'
The text was updated successfully, but these errors were encountered: