Skip to content

Possible enhancement at feature selection #1680

@caiogimenes

Description

@caiogimenes

SelectKBest transformer currently ranks features based on raw Pearson correlation values [-1,1]. So features that are negatively correlated with the target might be excluded, even if they are highly predictive.
e.g:
0.8 → ranked high
−0.9 → ranked low or excluded, despite being stronger

Possible fix is to add a new param use_abs to allow user to control using absolute value and adding it to learn_one method.

def learn_one(self, x, y):
    for i, xi in x.items():
        self.similarities[i].update(xi, y)
        if self.use_abs:
            similarity_value = abs(self.similarities[i].get())
        else:
            similarity_value = self.similarities[i].get()
        self.leaderboard[i] = similarity_value

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions