Skip to content

Add TestOnly resampling strategy? #976

Open
@ablaom

Description

@ablaom

Sometimes you have trained a supervised machine on some data and you want to evaluate on some holdout set without retraining. Using evaluate!(..., resamping=Holdout()) doesn't allow this, so you would need to manually predict, and apply each metric to the prediction and test target, which is inconvenient, especially if you are tracking multiple metrics.

The idea of a TestOnly reampling strategy is that evaluate!(mach, resampling=TestOnly(), rows=test, measures=...) automates this: we assume mach is already trained (or throw an exception) and just evaluate the specified measures on predictions on the test rows.

Implementation looks pretty simple: train_test_pairs(::TestOnly, rows) = [(Int[], rows),] (i.e. empty train) and in evaluate! an empty train set will suppress training.

(It would be very convenient and natural that specifying no resampling strategy would fall back to TestOnly(), as in:

fit!(mach, rows=train)
evaluate!(mach, rows=test, measure=l2)

but that would be technically breaking - the current fallback is CV(). )

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    • Status

      tracking/discussion/metaissues/misc

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions