Module Import alias identifier Import alias identifier Import alias Import alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ClassDef bases NameLoad NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam defaults NameLoad NameLoad NameLoad Str Num NameLoad Num Str body Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr Call NameLoad NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr DictComp NameLoad NameLoad comprehension TupleStore NameStore NameStore Call NameLoad ListLoad AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Assign AttributeStore NameLoad attr Call NameLoad AttributeLoad NameLoad attr If CompareLt SubscriptLoad AttributeLoad NameLoad attr Index Num AttributeLoad NameLoad attr body Raise Call NameLoad Str If AttributeLoad NameLoad attr body Assign NameStore Call NameLoad keyword Num orelse Assign NameStore Call NameLoad keyword Num Assign AttributeStore NameLoad attr Dict Assign NameStore Call NameLoad Call NameLoad SubscriptLoad AttributeLoad NameLoad attr Index Num If AttributeLoad NameLoad attr body Assign NameStore TupleLoad Assign NameStore Num orelse Assign NameStore Call NameLoad Call NameLoad SubscriptLoad AttributeLoad NameLoad attr Index Num Assign NameStore Call NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad Assign SubscriptStore AttributeLoad NameLoad attr Index NameLoad Dict Str Str Str NameLoad NameLoad Call AttributeLoad NameLoad attr While CompareNotEq NameLoad AttributeLoad NameLoad attr body Assign NameStore Call NameLoad NameLoad If AttributeLoad NameLoad attr body Assign TupleStore NameStore NameStore NameStore Call AttributeLoad NameLoad attr keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad orelse Assign TupleStore NameStore NameStore NameStore Call AttributeLoad NameLoad attr keyword NameLoad keyword NameLoad keyword NameLoad If BoolOpAnd AttributeLoad NameLoad attr UnaryOpNot Call AttributeLoad NameLoad attr NameLoad body Assign TupleStore NameStore BinOpBitXor Call NameLoad NameLoad NameLoad If AttributeLoad NameLoad attr body Assign TupleStore NameStore NameStore NameStore Call AttributeLoad NameLoad attr keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad orelse Assign TupleStore NameStore NameStore NameStore Call AttributeLoad NameLoad attr keyword BinOpSub NameLoad Set NameLoad keyword Call NameLoad NameLoad keyword NameLoad keyword NameLoad If BoolOpAnd NameLoad CompareGt NameLoad NameLoad body Assign TupleStore NameStore NameStore NameStore TupleLoad NameLoad NameLoad NameLoad Assign NameStore Call NameLoad NameLoad If BoolOpOr CompareNotIn NameLoad AttributeLoad NameLoad attr CompareGt SubscriptLoad SubscriptLoad AttributeLoad NameLoad attr Index NameLoad Index Str NameLoad body Assign SubscriptStore AttributeLoad NameLoad attr Index NameLoad Dict Str Str Str NameLoad NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad If AttributeLoad NameLoad attr body Expr Call AttributeLoad AttributeLoad NameLoad attr attr BinOpMod Str TupleLoad Call NameLoad NameLoad AttributeLoad NameLoad attr Expr Call AttributeLoad AttributeLoad NameLoad attr attr Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr Call NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign NameStore NameLoad If BoolOpAnd CompareEq Call NameLoad NameLoad Num BoolOpOr CompareEq SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index Num CompareEq SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index Num body Assign NameStore NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body If AttributeLoad NameLoad attr body Assign NameStore Call NameLoad AttributeLoad NameLoad attr SubscriptLoad NameLoad ExtSlice Slice Index NameLoad NameLoad keyword AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr orelse Expr Call AttributeLoad AttributeLoad NameLoad attr attr SubscriptLoad NameLoad ExtSlice Slice Index NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr ListLoad Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr SubscriptLoad NameLoad ExtSlice Slice Index NameLoad NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults body Assign NameStore ListLoad Assign NameStore ListLoad Assign NameStore ListLoad Assign NameStore TupleLoad NameLoad NameLoad NameLoad Assign NameStore BinOpSub NameLoad NameLoad If NameLoad body For NameStore NameLoad body Assign NameStore Call NameLoad BinOpBitOr NameLoad Set NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore TupleLoad SubscriptLoad NameLoad Index NameLoad SubscriptLoad NameLoad Index NameLoad SubscriptLoad NameLoad Index NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults NameLoad body Assign NameStore Call NameLoad NameLoad Assign NameStore TupleLoad NameLoad NameLoad NameLoad If CompareGt NameLoad Num body Assign NameStore ListLoad Assign NameStore ListLoad Assign NameStore ListLoad For NameStore Call NameLoad NameLoad keyword BinOpSub NameLoad Num body If BoolOpAnd NameLoad CompareNotIn NameLoad Call NameLoad NameLoad body Continue Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore TupleLoad SubscriptLoad NameLoad Index NameLoad SubscriptLoad NameLoad Index NameLoad SubscriptLoad NameLoad Index NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Return SubscriptLoad NameLoad ExtSlice Slice Index AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Return Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults Num body Assign NameStore Call NameLoad AttributeLoad NameLoad attr For NameStore NameLoad body Assign NameStore Call AttributeLoad NameLoad attr SubscriptLoad SubscriptLoad AttributeLoad NameLoad attr Index NameLoad Index Str Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr SubscriptLoad SubscriptLoad AttributeLoad NameLoad attr Index NameLoad Index Str keyword NameLoad Assign SubscriptStore SubscriptLoad NameLoad Index NameLoad Index Str NameLoad Assign SubscriptStore SubscriptLoad NameLoad Index NameLoad Index Str NameLoad Assign SubscriptStore SubscriptLoad NameLoad Index NameLoad Index Str NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults Num body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign NameStore BinOpMult NameLoad Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr BinOpDiv BinOpAdd Num NameLoad Num Call NameLoad NameLoad Return TupleLoad NameLoad NameLoad decorator_list decorator_list
N/A N/A numpy np N/A scipy sp N/A scipy.stats N/A sys copy deepcopy itertools combinations collections deque sklearn.metrics get_scorer sklearn.base clone sklearn.base BaseEstimator sklearn.base MetaEstimatorMixin sklearn.cross_validation cross_val_score externals.name_estimators _name_estimators SequentialFeatureSelector N/A BaseEstimator MetaEstimatorMixin N/A N/A Sequential Feature Selection for Classification and Regression.

    Parameters
    ----------
    estimator : scikit-learn classifier or regressor
    k_features : int
        Number of features to select,
        where k_features < the full feature set.
    forward : bool (default: True)
        Forward selection if True,
        backward selection otherwise
    floating : bool (default: False)
        Adds a conditional exclusion/inclusion if True.
    print_progress : bool (default: True)
        Prints progress as the number of epochs
        to stderr.
    scoring : str, (default='accuracy')
        Scoring metric in {accuracy, f1, precision, recall, roc_auc}
        for classifiers,
        {'mean_absolute_error', 'mean_squared_error',
        'median_absolute_error', 'r2'} for regressors,
        or a callable object or function with
        signature ``scorer(estimator, X, y)``.
    cv : int (default: 5)
        Scikit-learn cross-validation generator or `int`.
        If estimator is a classifier (or y consists of integer class labels),
        stratified k-fold is performed, and regular k-fold cross-validation
        otherwise.
        No cross-validation if cv is None, False, or 0.
    skip_if_stuck: bool (default: True)
        Set to True to skip conditional
        exlusion/inclusion if floating=True and
        algorithm gets stuck in cycles.
    n_jobs : int (default: 1)
        The number of CPUs to use for cross validation. -1 means 'all CPUs'.
    pre_dispatch : int, or string
        Controls the number of jobs that get dispatched
        during parallel execution in cross_val_score.
        Reducing this number can be useful to avoid an explosion of
        memory consumption when more jobs get dispatched than CPUs can process.
        This parameter can be:
        None, in which case all the jobs are immediately created and spawned.
            Use this for lightweight and fast-running jobs,
            to avoid delays due to on-demand spawning of the jobs
        An int, giving the exact number of total jobs that are spawned
        A string, giving an expression as a function
            of n_jobs, as in `2*n_jobs`

    Attributes
    ----------
    k_feature_idx_ : array-like, shape = [n_predictions]
        Feature Indices of the selected feature subsets.
    k_score_ : float
        Cross validation average score of the selected subset.
    subsets_ : dict
        A dictionary of selected feature subsets during the
        sequential selection, where the dictionary keys are
        the lenghts k of these feature subsets. The dictionary
        values are dictionaries themselves with the following
        keys: 'feature_idx' (tuple of indices of the feature subset)
              'cv_scores' (list individual cross-validation scores)
              'avg_score' (average cross-validation score)

     __init__ N/A N/A self estimator k_features forward floating print_progress scoring cv skip_if_stuck n_jobs pre_dispatch N/A True False True accuracy 5 True 1 2*n_jobs N/A N/A N/A self estimator estimator N/A N/A self k_features k_features N/A N/A self forward forward N/A N/A self floating floating N/A N/A self pre_dispatch pre_dispatch N/A N/A self scoring scoring N/A N/A self scorer N/A get_scorer scoring N/A N/A self skip_if_stuck skip_if_stuck N/A N/A self cv cv N/A N/A self print_progress print_progress N/A N/A self n_jobs n_jobs N/A N/A self named_est N/A key value N/A N/A key value N/A _name_estimators N/A N/A self estimator N/A fit N/A N/A self X y N/A N/A N/A N/A self est_ N/A clone N/A self estimator N/A N/A N/A N/A X shape N/A 1 N/A self k_features N/A N/A N/A AttributeError Features in X < k_features N/A N/A self skip_if_stuck N/A N/A sdq N/A deque maxlen 4 N/A N/A sdq N/A deque maxlen 0 N/A N/A self subsets_ N/A N/A orig_set N/A set N/A range N/A N/A X shape N/A 1 N/A N/A self forward N/A N/A k_idx N/A N/A k 0 N/A N/A k_idx N/A tuple N/A range N/A N/A X shape N/A 1 N/A k N/A len k_idx N/A k_score N/A N/A self _calc_score X y k_idx N/A N/A N/A self subsets_ N/A k N/A feature_idx cv_scores avg_score k_idx k_score N/A N/A k_score mean N/A N/A k N/A self k_features N/A N/A prev_subset N/A set k_idx N/A N/A self forward N/A N/A N/A k_idx k_score cv_scores N/A N/A self _inclusion orig_set orig_set subset prev_subset X X y y N/A N/A N/A k_idx k_score cv_scores N/A N/A self _exclusion feature_set prev_subset X X y y N/A N/A N/A self floating N/A N/A N/A self _is_stuck sdq N/A N/A N/A new_feature N/A N/A set k_idx prev_subset N/A N/A self forward N/A N/A N/A k_idx_c k_score_c cv_scores_c N/A N/A self _exclusion feature_set k_idx fixed_feature new_feature X X y y N/A N/A N/A k_idx_c k_score_c cv_scores_c N/A N/A self _inclusion orig_set N/A orig_set N/A new_feature subset N/A set k_idx X X y y N/A N/A k_score_c N/A k_score_c k_score N/A N/A N/A k_idx k_score cv_scores N/A k_idx_c k_score_c cv_scores_c N/A k N/A len k_idx N/A N/A N/A k N/A self subsets_ N/A N/A N/A N/A self subsets_ N/A k N/A avg_score k_score N/A N/A N/A N/A self subsets_ N/A k N/A feature_idx cv_scores avg_score k_idx cv_scores k_score N/A N/A N/A sdq append k_idx N/A N/A self print_progress N/A N/A N/A N/A N/A sys stderr write N/A 
