<jupyter_start><jupyter_text>Load data<jupyter_code>X_train, y_train, X_test, y_test = load_data("../data/data.csv")<jupyter_output>INFO:sklearn_turbostart.train:Transforming Y to log(Y)
INFO:sklearn_turbostart.train:Splitting data as 80/20<jupyter_text>Preprocessing pipeline<jupyter_code>standard_scalar_numerical_columns = [
    "Feature 1",
    "Feature 2",
    "Feature 4",
    "Feature 7",
    "Feature 9",
]
categorical_columns = ["Feature 5", "Feature 6", "Feature 8"]
preprocessing = ColumnTransformer(
    [
        (
            "numeric_standard_scalar",
            StandardScaler(),
            standard_scalar_numerical_columns,
        ),
        ("cat", OneHotEncoder(), categorical_columns),
    ]
)

estimators = create_estimators(preprocessing)<jupyter_output><empty_output><jupyter_text>Visualize preprocessing pipeline<jupyter_code>preprocessing<jupyter_output><empty_output><jupyter_text>Visualize model pipeline before fitting<jupyter_code>estimators["RandomForest"]<jupyter_output><empty_output><jupyter_text>Fit models<jupyter_code>train_estimators(estimators, X_train, y_train, X_test, y_test)<jupyter_output>Estimator: ElasticNet
Training score: 0.842
Cross-val score: 0.840
Test score: 0.861
----------
Estimator: RandomForest
Training score: 0.912
Cross-val score: 0.851
Test score: 0.879
----------
Estimator: HistGradientBoost
Training score: 0.925
Cross-val score: 0.851
Test score: 0.864
----------<jupyter_text>Visualize model pipeline after fitting. Get to know best fit parameters<jupyter_code>estimators["RandomForest"].best_estimator_<jupyter_output><empty_output><jupyter_text>Plot feature importance<jupyter_code>plot_permutation_importance(estimators, X_test, y_test)<jupyter_output>INFO:sklearn_turbostart.train:['Feature 1', 'Feature 2', 'Feature 4', 'Feature 7', 'Feature 9', 'x0_0', 'x0_1', 'x1_0', 'x1_1', 'x2_2', 'x2_3', 'x2_4', 'x2_5', 2]
INFO:sklearn_turbostart.train:['Feature 1', 'Feature 2', 'Feature 4', 'Feature 7', 'Feature 9', 'x0_0', 'x0_1', 'x1_0', 'x1_1', 'x2_2', 'x2_3', 'x2_4', 'x2_5', 2]
INFO:sklearn_turbostart.train:['Feature 1', 'Feature 2', 'Feature 4', 'Feature 7', 'Feature 9', 'x0_0', 'x0_1', 'x1_0', 'x1_1', 'x2_2', 'x2_3', 'x2_4', 'x2_5', 2]
{'fraction_non_alphanumeric': 0.1518300948938093, 'fraction_numerical': 0.05151378219611387, 'mean_word_length': 6.073482428115016, 'pattern_counts': {'":': 0, '<': 26, '<?xml version=': 0, '>': 26, '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': '7', 'dir': 'jupyter-structured-clean-dedup', 'id': '64342', 'license': 'MIT', 'n_tokens_mistral': 908, 'n_tokens_neox': 837, 'n_words': 155, 'path': 'notebooks/Quickstarter.ipynb', 'repo_name': 'pushkarjain/sklearn-turbostart', 'size': '2213'}