<jupyter_start><jupyter_text>Stacked Pipeline - Automatic<jupyter_code>stacked_pipeline = make_pipeline(
    StackingEstimator(estimator=LassoLarsCV(normalize=True)),
    StackingEstimator(estimator=GradientBoostingRegressor(learning_rate=0.001, loss="huber", max_depth=3, max_features=0.55, min_samples_leaf=18, min_samples_split=14, subsample=0.7, random_state=1)),
    LassoLarsCV()
)
stacked_pipeline.fit(train.drop("y", axis=1), y_train)
results = stacked_pipeline.predict(train.drop("y", axis=1))
results<jupyter_output><empty_output><jupyter_text>Stacked Pipeline - Manual<jupyter_code>X = train.drop("y", axis=1)
estimator = LassoLarsCV(normalize=True)
estimator.fit(X, y_train)
X = check_array(X)
X = check_array(X)
X_transformed = np.copy(X)
X_transformed = np.hstack((np.reshape(estimator.predict(X), (-1, 1)), X_transformed))
X_transformed
X_transformed.shape
estimator_2 = GradientBoostingRegressor(learning_rate=0.001, loss="huber", max_depth=3, max_features=0.55, min_samples_leaf=18, min_samples_split=14, subsample=0.7, random_state=1)
estimator_2.fit(X_transformed, y_train)
X_transformed2 = np.copy(X_transformed)
X_transformed2 = np.hstack((np.reshape(estimator_2.predict(X_transformed), (-1, 1)), X_transformed2))
X_transformed2
X_transformed2.shape
estimator_3 = LassoLarsCV()
estimator_3.fit(X_transformed2, y_train)
estimator_3.predict(X_transformed2)<jupyter_output>/Users/datitran/anaconda/envs/kaggle/lib/python3.5/site-packages/sklearn/linear_model/least_angle.py:309: ConvergenceWarning: Regressors in active set degenerate. Dropping a regressor, after 4 iterations, i.e. alpha=8.423e-03, with an active set of 4 regressors, and the smallest cholesky pivot element being 2.107e-08
  ConvergenceWarning)
/Users/datitran/anaconda/envs/kaggle/lib/python3.5/site-packages/sklearn/linear_model/least_angle.py:377: RuntimeWarning: overflow encountered in true_divide
  g1 = arrayfuncs.min_pos((C - Cov) / (AA - corr_eq_dir + tiny))
/Users/datitran/anaconda/envs/kaggle/lib/python3.5/site-packages/sklearn/linear_model/least_angle.py:309: ConvergenceWarning: Regressors in active set degenerate. Dropping a regressor, after 37 iterations, i.e. alpha=3.153e-03, with an active set of 37 regressors, and the smallest cholesky pivot element being 1.490e-08
  ConvergenceWarning)
/Users/datitran/anaconda/envs/kaggle/lib/python3.5/site-packages/sklearn/linear_model/least_a[...]
{'fraction_non_alphanumeric': 0.12103505843071787, 'fraction_numerical': 0.040901502504173626, 'mean_word_length': 7.440140845070423, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '282209', 'license': 'MIT', 'n_tokens_mistral': 965, 'n_tokens_neox': 887, 'n_words': 141, 'path': 'MachineLearning/Stacking Regression/Stacked_model_understanding.ipynb', 'repo_name': 'datitran/Krimskrams', 'size': '2396'}