Skip to content

Commit

Permalink
FEA add indices_ to reflect the selection order
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthewSZhang committed Jul 9, 2024
1 parent a714c9e commit 86923f0
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 52 deletions.
8 changes: 7 additions & 1 deletion fastcan/_fastcan.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,16 @@ class FastCan(SelectorMixin, BaseEstimator):
Names of features seen during :term:`fit`. Defined only when `X`
has feature names that are all strings.
indices_ : ndarray of shape (n_features_to_select,), dtype=float
The indices of the selected features. The order of the indices
is corresponding to the feature selection process.
support_ : ndarray of shape (n_features,), dtype=bool
The mask of selected features.
scores_: ndarray of shape (n_features_to_select,), dtype=float
The h-correlation/eta-cosine of selected features.
The h-correlation/eta-cosine of selected features. The order of
the scores is corresponding to the feature selection process.
References
----------
Expand Down Expand Up @@ -212,6 +217,7 @@ def fit(self, X, y):
print()
support = np.zeros(shape=self.n_features_in_, dtype=bool)
support[indices] = True
self.indices_ = indices
self.support_ = support
self.scores_ = scores
return self
Expand Down
100 changes: 50 additions & 50 deletions pixi.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "fastcan"
version = "0.1.24"
version = "0.1.25"
description = "A fast canonical-correlation-based feature selection method"
authors = [
{ name = "Matthew Sikai Zhang", email = "[email protected]" },
Expand Down

0 comments on commit 86923f0

Please sign in to comment.