feat: Gradient Boosting Tree predicted leaf as feature

Open
#293 4 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
25/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale

Research direction

The request is for a DecisionTreeLeafEncoder transformer that adds LightGBM's per-tree leaf predictions as features; the payload names no existing files, so begin by finding how the repository's other sklearn-style transformers implement fit and transform. Before writing code, check with the maintainers whether a LightGBM dependency is acceptable, since the thread has been silent for about five years. Done means a transformer that returns leaf indices per tree, with tests covering fit, transform, and sklearn compatibility.

Written by the indexing model from the issue text.

Description

Is your feature request related to a problem? Please describe.

LightGBM has the option to return the predicted decision tree leaf for every model. From the documentation

If pred_leaf=True, the predicted leaf of every tree for each sample.

Reference

Describe the solution you'd like

A DecisionTreeLeafEncoder method that returns the results from the predict method of lightgbm as a new feature.

Dominant language
Python
Stars
2.3k
Forks
391
Avg merge
11h 34m
Merged PRs (30d)
11

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

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.

More from feature-engine/feature_engine

All issues in feature-engine/feature_engine

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.