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_features
either 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 sinceDestructorMixin
usesget_n_features
in order to sample but this can be avoided if the destructor reimplements sample withoutget_n_features
such as in theddl.base.CompositeDestructor
.