<jupyter_start><jupyter_text>Landmark Lower Bound EstimationHere we show how we can try to estimate the lower bound for the number of landmarks that we would need in our analysis. Load the necessary packages<jupyter_code>import matplotlib.pyplot as plt
import scanpy as sc

import os.path as osp
import os
from PIL import Image

import anndata as ad
import pandas as pd
import sys

import eggplant as eg

N_REPS = 5
N_EVALS = 5
N_MIN_LMK = 1
N_MAX_LMK = 20<jupyter_output><empty_output><jupyter_text>Heart Data<jupyter_code>HEART_PTH = "../../../data/human-developmental-heart/curated/V10F24-105_A1.h5ad"
adata = ad.read_h5ad(HEART_PTH)

eg.pl.visualize_landmark_spread(adata, 
                                diameter_multiplier = 14,
                                marker_size = 10,
                                landmark_marker_size = 120,
                                seed = 1,
                               )
plt.show()
hrt_res = eg.fun.estimate_n_landmarks(dict(dhA = adata),
                                      n_max_lmks=N_MAX_LMK,
                                      n_min_lmks = N_MIN_LMK,
                                      n_reps = N_REPS,
                                      subsample = None,
                                      n_epochs=1000,
                                      n_evals= N_EVALS,
                                      device="gpu",
                                      verbose = True,
                                      diameter_multiplier= 14,
                                      seed = 1,
                                     )<jupyter_output>[Processing] :: Sample : dhA (1/1)<jupyter_text>plot the results<jupyter_code>fig,ax = eg.pl.landmark_diagnostics(hrt_res,return_figures = True)<jupyter_output><empty_output><jupyter_text>here it seems like $5$ is the lower bound, we can indicate this in the graph<jupyter_code>lower_bound = 5
eg.pl.landmark_diagnostics(hrt_res,lower_bound=lower_bound)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.06801007556675064, 'fraction_numerical': 0.01712846347607053, 'mean_word_length': 1.5994764397905759, 'pattern_counts': {'":': 0, '<': 16, '<?xml version=': 0, '>': 16, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 12, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '589444', 'license': 'MIT', 'n_tokens_mistral': 635, 'n_tokens_neox': 583, 'n_words': 129, 'path': 'docs/source/notebooks/estimate-number-of-landmarks.ipynb', 'repo_name': 'almaan/eggplant', 'size': '1985'}