<jupyter_start><jupyter_text>Search for the best molecule with maximum target values in the candidate dataset.<jupyter_code>import numpy as np
import pandas as pd

from PrefInt.utility.bopredict import BOpred
# loaddata
loaddata = np.array(pd.read_csv('data/moldata/expmol.csv'))
expdata_1 = loaddata[:,1:]
loaddata = np.array(pd.read_csv('data/moldata/simmol.csv'))
#randomly choose some if the external data for training
np.random.shuffle(loaddata)
simdata_1 = loaddata[:50,1:]
#expdata_1: candidate dataset 
#simdata_1: external dataset with imcompatible function values
BO = BOpred(expdata_1,simdata_1)
#bestx:  best candidate descriptors
#besty: best candidate's target value
bestx, besty = BO.predict()
print (bestx, besty)
BO.showall()<jupyter_output>history function values:
[489.0, 470.0, 411.0, 491.0, 552.0, 460.0, 180.0, 196.0, 332.0, 324.0, 331.0, 334.0]
history best function values:
[489.0, 489.0, 489.0, 491.0, 552.0, 552.0, 552.0, 552.0, 552.0, 552.0, 552.0, 552.0]
history act:
[6, 5, 4, 7, 12, 13, 11, 0, 2, 9, 3, 1]
history of best act:
[6, 6, 6, 7, 12, 12, 12, 12, 12, 12, 12, 12]
{'fraction_non_alphanumeric': 0.14259763851044505, 'fraction_numerical': 0.12806539509536785, 'mean_word_length': 5.054945054945055, 'pattern_counts': {'":': 0, '<': 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': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '652677', 'license': 'MIT', 'n_tokens_mistral': 549, 'n_tokens_neox': 431, 'n_words': 131, 'path': 'examples/BOExample.ipynb', 'repo_name': 'sxl324/PrefInt', 'size': '1101'}