scikit-learn / scikit-learn/scikit-learn

Standard attribute for model completion status

Open
#9,819 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

API Enhancement Needs Decision
Dominant language
Python
Stars
67.3k
Forks
27.4k
Avg merge
1d 15h
Merged PRs (30d)
58

Description

At the moment, there is no way to know why a model stopped fitting (aside from exceptions). It may be because convergence was reached (below a tolerance), or because a hard limit on iterations was hit, or possibly some other condition was met. It would be excellent if Scikit-learn models had some kind of flat attached after fitting. Perhaps model.fit_status_ or similar. This could then be reported during usage.

For example, I'm hitting a problem with MiniBatchKMeans clustering, where some clusters are not assigned. The only think I know is that the max_iter was not met, but I don't know if it's due to the max_no_improvement flag, because the tol is too high (not in my case). It would be great if the model reported this in a standard way.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No file, test, or entry point is identified. Start by reviewing the fitting behavior of MiniBatchKMeans, including max_iter, max_no_improvement, and tol, then compare how other estimators report completion. Done means defining and documenting a consistent completion-status attribute that distinguishes the stopping condition.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
machine-learning
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.