segger_dev icon indicating copy to clipboard operation
segger_dev copied to clipboard

[BUG] NameError: name 'XeniumSample' is not defined

Open marzaidi opened this issue 8 months ago • 1 comments

hello! i am getting this error during the last step of hyperparameter tuning:

---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
Cell In[15], line 25
     22 model_dir.mkdir(exist_ok=True, parents=True)
     23 config['model_dir'] = model_dir
---> 25 segmentation = trainable(config)
     26 trial = evaluate(segmentation, predict_kwargs['score_cut'])
     27 trial = pd.concat([pd.Series(config), trial])

Cell In[14], line 6, in trainable(config)
      3 receptive_field = {k: config[k] for k in ['k_bd', 'k_tx', 'dist_bd', 'dist_tx']}
      5 # Dataset creation
----> 6 xs = XeniumSample(verbose=False)
      7 xs.set_file_paths(transcripts_path, boundaries_path)
      8 xs.set_metadata()

NameError: name 'XeniumSample' is not defined


i am following the tutorial here: https://elihei2.github.io/segger_dev/notebooks/segger_tutorial/

my code:

param_space = {
    "k_bd": [3, 5, 10],
    "dist_bd": [5, 10, 15, 20],
    "k_tx": [3, 5, 10],
    "dist_tx": [3, 5, 10],
}

metrics = []

for params in itertools.product(*param_space.values()):

    config = dict(zip(param_space.keys(), params))

    # Setup directories
    trial_dir = tuning_dir / '_'.join([f'{k}={v}' for k, v in config.items()])

    data_dir = trial_dir / 'segger_data'
    data_dir.mkdir(exist_ok=True, parents=True)
    config['data_dir'] = data_dir

    model_dir = trial_dir / 'models'
    model_dir.mkdir(exist_ok=True, parents=True)
    config['model_dir'] = model_dir

    segmentation = trainable(config)
    trial = evaluate(segmentation, predict_kwargs['score_cut'])
    trial = pd.concat([pd.Series(config), trial])
    metrics.append(trial)

metrics = pd.DataFrame(metrics)

please let me know if you need any other information, thanks in advance!

marzaidi avatar Apr 12 '25 14:04 marzaidi

Hey @marzaidi the hyperparam tuning is deprecated and we will update it soon. thanks for reporting this.

EliHei2 avatar Apr 28 '25 07:04 EliHei2