<jupyter_start><jupyter_text>tpot- https://github.com/EpistasisLab/tpot- http://epistasislab.github.io/tpot/<jupyter_code>%%time
# uncomment this first pip uninstall line for Azure Notebooks
#!pip uninstall -y scikit-image azureml-train-automl azureml-opendatasets azureml-automl-core

# rest of these lines are appropriate for both Azure Notebooks and VSCode with default new Anaconda3 environment
!pip install deap update_checker tqdm stopit matplotlib
#!pip install xgboost
!pip install tpot

# ~6.5 minutes on free Azure Notebooks & MyBinder
# 1 minute on beefy workstation
# 2.5 minutes on i7-6560 + NVMe SSD ultrabook 
%%time
from tpot import TPOTClassifier
from sklearn.datasets import load_digits
from sklearn.model_selection import train_test_split
#%%time
digits = load_digits()
print(digits)
%%time
import matplotlib.pyplot as plt
plt.gray()
plt.set_cmap('gray_r')
plt.matshow(digits.images[0])
plt.show()
plt.matshow(digits.images[10])
plt.show()
plt.matshow(digits.images[1])
plt.show()
plt.matshow(digits.images[11])
plt.show()
plt.matshow(digits.images[1234])
plt.show()<jupyter_output><empty_output><jupyter_text>train_test_split outputs:- X_train: Training Data- X_test: Testing Data- y_train: Training Answers- y_test: Testing Answers<jupyter_code>%%time
#training_features, testing_features, training_target, testing_target
X_train, X_test, y_train, y_test = train_test_split(
    digits.data, digits.target, random_state=42,
    train_size=0.05, test_size=0.25)
#   train_size=0.75, test_size=0.25)
%%time
tpot = TPOTClassifier(generations=1, population_size=50, verbosity=2, random_state=42)
#tpot = TPOTClassifier(generations=5, population_size=50, verbosity=2, random_state=42)
%%time
tpot.fit(X_train, y_train)

# train_size=0.05, generations=1:
# ~15 minutes on free Azure Notebook & MyBinder (when it works - MyBinder seems buggy)
# ~1 minute on beefy workstation - 85-87% accurate
# ~2-3 minutes on i7/ssd ultrabook

# train_size=0.75, generations=5:
# ?? on free Azure Notebook & MyBinder (no thanks)
# ~24 minutes on beefy workstation - 98.3-98.9% accurate
%%time
print(tpot.score(X_test, y_test))
%%time
tpot.export('tpot_digits_pipeline.gen.py')<jupyter_output>Wall time: 3.98 ms
{'fraction_non_alphanumeric': 0.11402714932126697, 'fraction_numerical': 0.034389140271493215, 'mean_word_length': 6.2254901960784315, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 8, 'https://': 1, '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': '429429', 'license': 'MIT', 'n_tokens_mistral': 872, 'n_tokens_neox': 811, 'n_words': 196, 'path': 'src/tpot/tpot.ipynb', 'repo_name': 'jaxidian/IndySA_AutoML', 'size': '2210'}