@@ -57,10 +57,27 @@ Or via conda-forge:
5757Getting Started
5858---------------
5959>>> from fastcan import FastCan
60- >>> X = [[1 , 0 ], [0 , 1 ]]
61- >>> y = [1 , 0 ]
62- >>> FastCan(verbose = 0 ).fit(X, y).get_support()
63- array([ True, False])
60+ >>> X = [[ 0.87 , - 1.34 , 0.31 ],
61+ ... [- 2.79 , - 0.02 , - 0.85 ],
62+ ... [- 1.34 , - 0.48 , - 2.55 ],
63+ ... [ 1.92 , 1.48 , 0.65 ]]
64+ >>> y = [0 , 1 , 0 , 1 ]
65+ >>> selector = FastCan(n_features_to_select = 2 , verbose = 0 ).fit(X, y)
66+ >>> selector.get_support()
67+ array([ True, True, False])
68+ >>> selector.get_support(indices = True ) # Sorted indices
69+ array([0, 1])
70+ >>> selector.indices_ # Indices in selection order
71+ array([1, 0], dtype=int32)
72+ >>> selector.scores_ # Scores for selected features in selection order
73+ array([0.64276838, 0.09498243])
74+ >>> # Here Feature 2 must be included
75+ >>> selector = FastCan(n_features_to_select = 2 , indices_include = [2 ], verbose = 0 ).fit(X, y)
76+ >>> # We can find the feature which is useful when working with Feature 2
77+ >>> selector.indices_
78+ array([2, 1], dtype=int32)
79+ >>> selector.scores_
80+ array([0.16632562, 0.50544788])
6481
6582
6683Citation
0 commit comments