<jupyter_start><jupyter_text>Perform fCUBT on the data<jupyter_code># Load packages
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
import pickle

from FDApy.clustering.fcubt import Node, FCUBT
from FDApy.representation.functional_data import DenseFunctionalData
from FDApy.visualization.plot import plot

from matplotlib import colors as mcolors
COLORS = ['#377eb8', '#ff7f00', '#4daf4a',
          '#f781bf', '#a65628', '#984ea3',
          '#999999', '#e41a1c', '#dede00']

#matplotlib.use("pgf")
#matplotlib.rcParams.update({
#    "pgf.texsystem": "pdflatex",
#    'font.family': 'serif',
#    'text.usetex': True,
#    'pgf.rcfonts': False,
#})
# Load data
with open('./data/scenario_1.pkl', 'rb') as f:
    data_fd = pickle.load(f)
# Build the tree
root_node = Node(data_fd, is_root=True)
fcubt = FCUBT(root_node=root_node)
# Growing
fcubt.grow(n_components=0.95, min_size=10)
# Joining
fcubt.join(n_components=0.95)
# Plot the tree
fig = plt.figure(figsize=(10, 10), constrained_layout=True)
fcubt.plot(fig=fig)
plt.savefig('./figures/maximal_tree.pdf')<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1476147614761476, 'fraction_numerical': 0.0405040504050405, 'mean_word_length': 5.427745664739884, 'pattern_counts': {'":': 1, '<': 5, '<?xml version=': 0, '>': 5, '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': '382274', 'license': 'MIT', 'n_tokens_mistral': 464, 'n_tokens_neox': 437, 'n_words': 89, 'path': 'scenario_1/02-fcubt.ipynb', 'repo_name': 'StevenGolovkine/fcubt', 'size': '1111'}