ddl.base.get_n_features¶
-
ddl.base.get_n_features(destructor, try_destructor_sample=False)[source]¶ Get the number of features for a fitted destructor.
Attempt to find
n_featureseither fromdestructor.n_features_,destructor.density_.n_features_, or via density samplingdestructor.density_.sample(1, random_state=0).shape[1].Parameters: - destructor : estimator
The (fitted) destructor from which to extract the number of features.
- try_destructor_sample : bool, optional, default=False
If
True, additionally attemptdestructor.sample(1, random_state=0).shape[ 1]. This option could cause infinite recursion sinceDestructorMixinusesget_n_featuresin order to sample but this can be avoided if the destructor reimplements sample withoutget_n_featuressuch as in theddl.base.CompositeDestructor.