Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

API Freezing estimators #8370

Copy link
Copy link
Closed
Closed
Copy link
@jnothman

Description

@jnothman
Issue body actions

TODO: motivate freezing: pipeline components, calibration, transfer/semisupervised learning

This should probably be a SLEP, but I just want it saved somewhere.

Features required for estimator freezing:

  • clone must have is isinstance(obj, FrozenModel): return obj (or do so via class polymorphism / singledispatch)
  • FrozenModel delegates all attribute access (get, set, del) to its wrapped estimator (except where specified)
    • hence its estimator cannot be accessible at FrozenModel().estimator but at some more munged name.
  • FrozenModel has def fit(self, *args, **kwargs): return self
  • FrozenModel has def fit_transform(self, *args, **kwargs): return fit(self, *args, **kwargs).transform(self, args[0]) (and similar for fit_predict?)
  • isinstance(freeze(obj), type(obj)) == True and isinstance(freeze(obj), FrozenModel) == True
    • since this is determined from type(freeze(obj)) (excluding __instancecheck__, which seems irrelevant), this appears to be the hardest criterion to fulfill
    • seems to entail use of a mixin, class created in closure, setting __class__ (!), overloading of __reduce__, help! I think I've gone down the wrong path!!
  • must behave nicely with pickle and copy.[deep]copy
  • freeze(some_list) will freeze every element of the list

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.