Open PeterDSteinberg opened 7 years ago
Also consider whether we may want to have each of the estimators
do a prediction from different/same input feature matrices (https://github.com/ContinuumIO/elm/issues/180).
Also note in the documentation that is part of answering the general question in #198
"How do I hyperparameterize model structures (not just different model parameters)?"
In some cases, if hyperparameterization across different structure choices turns out infeasible, then maybe an alternate similar idea is using this MultiLayer
idea above, where estimators
of MultiLayer
have different structures, and rather than automatically choosing a best structure(s) just predicting from all using a second layer models and inferring from a second layer estimator.
See this prototype for hierarchical modeling added by PR #192 . The idea for hierarchical modeling described in the Phase II proposal was essentially taking a group of already-fit estimators as an argument to a new second layer estimator whose
fit
method involves calling thepredict
method of each of the already-fit estimators, concatenating their predictions along the column (feature) dimension, and using that feature matrix as the input to thefit
method of the second layer estimator.Initialization with a second layer estimator and group of already fit estimators:
A concatenation utility function that is called before most methods of the
estimator
(second layer estimator'sfit
,predict
,decision_function
, or other methods)A few TODO items I know of:
estimators
return:y
y
y
that differ in row count from estimator to estimator - raise an exception in the_concat_features
function. (We have to have the same shapey
returned by thepredict
method of each of the already-fitestimators
)estimators
are heterogeneous in structure/parameters as long as all of them return the same shapey
LabelBinarizer
step to encode the 2nd layer feature matrix as a binary one (with corresponding expansion of the column dimension and possibly a sparse representation). How do I do a 2nd layer Pipeline like that? My first thought on this is that theMultiLayer
class from the snippets above, would have a subclass (?) where thefit_transform
method returns the concatenatedestimators
' predictions, then any of the usualPipeline
steps could be used thereafter.estimators
viadask.distributed
usage inEaSearchCV
or related code)MultiLayer
for the_concat_features
function should useelm.pipeline.predict_many
(parallel prediction withdask.distributed
).