preprocessing.py
def select_kbest(X, y, n):
    '''
    This function creates a list of n features which the
    select k best algorithm determines will perform best
    on a model
    '''
    from sklearn.feature_selection import SelectKBest, f_regression
    # create the skb object and fit to the data
    f_selector = SelectKBest(f_regression, k=n).fit(X, y)
    # create an array
    X_reduced = f_selector.transform(X)
    # get the feature support boolean mask list 
    f_support = f_selector.get_support()
    # reduce the dataframe to just those features and 
    # create list of features
    f_feature = X.iloc[:,f_support].columns.tolist()
    return f_feature

    This function creates a list of n features which the
    select k best algorithm determines will perform best
    on a model
    
This function creates a list of n features which the
select k best algorithm determines will perform best
on a model
This function creates a list of n features which the select k best algorithm determines will perform best on a model
def select_kbest(X, y, n):
    from sklearn.feature_selection import SelectKBest, f_regression
    f_selector = SelectKBest(f_regression, k=n).fit(X, y)
    X_reduced = f_selector.transform(X)
    f_support = f_selector.get_support()
    f_feature = X.iloc[:,f_support].columns.tolist()
    return f_feature
def select_kbest ( X , y , n ) : from sklearn . feature_selection import SelectKBest , f_regression f_selector = SelectKBest ( f_regression , k = n ) . fit ( X , y ) X_reduced = f_selector . transform ( X ) f_support = f_selector . get_support ( ) f_feature = X . iloc [ : , f_support ] . columns . tolist ( ) return f_feature
This function creates a list of n features which the
select k best algorithm determines will perform best
on a model
This function creates a list of n features which the select k best algorithm determines will perform best on a model
'''
    This function creates a list of n features which the
    select k best algorithm determines will perform best
    on a model
    ''' # create the skb object and fit to the data # create an array # get the feature support boolean mask list  # reduce the dataframe to just those features and  # create list of features
X
y
n