Consider using per-class weights during training
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- python, scikit-learn
- Domain
- machine-learning
Research direction
Start by locating the training call that invokes model.fit(X, y, sample_weight) and read how labels and evaluation metrics are prepared. Review sklearn's compute_sample_weight documentation, then verify that the proposed weighting behavior is covered by the project's existing training or evaluation checks and improves macro-averaged evaluation as intended.
Written by the indexing model from the issue text.
Description
Our classification problem is often unbalanced, with some classes having much more samples than other.
If we are interested in evaluating the problem in a way that each class gets equal weight (macro average) we could consider training the model using weights per class. In sklearn, this is achieved by passing an array sample_weight when calling
model.fit(X, y, sample_weight)
where the sample_weight that gives more weight to under-represented classes can be easily computed using sklearn's compute_sample_weight.
- Dominant language
- Python
- Stars
- 12
- Forks
- 6
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from BlueBrain/morphoclass
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
BlueBrain/morphoclass#87 · 1 comment ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
BlueBrain/morphoclass#86 ·
-
bug
BlueBrain/morphoclass#79 · 2 comments · 1 assignee ·
-
Difficulty 3/5 1-2 days Newbie friendliness 42/100
BlueBrain/morphoclass#56 ·
-
enhancement
Difficulty 4/5 3-5 days Newbie friendliness 35/100
BlueBrain/morphoclass#48 ·
All issues in BlueBrain/morphoclass
Similar issues
-
documentation help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
simonw/sqlite-utils#872 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100