featureselection.py
def cfs(X, y):
    '''
    Runs Correlation-based feature selection on the data (X) and the target values (y) and finds
    the index of the significant features.

    Args:
        X: A Numpy array containing the dataset
        y: A Numpy array consisting of the target values
        n_features: An integer specifying how many features should be selected

    Returns a list containing the indices of the features that have been selected
    '''
    n_samples, n_features = X.shape
    F = []

    M = []
    while True:
        merit = -100000000000
        idx = -1
        for i in range(n_features):
            if i not in F:
                F.append(i)
                t = merit_calculation(X[:, F], y)
                if t > merit:
                    merit = t
                    idx = i
                F.pop()
        F.append(idx)
        M.append(merit)
        if len(M) > 6:
            if M[len(M)-1] <= M[len(M)-2]:
                if M[len(M)-2] <= M[len(M)-3]:
                    if M[len(M)-3] <= M[len(M)-4]:
                        if M[len(M)-4] <= M[len(M)-5]:
                            break
    return np.array(F)

    Runs Correlation-based feature selection on the data (X) and the target values (y) and finds
    the index of the significant features.

    Args:
        X: A Numpy array containing the dataset
        y: A Numpy array consisting of the target values
        n_features: An integer specifying how many features should be selected

    Returns a list containing the indices of the features that have been selected
    
Runs Correlation-based feature selection on the data (X) and the target values (y) and finds
the index of the significant features.
Runs Correlation - based feature selection on the data ( X ) and the target values ( y ) and finds the index of the significant features .
def cfs(X, y):
    n_samples, n_features = X.shape
    F = []
    M = []
    while True:
        merit = -100000000000
        idx = -1
        for i in range(n_features):
            if i not in F:
                F.append(i)
                t = merit_calculation(X[:, F], y)
                if t > merit:
                    merit = t
                    idx = i
                F.pop()
        F.append(idx)
        M.append(merit)
        if len(M) > 6:
            if M[len(M)-1] <= M[len(M)-2]:
                if M[len(M)-2] <= M[len(M)-3]:
                    if M[len(M)-3] <= M[len(M)-4]:
                        if M[len(M)-4] <= M[len(M)-5]:
                            break
    return np.array(F)
def cfs ( X , y ) : n_samples , n_features = X . shape F = [ ] M = [ ] while True : merit = - 100000000000 idx = - 1 for i in range ( n_features ) : if i not in F : F . append ( i ) t = merit_calculation ( X [ : , F ] , y ) if t > merit : merit = t idx = i F . pop ( ) F . append ( idx ) M . append ( merit ) if len ( M ) > 6 : if M [ len ( M ) - 1 ] <= M [ len ( M ) - 2 ] : if M [ len ( M ) - 2 ] <= M [ len ( M ) - 3 ] : if M [ len ( M ) - 3 ] <= M [ len ( M ) - 4 ] : if M [ len ( M ) - 4 ] <= M [ len ( M ) - 5 ] : break return np . array ( F )
Runs Correlation-based feature selection on the data (X) and the target values (y) and finds
the index of the significant features.
Runs Correlation - based feature selection on the data ( X ) and the target values ( y ) and finds the index of the significant features .
'''
    Runs Correlation-based feature selection on the data (X) and the target values (y) and finds
    the index of the significant features.

    Args:
        X: A Numpy array containing the dataset
        y: A Numpy array consisting of the target values
        n_features: An integer specifying how many features should be selected

    Returns a list containing the indices of the features that have been selected
    '''
X
A Numpy array containing the dataset
A Numpy array containing the dataset
y
A Numpy array consisting of the target values
A Numpy array consisting of the target values
n_features
An integer specifying how many features should be selected
An integer specifying how many features should be selected