pelinker.screener.projection_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/screener/projection_screener.py
build_projection_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.
Returns (X, y, prepared_row_pos) where prepared_row_pos[i] is the integer row
index in prepared (iloc order) for stacked row X[i] (KB block then negatives).
Source code in pelinker/screener/projection_screener.py
evaluate_projection_cv(X, y, cfg)
¶
Stratified CV: LDA vs linear LinearSVC vs RBF SVC by mean test F1 (pos_label=1).
Returns (cv_payload, winner_kind) or None if CV infeasible.
Source code in pelinker/screener/projection_screener.py
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 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 | |
fit_projection_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/screener/projection_screener.py
fit_projection_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).
Source code in pelinker/screener/projection_screener.py
make_manifold_linear_svc(X_train, cfg)
¶
Primal LinearSVC when n_samples > n_features (typical for 3D features).
Source code in pelinker/screener/projection_screener.py
oov_estimator_scores(estimator, X)
¶
Public wrapper for OOV decision scores (higher => more like class 1).
pick_projection_winner_by_mean_f1(lda_mean, svm_mean, rbf_mean)
¶
Argmax mean test F1; ties prefer simpler models (lda, then svm, then rbf).