<jupyter_start><jupyter_text>First, install OpenML, a library that provides access to the datasets on https://www.openml.org . You also need tpot, a library that uses genetic algorithms to test and produce the best machine learning model for the dataset (no deep learning).<jupyter_code>!pip install openml<jupyter_output><empty_output><jupyter_text>Next, import `openml`. You also import `train_test_split` for splitting up the data into training and testing data. Also import `TPOTClassifier` from TPOT.<jupyter_code>import openml as oml
from sklearn.model_selection import train_test_split
from tpot import TPOTClassifier<jupyter_output><empty_output><jupyter_text>Next, load in the dataset from OpenML and split it into training and testing data.<jupyter_code>dataset = oml.datasets.get_dataset(334)

x, y, attribute_names = dataset.get_data(
    target=dataset.default_target_attribute,
    return_attribute_names=True,
)

xtrain,xtest,ytrain,ytest = train_test_split(x,y,test_size=0.05, random_state=42)

print(x[0])<jupyter_output>[0. 0. 0. 0. 1. 1.]<jupyter_text>Now initialize the classifier and fit it to the data.<jupyter_code>tpot = TPOTClassifier(generations=5,verbosity=2)
tpot.fit(xtrain,ytrain)<jupyter_output>Optimization Progress:  33%|███▎      | 200/600 [01:14<02:38,  2.52pipeline/s]<jupyter_text>As you can see we achieved an accuracy of 100% with minimal overfitting (it tested 100%).<jupyter_code>print(tpot.score(xtest,ytest))<jupyter_output>1.0
{'fraction_non_alphanumeric': 0.09659863945578231, 'fraction_numerical': 0.029931972789115645, 'mean_word_length': 6.824468085106383, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 18, 'https://': 1, 'lorem ipsum': 0, 'www.': 1, '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': '5', 'dir': 'jupyter-structured-clean-dedup', 'id': '480012', 'license': 'MIT', 'n_tokens_mistral': 535, 'n_tokens_neox': 497, 'n_words': 133, 'path': 'Second_Monks_Problem.ipynb', 'repo_name': 'DaBananaGuy/Monks-Problem', 'size': '1470'}