Skip to content
프로젝트

소개

All Relevant Feature Selection

AI 및 머신러닝

이 수치를 측정하는 방법

측정된 스타 증가

in 24h
기록 수집 중
in 7 days
기록 수집 중
in 15 days
기록 수집 중
in 1 month
기록 수집 중

서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.

README.md

Original

ARFS feature selection

ARFS logo

Web documentation · PyPI · Downloads · Support ARFS on Ko-fi

Installation

Add ARFS to a uv project that supports Python 3.9–3.12.

uv add arfs

If you use pip, run this in your Python environment.

python -m pip install arfs

The examples below use ARFS 5.0.1. If PyPI still offers an older version, install the 5.0.1 release wheel.

python -m pip install https://github.com/ThomasBury/arfs/releases/download/5.0.1/arfs-5.0.1-py3-none-any.whl

First fit with GrootCV

This offline example uses one strong predictor and two noise columns. Split the rows before fitting so selection sees only the training data.

import numpy as np
import pandas as pd
from sklearn.model_selection import train_test_split

from arfs.feature_selection import GrootCV

rng = np.random.default_rng(42)
X = pd.DataFrame(rng.normal(size=(240, 3)), columns=["signal", "noise_a", "noise_b"])
y = 5 * X["signal"] + rng.normal(scale=0.1, size=len(X))
X_train, X_test, y_train, y_test = train_test_split(
    X, y, test_size=0.25, random_state=42
)

selector = GrootCV(
    objective="rmse",
    n_folds=3,
    n_iter=1,
    n_jobs=1,
    random_state=42,
    lgbm_params={"num_iterations": 40},
).fit(X_train, y_train)

X_train_selected = selector.transform(X_train)
X_test_selected = selector.transform(X_test)

print(selector.selected_features_.tolist())  # ['signal']
print(X_train_selected.shape, X_test_selected.shape)  # (180, 1) (60, 1)

GrootCV uses LightGBM to compare each predictor's importance with shuffled copies of the predictors. The selected columns depend on the data, the model and the training split. Use the held-out rows to evaluate a downstream model after selection.

Start with the method chooser to pick a selector for your task. See Upgrading to 5.0 for migration steps and the contributor guide to run the tutorials and build the docs.

Tutorials

Advanced tutorials

Method origins

Leshy builds on Boruta and BorutaPy. BoostAGroota builds on BoostARoota. GrootCV compares LightGBM SHAP contributions across folds. Methods overview describes how ARFS implements these methods, MRMR and Lasso.

관련 프로젝트 살펴보기

불러오는 중…