<jupyter_start><jupyter_text>In this example we show how to train a `Predictor` and use it to make predictions for adsorbates on Pt.<jupyter_code># Generate adsorption structures
substrates_dictionary = generate_surface_structures(
    species_list=["Pt"],
    facets={"Pt":["100"]}
)

substrate = extract_structures(substrates_dictionary)[0]

adsorbed_dictionary = generate_adsorbed_structures(
    surface=substrate,
    adsorbates=["H", "O", "N", "C", "Na"],
    use_all_sites=False,
)

adsorbed_structures = extract_structures(adsorbed_dictionary)
# Generate labels
# N.B. here they are random for convenience, but should be actual values to train a meaningful `Predictor`

labels = np.random.randint(-10,10,size=len(adsorbed_structures))
kernel = RBF(0.5)

predictor = Predictor(
    model_class=GaussianProcessRegressor,
    model_kwargs={"kernel": kernel},
    featurizer_class=SineMatrix,
    featurization_kwargs={"design_space_structures": adsorbed_structures}
)

print(predictor)
predictor.fit(
    training_structures=adsorbed_structures,
    y=labels
)

print(predictor.is_fit)
test_dictionary = generate_adsorbed_structures(
    surface=substrate,
    adsorbates=["S", "Li", "P"],
    use_all_sites=False
)

test_structures = extract_structures(test_dictionary)
# Make predictions on unseen data
predictions, uncertainties = predictor.predict(testing_structures=test_structures)
print(predictions.shape)
print(uncertainties.shape)<jupyter_output>(3,)
(3,)
{'fraction_non_alphanumeric': 0.10687542545949626, 'fraction_numerical': 0.008168822328114363, 'mean_word_length': 6.7368421052631575, 'pattern_counts': {'":': 3, '<': 4, '<?xml version=': 0, '>': 4, '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': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '198258', 'license': 'MIT', 'n_tokens_mistral': 513, 'n_tokens_neox': 462, 'n_words': 96, 'path': 'examples/learning/making_predictions.ipynb', 'repo_name': 'aced-differentiate/auto_cat', 'size': '1469'}