Skip to content
This repository was 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" #202

@Sandy4321

Description

@Sandy4321

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'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions