

def combine(all_ensembles):
    'Combine the sub-estimators of a group of ensembles\n\n        >>> from sklearn.datasets import load_iris\n        >>> from sklearn.ensemble import ExtraTreesClassifier\n        >>> iris = load_iris()\n        >>> X, y = iris.data, iris.target\n\n        >>> all_ensembles = [ExtraTreesClassifier(n_estimators=4).fit(X, y)\n        ...                  for i in range(3)]\n        >>> big = combine(all_ensembles)\n        >>> len(big.estimators_)\n        12\n        >>> big.n_estimators\n        12\n        >>> big.score(X, y)\n        1.0\n\n        >>> big2 = combine(all_ensembles)\n        >>> len(big2.estimators_)\n        12\n\n    '
    final_ensemble = copy(all_ensembles[0])
    final_ensemble.estimators_ = []
    for ensemble in all_ensembles:
        final_ensemble.estimators_ += ensemble.estimators_
    final_ensemble.n_estimators = len(final_ensemble.estimators_)
    return all_ensembles

dataset/ETHPy150Open pydata/pyrallel/pyrallel/ensemble.py combine/VarMisuse@57/329 `final_ensemble`->`all_ensembles`