{
 "library": "brainference",
 "version": "1.0.0",
 "root": "8d7193fc97804cdc3aa9080728d8094732206c114f34d36b8ca2b89b943b3990",
 "license": null,
 "slug": "AdaptiveSplineSeparator",
 "ref": "AdaptiveSplineSeparator#6cd0",
 "hash": "sema:AdaptiveSplineSeparator#mh:SHA-256:6cd0be0ce642cfb16527c769bc946c7c7561d30e809bb9f5c0be55d20d42e5f0",
 "stub": "6cd0",
 "layer": "Mind",
 "type": "Inference",
 "summary": "Fit a curve through a 2-D scatter that maximally separates two groups, to catch oblique separation",
 "mechanism": "Axis-wise tests ask whether groups differ in x or in y; groups can differ along a diagonal and pass both. In a 2-D space (for example the rescaled coordinates from an EntropyDensityCollapse#0874), define a smooth spline C(l) through c control points (40) with x fixed, log-spaced over the data range, and y free. Initialise the y values on an existing curve such as the fitted scaling function. For each observation r_j, find the nearest point on the curve and take the signed perpendicular distance d_j (positive below, negative above). Optimise the log-y control values with L-BFGS-B, box-bounded to the observed y range, to maximise |mean d(group 1) - mean d(group 2)|, stopping on small gradient or function change (e.g. 1e-5, 1e-6, at most 200 iterations). Report the share of each group on each side, and judge significance with a permutation test that shuffles group labels between whole samples, as in ClusteredObservationTesting#5f8e. For fire ant trailing versus aggression, 67.8% of aggression windows fell below the curve and 70.6% of trail windows above (colony-level permutation p = 0.03), a split invisible to axis-wise GEE (p = 0.47, 0.97).",
 "invariants": [
  "The separator is optimised and tested under the same grouping of observations",
  "Control points stay inside the observed data range, so the curve does not extrapolate",
  "Significance comes from re-optimising under permuted labels, not from the optimised score itself"
 ],
 "parameters": {},
 "signature": [],
 "preconditions": [],
 "postconditions": [],
 "failure_modes": [
  "Overfitting: 40 free control points can separate noise; without re-fitting on permuted labels the score is optimistic",
  "Permuting windows instead of samples inflates significance",
  "Defining 'below' and 'above' only for a single-valued curve; it cannot represent groups that interleave"
 ],
 "domain": "",
 "caution": "",
 "sources": [
  {
   "kind": "thesis",
   "id": "do_2026_ant_collective_behavior",
   "note": "Ch. 3.3, Eqs. 3.29-3.32; Ch. 4.2.3, Fig. 4.4"
  }
 ],
 "name": "AdaptiveSplineSeparator",
 "builds_on": [
  {
   "alias": "clustered_testing",
   "relation": "composes_with",
   "library": "brainference",
   "slug": "ClusteredObservationTesting",
   "ref": "ClusteredObservationTesting#5f8e",
   "url": "https://semahash.org/vocabularies/brainference/patterns/ClusteredObservationTesting"
  },
  {
   "alias": "entropy_collapse",
   "relation": "references",
   "library": "brainference",
   "slug": "EntropyDensityCollapse",
   "ref": "EntropyDensityCollapse#0874",
   "url": "https://semahash.org/vocabularies/brainference/patterns/EntropyDensityCollapse"
  }
 ],
 "related": [],
 "used_by": [],
 "url": "https://semahash.org/vocabularies/brainference/patterns/AdaptiveSplineSeparator",
 "md_url": "https://semahash.org/vocabularies/brainference/patterns/AdaptiveSplineSeparator.md",
 "library_url": "https://semahash.org/vocabularies/brainference"
}
