<jupyter_start><jupyter_text>Jason gave me some data, let's see how well I can fit it. First, let's load in the data and normalize it.<jupyter_code>data = np.genfromtxt('Miro data.csv',delimiter=',',skip_header=64)
x = data[:,0]
y = data[:,1]
scale = y[0]


#Normalizing the counts
for i in range(0,len(y)):
    y[i] /= scale
    x[i] /= 2<jupyter_output><empty_output><jupyter_text>Now let's construct a basic surface that we think it could be. We will put in the bulk densities as our guess<jupyter_code>struct = pa.Surface()
STO = pa.Layer(0.,5.246,sigma=0.26,name="STO")
LSMO = pa.Layer(0.,6.6, sigma=5.85, name="LSMO")
struct.addLayer(LSMO)
struct.addLayer(STO)
exp = struct.doExperiment(x) #Generate an experiment object from the structure. 
exp.theory = y
old = exp.get_params_list()
model = pa.Fitter(exp,method="de",cutoff_begin=5)
model.bounds_from_guess()
model.set_bound(8,(0.1,10.)) #Custom sigma bounds
model.set_bound(9,(0.1,10.))
model.set_bound(4,(100,400))

print model.bounds
surf = model.fit()
mhm = exp.genTheory(modify=False)
plt.plot(x[0:],np.log10(mhm[0:]))
plt.plot(x[0:],np.log10(y[0:]))
print model.error(exp.get_params_list())
new = exp.get_params_list()
print new
print old
print new<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.16344605475040258, 'fraction_numerical': 0.03784219001610306, 'mean_word_length': 5.905555555555556, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '96568', 'license': 'Apache-2.0', 'n_tokens_mistral': 516, 'n_tokens_neox': 494, 'n_words': 111, 'path': 'notebooks/Graph/Demo Notebook.ipynb', 'repo_name': 'MiroFurtado/pyabeles', 'size': '1242'}