Skip to content

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

@dxwil

Description

@dxwil

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)?;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions