-
-
Notifications
You must be signed in to change notification settings - Fork 26.5k
Closed
Labels
Description
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:
clonemust haveis isinstance(obj, FrozenModel): return obj(or do so via class polymorphism /singledispatch)FrozenModeldelegates all attribute access (get, set, del) to its wrapped estimator (except where specified)- hence its estimator cannot be accessible at
FrozenModel().estimatorbut at some more munged name.
- hence its estimator cannot be accessible at
FrozenModelhasdef fit(self, *args, **kwargs): return selfFrozenModelhasdef fit_transform(self, *args, **kwargs): return fit(self, *args, **kwargs).transform(self, args[0])(and similar forfit_predict?)isinstance(freeze(obj), type(obj)) == Trueandisinstance(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!!
- since this is determined from
- must behave nicely with
pickleandcopy.[deep]copy freeze(some_list)will freeze every element of the list
NadiaRom, eric-czech, nxorable, PierreGtch, JnsLns and 1 more