rust-ml / rust-ml/linfa

Add offset support to LogisticRegression for fixed/known linear predictor contributions

Open
#431 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
4.7k
Forks
334
Avg merge
39m
Merged PRs (30d)
1

Description

Hey, would it be possible to add support for an offset or fixed-coefficient parameter to LogisticRegression? This issue on Python's sklearn is exactly what I'm trying to do.

The API could look something like this:

// Pass a precomputed offset term per observation
// log_odds = offset[i] + β₀ + β₁·x[i]
let model = LogisticRegression::default()
    .alpha(1.0)
    .offset(offset_array)  // Array1<f64>, one value per training sample
    .fit(&dataset)?;

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 Rust implementation of LogisticRegression and its fit API, then compare the requested offset behavior with the linked scikit-learn issue. The work is done when LogisticRegression accepts one precomputed offset value per training sample and incorporates it into the stated log-odds model, with fitting behavior and API details defined.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.