Features: %d/%d N/A N/A len k_idx N/A self k_features N/A N/A N/A N/A sys stderr flush N/A N/A self k_feature_idx_ k_idx N/A N/A self k_score_ k_score N/A N/A self subsets_plus_ N/A dict N/A self N/A _is_stuck N/A N/A self sdq N/A N/A N/A stuck False N/A N/A N/A N/A len sdq 4 N/A N/A N/A sdq N/A 0 N/A sdq N/A 2 N/A N/A sdq N/A 1 N/A sdq N/A 3 N/A N/A stuck True N/A stuck N/A _calc_score N/A N/A self X y indices N/A N/A N/A N/A self cv N/A N/A scores N/A cross_val_score N/A self est_ N/A X N/A N/A N/A indices y cv N/A self cv scoring N/A self scorer n_jobs N/A self n_jobs pre_dispatch N/A self pre_dispatch N/A N/A N/A N/A N/A self est_ fit N/A X N/A N/A N/A indices y N/A scores N/A N/A np array N/A N/A N/A self scorer N/A self est_ N/A X N/A N/A N/A indices y N/A scores N/A _inclusion N/A N/A self orig_set subset X y N/A N/A N/A all_avg_scores N/A N/A all_cv_scores N/A N/A all_subsets N/A N/A res N/A None None None N/A remaining N/A orig_set subset N/A remaining N/A N/A feature remaining N/A N/A new_subset N/A tuple N/A subset N/A feature N/A cv_scores N/A N/A self _calc_score X y new_subset N/A N/A N/A all_avg_scores append N/A N/A cv_scores mean N/A N/A N/A all_cv_scores append cv_scores N/A N/A N/A all_subsets append new_subset N/A best N/A N/A np argmax all_avg_scores N/A res N/A N/A all_subsets N/A best N/A all_avg_scores N/A best N/A all_cv_scores N/A best N/A res N/A _exclusion N/A N/A self feature_set X y fixed_feature N/A None N/A N/A n N/A len feature_set N/A res N/A None None None N/A N/A n 1 N/A N/A all_avg_scores N/A N/A all_cv_scores N/A N/A all_subsets N/A N/A p N/A combinations feature_set r N/A n 1 N/A N/A N/A fixed_feature N/A fixed_feature N/A set p N/A N/A N/A cv_scores N/A N/A self _calc_score X y p N/A N/A N/A all_avg_scores append N/A N/A cv_scores mean N/A N/A N/A all_cv_scores append cv_scores N/A N/A N/A all_subsets append p N/A best N/A N/A np argmax all_avg_scores N/A res N/A N/A all_subsets N/A best N/A all_avg_scores N/A best N/A all_cv_scores N/A best N/A res N/A transform N/A N/A self X N/A N/A N/A N/A X N/A N/A N/A N/A self k_feature_idx_ N/A fit_transform N/A N/A self X y N/A N/A N/A N/A N/A self fit X y N/A N/A N/A self transform X N/A get_metric_dict N/A N/A self confidence_interval N/A 0.95 N/A N/A fdict N/A deepcopy N/A self subsets_ N/A k fdict N/A N/A std_dev N/A N/A np std N/A N/A N/A self subsets_ N/A k N/A cv_scores N/A N/A bound std_err N/A N/A self _calc_confidence N/A N/A N/A self subsets_ N/A k N/A cv_scores confidence confidence_interval N/A N/A N/A fdict N/A k N/A ci_bound bound N/A N/A N/A fdict N/A k N/A std_dev std_dev N/A N/A N/A fdict N/A k N/A std_err std_err N/A fdict N/A _calc_confidence N/A N/A self ary confidence N/A 0.95 N/A N/A std_err N/A N/A N/A scipy stats sem ary N/A bound N/A std_err N/A N/A N/A N/A sp stats t _ppf N/A N/A 1 confidence 2.0 N/A len ary N/A N/A bound std_err N/A N/A