Skip to content

Commit

Permalink
Merge pull request #16 from MatthewSZhang/doc-readme-example
Browse files Browse the repository at this point in the history
DOC add multioutput example in readme
  • Loading branch information
MatthewSZhang authored Oct 22, 2024
2 parents f09b191 + 50ad1b8 commit 583324b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ Getting Started
... [-2.79, -0.02, -0.85 ],
... [-1.34, -0.48, -2.55 ],
... [ 1.92, 1.48, 0.65 ]]
>>> y = [0, 1, 0, 1]
>>> y = [[0, 0], [1, 1], [0, 0], [1, 0]] # Multioutput feature selection
>>> selector = FastCan(n_features_to_select=2, verbose=0).fit(X, y)
>>> selector.get_support()
array([ True, True, False])
Expand All @@ -70,14 +70,14 @@ array([0, 1])
>>> selector.indices_ # Indices in selection order
array([1, 0], dtype=int32)
>>> selector.scores_ # Scores for selected features in selection order
array([0.64276838, 0.09498243])
array([0.91162413, 0.71089547])
>>> # Here Feature 2 must be included
>>> selector = FastCan(n_features_to_select=2, indices_include=[2], verbose=0).fit(X, y)
>>> # We can find the feature which is useful when working with Feature 2
>>> selector.indices_
array([2, 1], dtype=int32)
array([2, 0], dtype=int32)
>>> selector.scores_
array([0.16632562, 0.50544788])
array([0.34617598, 0.95815008])


Citation
Expand Down

0 comments on commit 583324b

Please sign in to comment.