Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Implementing partial_fit for NearestCentroid #12952

Copy link
Copy link
@dirkpadfield

Description

@dirkpadfield
Issue body actions

Description

The NearestCentroid classifier (https://scikit-learn.org/stable/modules/generated/sklearn.neighbors.NearestCentroid.html) does not currently have a partial_fit method, but it would be very useful when running the algorithm in an online fashion. The math for implementing it is simple; it's just a matter of updating the centroids weighted by the number of samples. The implementation could be similar to the partial_fit method of the GaussianNB classifier (except for the obvious mathematical differences). I'm happy to submit an implementation of this, but I wanted to gather input first to see if others have already done this and whether others would find this useful.

Steps/Code to Reproduce

Look at NearestCentroid classifier code and notice that it has not partial_fit method.

Expected Results

There should be a partial_fit method.

Actual Results

There is no partial_fit method.

Versions

N/A

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

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.