class_docstr: Select features according to the k highest scores.
  
  Read more in the :ref:`User Guide <univariate_feature_selection>`.
  
  Parameters
  ----------
  score_func : callable
      Function taking two arrays X and y, and returning a pair of arrays
      (scores, pvalues) or a single array with scores.
      Default is f_classif (see below "See also"). The default function only
      works with classification tasks.
  
  k : int or "all", optional, default=10
      Number of top features to select.
      The "all" option bypasses selection, for use in a parameter search.
  
  Attributes
  ----------
  scores_ : array-like, shape=(n_features,)
      Scores of features.
  
  pvalues_ : array-like, shape=(n_features,)
      p-values of feature scores, None if `score_func` returned only scores.
  
  Notes
  -----
  Ties between features with equal scores will be broken in an unspecified
  way.
  
  See also
  --------
  f_classif: ANOVA F-value between label/feature for classification tasks.
  mutual_info_classif: Mutual information for a discrete target.
  chi2: Chi-squared stats of non-negative features for classification tasks.
  f_regression: F-value between label/feature for regression tasks.
  mutual_info_regression: Mutual information for a continious target.
  SelectPercentile: Select features based on percentile of the highest scores.
  SelectFpr: Select features based on a false positive rate test.
  SelectFdr: Select features based on an estimated false discovery rate.
  SelectFwe: Select features based on family-wise error rate.
  GenericUnivariateSelect: Univariate feature selector with configurable mode.
class_docstr_tok: ["Select","features","according","to","the","k","highest","scores",".","Read","more","in","the",":","ref",":","`","User","Guide","<","univariate_feature_selection",">","`",".","Parameters","--","--","--","--","--","score_func",":","callable","Function","taking","two","arrays","X","and","y",",","and","returning","a","pair","of","arrays","(","scores",",","pvalues",")","or","a","single","array","with","scores",".","Default","is","f_classif","(","see","below","``","See","also","''",")",".","The","default","function","only","works","with","classification","tasks",".","k",":","int","or","``","all","''",",","optional",",","default=10","Number","of","top","features","to","select",".","The","``","all","''","option","bypasses","selection",",","for","use","in","a","parameter","search",".","Attributes","--","--","--","--","--","scores_",":","array-like",",","shape=","(","n_features",",",")","Scores","of","features",".","pvalues_",":","array-like",",","shape=","(","n_features",",",")","p-values","of","feature","scores",",","None","if","`","score_func","`","returned","only","scores",".","Notes","--","--","-","Ties","between","features","with","equal","scores","will","be","broken","in","an","unspecified","way",".","See","also","--","--","--","--","f_classif",":","ANOVA","F-value","between","label\/feature","for","classification","tasks",".","mutual_info_classif",":","Mutual","information","for","a","discrete","target",".","chi2",":","Chi-squared","stats","of","non-negative","features","for","classification","tasks",".","f_regression",":","F-value","between","label\/feature","for","regression","tasks",".","mutual_info_regression",":","Mutual","information","for","a","continious","target",".","SelectPercentile",":","Select","features","based","on","percentile","of","the","highest","scores",".","SelectFpr",":","Select","features","based","on","a","false","positive","rate","test",".","SelectFdr",":","Select","features","based","on","an","estimated","false","discovery","rate",".","SelectFwe",":","Select","features","based","on","family-wise","error","rate",".","GenericUnivariateSelect",":","Univariate","feature","selector","with","configurable","mode","."]
code: def _get_support_mask(self):
      check_is_fitted(self, "scores_")
  
      if self.k == "all":
          return np.ones(self.scores_.shape, dtype=bool)
      elif self.k == 0:
          return np.zeros(self.scores_.shape, dtype=bool)
      else:
          scores = _clean_nans(self.scores_)
          mask = np.zeros(scores.shape, dtype=bool)
  
          # Request a stable sort. Mergesort takes more memory (~40MB per
          # megafeature on x86-64).
          mask[np.argsort(scores, kind="mergesort")[-self.k :]] = 1
          return mask
  
imports: import numpy
  import warnings
  from scipy import special, stats
  from scipy.sparse import issparse
  from ..base import BaseEstimator
  from ..preprocessing import LabelBinarizer
  from ..utils import as_float_array, check_array, check_X_y, safe_sqr, safe_mask
  from ..utils.extmath import norm, safe_sparse_dot, row_norms
  from ..utils.validation import check_is_fitted
  from .base import SelectorMixin
label_desc: Use image node_id 3 for calling the SelectKBest obj's underlying member method code with example usage: obj._get_support_mask() and returns: np, np, mask