Skip to content

[python package]: suggestion: lgb.Booster.predict() should check that the input X data makes sense #812

Closed
@j-mark-hou

Description

In particular, I'm thinking about these things:

  1. if the input is an np.array, check that the columns is the same as the number of features the lgb.Booster object uses. if not, throw a warning.
  2. if the input is a pd.Dataframe object, should check that the feature_names of the lgb.Booster object is a superset of the columns of the pd.Dataframe
  3. if feature names in the booster object are repeated, or if column names in the pd.Dataframe are repeated, fall back to 0.

if these things sound reasonable I'd be happy to add these checks to the lgb.Booster.predict() function prior to calling the lgb._InnerPredictor.predict()

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions