SpikeInterface / SpikeInterface/spikeinterface
Training a curation model with metrics from older version fail
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 847
- Forks
- 280
- Avg merge
- 3d 9h
- Merged PRs (30d)
- 29
Description
I am trying to train a model for curation with an analyser computed with version 0.103.0, using spike interface version 0.104.8 fails with error
KeyError Traceback (most recent call last)
Cell In[22], line 3
1 folder = "/Users/layardh/The Francis Crick Dropbox/Hugo LayardHorsfall/1 SUNAN/OSSS_unitrefine/UnitRefine/human_np"
2
----> 3 trainer = sc.train_model(
4 mode="analyzers", # Use SortingAnalyzer objects as input
5 labels=[labels], # List of label arrays (one per analyzer)
6 analyzers=[analyzer], # List of SortingAnalyzer objects
File ~/The Francis Crick Dropbox/Hugo LayardHorsfall/1 SUNAN/OSSS_unitrefine/UnitRefine/.venv/lib/python3.13/site-packages/spikeinterface/curation/train_manual_curation.py:762, in train_model(mode, labels, analyzers, metrics_paths, folder, metric_names, imputation_strategies, scaling_techniques, classifiers, test_size, overwrite, seed, search_kwargs, verbose, enforce_metric_params, **job_kwargs)
760 if mode == "analyzers":
761 assert analyzers is not None, "Analyzers must be provided as a list for mode 'analyzers'"
--> 762 trainer.load_and_preprocess_analyzers(analyzers, enforce_metric_params)
764 elif mode == "csv":
765 for metrics_path in metrics_paths:
File ~/The Francis Crick Dropbox/Hugo LayardHorsfall/1 SUNAN/OSSS_unitrefine/UnitRefine/.venv/lib/python3.13/site-packages/spikeinterface/curation/train_manual_curation.py:276, in CurationTrainer.load_and_preprocess_analyzers(self, analyzers, enforce_metric_params)
273 metric_names = metric_extension.params["metric_names"]
274 consistent_metrics = list(set(metric_names).difference(set(conflicting_metrics)))
275 consistent_metric_params = {
--> 276 metric: metric_extension.params["metric_params"][metric] for metric in consistent_metrics
277 }
278 self.metrics_params[extension_name + "_params"]["metric_params"] = consistent_metric_params
280 self.process_test_data_for_classification()
KeyError: 'mahalanobis'```
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in spikeinterface/curation/train_manual_curation.py at train_model and CurationTrainer.load_and_preprocess_analyzers. Reproduce training with an analyzer computed by version 0.103.0 and SpikeInterface 0.104.8, then inspect how the mahalanobis metric is handled in metric_params. Done means this cross-version input trains successfully or reports a clear compatibility error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- machine-learning
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100