<jupyter_start><jupyter_text>PolynomialsPolynomials are often used to offset the models in match the observations. The`paintbox` uses Legendre polynomials, which can be used as indicated below.<jupyter_code>import numpy as np
import paintbox as pb
import matplotlib.pyplot as plt

wave = np.linspace(5000, 7000, 2000)
degree = 10
poly = pb.Polynomial(wave, degree)
print(f"Parameter names: {poly.parnames}")
theta = np.random.random(degree + 1)
fig = plt.figure(dpi=120)
poly.plot(theta)
plt.xlabel("$\lambda$ (Angstrom)")
plt.ylabel("Flux")
plt.tight_layout()
plt.savefig("../docs/figures/polynomial_example.png")<jupyter_output>Parameter names: ['p_0', 'p_1', 'p_2', 'p_3', 'p_4', 'p_5', 'p_6', 'p_7', 'p_8', 'p_9', 'p_10']
{'fraction_non_alphanumeric': 0.15448275862068966, 'fraction_numerical': 0.041379310344827586, 'mean_word_length': 6.484536082474227, '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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '369970', 'license': 'BSD-3-Clause-Clear', 'n_tokens_mistral': 299, 'n_tokens_neox': 279, 'n_words': 69, 'path': 'tutorials/polynomials.ipynb', 'repo_name': 'cebarbosa/paintbox', 'size': '725'}