Source SMOTE
neureptrace.decoding.source_smote implements same-class source-row interpolation for feature matrices.
This is Category 1. Synthetic rows are convex combinations of source rows from the same class.
neureptrace.decoding.source_smote
Strict source-only SMOTE-style interpolation.
This module creates same-class interpolated source feature rows. It is intended as a dependency-light domain-generalization baseline for M/EEG feature matrices. Synthetic rows keep the sampled source class label and are generated only from source rows, so the protocol is strict source-only.
SourceSmoteConfig
dataclass
Configuration for source-only same-class interpolation.
Source code in src/neureptrace/decoding/source_smote.py
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 | |
enabled
property
Whether this config requests synthetic rows.
__post_init__()
Normalize and validate direct dataclass construction.
Source code in src/neureptrace/decoding/source_smote.py
35 36 37 38 39 40 41 42 | |
SourceSmoteResult
dataclass
Augmented source rows and interpolation provenance.
Source code in src/neureptrace/decoding/source_smote.py
51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 | |
n_synthetic
property
Number of generated rows in the returned matrix.
augment_source_with_smote(source_features, source_labels, *, source_domains=None, config=None)
Append same-class source interpolation rows.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
source_features
|
Sequence[Sequence[float]] | ndarray
|
Source feature matrix. |
required |
source_labels
|
Iterable[Any] | ndarray
|
One source label per row. Synthetic rows inherit the sampled class label. |
required |
source_domains
|
Iterable[Hashable] | ndarray | None
|
Optional source-domain identifiers. When |
None
|
config
|
SourceSmoteConfig | Mapping[str, Any] | None
|
SMOTE options. Mappings are normalized through :func: |
None
|
Source code in src/neureptrace/decoding/source_smote.py
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 | |
interpolate_rows(content_row, partner_row, lam)
Return a convex interpolation of two feature rows.
Source code in src/neureptrace/decoding/source_smote.py
181 182 183 184 185 186 187 188 189 | |
source_smote_config(*, synthetic_per_class=0, cross_domain_partner=True, preserve_original=True, random_state=13, jitter_std=0.0)
Normalize public source-SMOTE options.
Source code in src/neureptrace/decoding/source_smote.py
192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 | |