8000 Incorrect decision_function in linear_model? · Issue #19139 · scikit-learn/scikit-learn · GitHub
[go: up one dir, main page]

Skip to content
Incorrect decision_function in linear_model? #19139
Closed
@stootoon

Description

@stootoon

Hi folks,

The documentation of decision_function in LinearClassifierMixin says that it 'Predicts confidence scores for samples' where 'the confidence score for a sample is the signed distance of that sample to the hyperplane'. A few lines later the scores are computed as the scalar product of each sample with each of the coefficients, plus the intercepts. The problem with this is that without normalizing the coefficients to each have unit norm, the resulting scores will not actually be distances to the corresponding hyperplanes.

For example, in a setting where the intercept is zero, if I double the coefficient vectors the corresponding hyperplanes remain unchanged so the distances of each sample to each hyperplane should also remain unchanged. However, the scores, as defined above, would be changed, doubled in fact.

Am I mistaken or is there a reason why the coefficients are unnormalized?

Thanks,

Sina

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0