JuliaAI / JuliaAI/DecisionTree.jl

Adding a new field to the `Leaf` API to support sample weights

Open
#72 4 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Julia
Stars
364
Forks
100
PR merge metrics
No merged PRs in 30d

Description

I'm thinking of adding support for sample weights, which isn't compatible with the current Leaf struct. More specifically, the field values in the struct lists every label that falls into the leaf with multiplicity, but does not give the weight of each label in the list. To add support for sample weights, I propose that we do either of the following:

  • Add a new field of the weights to the Leaf struct such that leaf.weight[i] gives the sum of the weights of the label in leaf.values[i]
  • Change leaf.values into a dictionary mapping each label to the sum of its weight, i.e., leaf.values[d] gives the weight of the label d.

Contributor guide

No contributing guide indexed for this repository

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

Start by locating the Leaf struct and every use of its values field. Compare the proposed weights field and dictionary representations, then determine which API preserves the needed label information while supporting sample weights. Done means the chosen Leaf representation is implemented consistently and sample-weight behavior is supported.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
api, machine-learning
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.