Publish 2026_W32_Cosmos_guiltless-orange-mallard
Browse files
README.md
CHANGED
|
@@ -25,14 +25,18 @@ feature release `2026_W32`.
|
|
| 25 |
|
| 26 |
```python
|
| 27 |
import pandas as pd
|
| 28 |
-
from ephysatlas
|
| 29 |
|
| 30 |
-
|
| 31 |
df = pd.read_parquet("example/features_sample.parquet") # or your own features
|
| 32 |
-
out =
|
| 33 |
print(out[["predicted_acronym", "prediction_probability", "fold_agreement"]].head())
|
| 34 |
```
|
| 35 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 36 |
`predict` returns one row per input channel, indexed identically to the input:
|
| 37 |
`predicted_acronym`, its Allen `predicted_atlas_id`, the fold-averaged
|
| 38 |
`prediction_probability`, a `fold_agreement` column (fraction of the 5 folds voting
|
|
@@ -51,7 +55,7 @@ carries histology-derived `acronym` / `atlas_id` columns, and predictions must n
|
|
| 51 |
as loaded by `ephysatlas.data.read_features_from_disk`. Units are baked into that table by
|
| 52 |
the pipeline (RMS features in dB, `spike_count` in log2), so feeding raw features, or
|
| 53 |
features from a vintage whose units differ, produces confident nonsense. Run
|
| 54 |
-
`
|
| 55 |
|
| 56 |
## Performance
|
| 57 |
|
|
@@ -70,11 +74,15 @@ insertion appears in training. See `confusion_matrix.png`.
|
|
| 70 |
|
| 71 |
## Reproducibility
|
| 72 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 73 |
`ephysatlas_model.json` records the training-time `environment` (xgboost, scikit-learn, numpy,
|
| 74 |
ephysatlas, python) and `random_seed`. Verify your install reproduces the shipped output:
|
| 75 |
|
| 76 |
```python
|
| 77 |
-
|
| 78 |
```
|
| 79 |
|
| 80 |
Note `scikit-learn<1.9` is required (1.9 broke `OneToOneFeatureMixin.get_feature_names_out`,
|
|
|
|
| 25 |
|
| 26 |
```python
|
| 27 |
import pandas as pd
|
| 28 |
+
from ephysatlas import load_pretrained
|
| 29 |
|
| 30 |
+
model = load_pretrained("int-brain-lab/ea-decoder-channel-xgboost", revision="2026_W32")
|
| 31 |
df = pd.read_parquet("example/features_sample.parquet") # or your own features
|
| 32 |
+
out = model.predict(df)
|
| 33 |
print(out[["predicted_acronym", "prediction_probability", "fold_agreement"]].head())
|
| 34 |
```
|
| 35 |
|
| 36 |
+
`load_pretrained` is the entry point for every ephysatlas model, whatever its family — it reads
|
| 37 |
+
`ephysatlas_model.json` and returns the right wrapper. Use it rather than importing a concrete
|
| 38 |
+
class, so your code keeps working as the package evolves.
|
| 39 |
+
|
| 40 |
`predict` returns one row per input channel, indexed identically to the input:
|
| 41 |
`predicted_acronym`, its Allen `predicted_atlas_id`, the fold-averaged
|
| 42 |
`prediction_probability`, a `fold_agreement` column (fraction of the 5 folds voting
|
|
|
|
| 55 |
as loaded by `ephysatlas.data.read_features_from_disk`. Units are baked into that table by
|
| 56 |
the pipeline (RMS features in dB, `spike_count` in log2), so feeding raw features, or
|
| 57 |
features from a vintage whose units differ, produces confident nonsense. Run
|
| 58 |
+
`model.selftest()` to confirm your install reproduces the shipped output before trusting it.
|
| 59 |
|
| 60 |
## Performance
|
| 61 |
|
|
|
|
| 74 |
|
| 75 |
## Reproducibility
|
| 76 |
|
| 77 |
+
**Pin the revision.** `revision="2026_W32"` is an immutable tag. Omitting `revision` resolves
|
| 78 |
+
to `main`, which tracks whichever model is currently recommended and *will* change when a new
|
| 79 |
+
feature vintage is published — fine for a first look, not for anything you publish or re-run.
|
| 80 |
+
|
| 81 |
`ephysatlas_model.json` records the training-time `environment` (xgboost, scikit-learn, numpy,
|
| 82 |
ephysatlas, python) and `random_seed`. Verify your install reproduces the shipped output:
|
| 83 |
|
| 84 |
```python
|
| 85 |
+
model.selftest()
|
| 86 |
```
|
| 87 |
|
| 88 |
Note `scikit-learn<1.9` is required (1.9 broke `OneToOneFeatureMixin.get_feature_names_out`,
|