import pandas as pd from sklearn.datasets import fetch_california_housing housing = fetch_california_housing(return_X_y=False) df = pd.DataFrame(housing.data, columns=housing.feature_names) df['target'] = housing.target target='target' df import sys import warnings warnings.simplefilter(action='ignore') import numpy as np import matplotlib.pyplot as plt from sklearn.model_selection import train_test_split X_train, X_test, y_train, y_test = train_test_split(df[df.columns[:-1]], df[target], test_size=0.25) !pip install sweetviz import sweetviz as sv my_report = sv.analyze(df) # we generate html report # Default arguments will generate to "SWEETVIZ_REPORT.html" my_report.show_html() # we generate inline report my_report.show_notebook() !pip install ydata_profiling #!pip install matplotlib==3.1.3 from ydata_profiling import ProfileReport profile = ProfileReport(df, title="Profiling Report") #To generate a HTML report file, save the ProfileReport to an object and use the to_file() function: profile.to_file("ydata_profiling.html") #The HTML report can be directly embedded in a cell in a similar fashion: profile.to_notebook_iframe() !pip install mljar-supervised[full] from supervised.automl import AutoML #automl = AutoML(mode="Perform",results_path="AutoML_regression") #automl = AutoML(mode="Explain"results_path="AutoML_regression") automl = AutoML(results_path="AutoML_regression") automl.fit(X_train, y_train) y_predicted = automl.predict(X_test) y_predicted pd.read_csv('/content/AutoML_regression/leaderboard.csv') import imageio def show_image(file): im=imageio.imread(file) plt.figure(figsize=(8,8)) plt.imshow(im) plt.show() show_image('/content/AutoML_regression/features_heatmap.png') show_image('/content/AutoML_regression/ldb_performance_boxplot.png') show_image('/content/AutoML_regression/correlation_heatmap.png') show_image('/content/AutoML_regression/Ensemble/true_vs_predicted.png') show_image('/content/AutoML_regression/30_LightGBM/permutation_importance.png') !pip install tpot from tpot import TPOTRegressor tpot = TPOTRegressor(generations=2, population_size=50, verbosity=2, random_state=42) tpot.fit(X_train, y_train) print(tpot.score(X_test, y_test)) tpot.export('TPOTRegressor_pipeline.py')