Skip to content
This repository was archived by the owner on Nov 16, 2023. It is now read-only.
This repository was archived by the owner on Nov 16, 2023. It is now read-only.

Predictor summaries are not refreshed after refitting #106

Closed
@pieths

Description

@pieths

If a predictor is re-fit after retrieving a summary then the next time a summary is requested, it will return the old cached value. See the following unit tests for more details. Note, these currently fail because in both cases summary1 is equal to summary2.

def test_pipeline_summary_is_refreshed_after_refitting(self):
    predictor = OrdinaryLeastSquaresRegressor(normalize='No', l2_weight=0)
    pipeline = Pipeline([predictor])

    pipeline.fit([0,1,2,3], [1,2,3,4])
    summary1 = pipeline.summary()

    pipeline.fit([0,1,2,3], [2,5,8,11])
    summary2 = pipeline.summary()

    self.assertFalse(summary1.equals(summary2))

def test_predictor_summary_is_refreshed_after_refitting(self):
    predictor = OrdinaryLeastSquaresRegressor(normalize='No', l2_weight=0)

    predictor.fit([0,1,2,3], [1,2,3,4])
    summary1 = predictor.summary()

    predictor.fit([0,1,2,3], [2,5,8,11])
    summary2 = predictor.summary()

    self.assertFalse(summary1.equals(summary2))

Is running fit(...) more than once on a single instance of a predictor a supported scenario?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions