Skip to content

Feature solver - #26

Open
rbaral wants to merge 2 commits into
masterfrom
feature_solver
Open

Feature solver#26
rbaral wants to merge 2 commits into
masterfrom
feature_solver

Conversation

@rbaral

@rbaral rbaral commented Sep 4, 2026

Copy link
Copy Markdown

Context:
This PR provides the solution to the issue Linear Selection Method fails with Python 3.12 (#24). The issue is about the Linear selection failing because the scikit-learn does not support multi_class attribute for LogisticRegression

Traceback (most recent call last):
  File "/home/rbaral/Documents/projects/selective/sample.py", line 13, in <module>
    selector = Selective(SelectionMethod.Linear(num_features=3, regularization="none"))
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/rbaral/Documents/projects/selective/feature/selector.py", line 532, in __init__
    self._imp = _Linear(self.seed, self.selection_method.num_features,
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/rbaral/Documents/projects/selective/feature/linear.py", line 32, in __init__
    "classification_none": LogisticRegression(random_state=self.seed,
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: LogisticRegression.__init__() got an unexpected keyword argument 'multi_class'

See more context and replication steps at #24

Fix:

  1. In feature/linear.py, inside __init__() method, use the OneVsRestClassifier to wrap the LogisticRegression and remove the multi_class attribute.
  2. In text_based.py, update the way the Label matrix is defined inside process_category_data() method

@takojunior @kuppulur @skadio @wddcheng Can you please help with the PR review?

@rbaral
rbaral requested a review from skadio as a code owner September 4, 2026 04:33
@wddcheng

wddcheng commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

LGTM!

@skadio skadio left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checking if this approval works/possible.

@skadio

skadio commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

(let me know if you need help in updating pypi)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants