pelinker.manifold_oov_screener¶
3D manifold OOV score model: residual, Mahalanobis, spectral entropy vs synthetic negatives.
ManifoldOovScoreModel
dataclass
¶
Fitted winner; :meth:score is used at predict time (higher => more OOV-like).
Source code in pelinker/manifold_oov_screener.py
build_manifold_oov_training_arrays(prepared, manifold_df, transformer, *, negative_label)
¶
KB rows (class 0) aligned with manifold_df order; synthetic negatives (class 1)
from prepared projected through transformer.transform.
Source code in pelinker/manifold_oov_screener.py
evaluate_manifold_oov_cv(X, y, cfg)
¶
Stratified CV: DT grid vs SVM vs LDA by mean test F1 (pos_label=1).
Returns (cv_payload, winner_kind, winner_dt_params) or None if CV infeasible.
cv_payload is JSON-serializable summary; winner_dt_params is
(max_depth, min_samples_leaf) when DT wins else None.
Source code in pelinker/manifold_oov_screener.py
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 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 | |
fit_manifold_oov_lda_no_cv(X, y)
¶
Fit LDA on all data when stratified CV is infeasible (e.g. only one minority-class sample).
cv_payload records that CV was skipped.
Source code in pelinker/manifold_oov_screener.py
fit_manifold_oov_score_model(X, y, cfg, *, cv_payload_and_winner)
¶
If cv_payload_and_winner is None (CV infeasible), return (None, None).
Otherwise refit the winner on all data and return (model, cv_payload).