spineSummary

Say in words what a partition found.
Nothing is recomputed, so it can be called whenever you like, including on a Result loaded back from a saved file long after the run.

Syntax and options

help spineSummary
SPINE Summary Say in words what a partition found. spineSummary(Result) prints txt = spineSummary(Result) returns the text, prints nothing Nothing is recomputed. Call it whenever you like, including on a Result loaded back from a saved file long after the run. Returning the text means it composes: it can go into a figure title, a log, or a methods paragraph. Author Abd AlRahman AlMomani Assistant Professor of Data Science and Mathematics, ERAU, AZ almomaniar@gmail.com

A partition with structure

rng(20260810);
X = [randn(240,8); randn(45,8) + 6; randn(15,8) + 30];
[~, Result] = spine(X, 'robustrownorm', "upper");
spineSummary(Result)
SPINE 300 objects, 3 strata measure robustrownorm | orientation upper stratum objects measure range score 1 240 0.6907 to 3.263 0.000 2 45 9.351 to 13.04 0.221 3 15 58.64 to 60.36 1.000 cuts at 3.263, 13.04 Result.boundaryValues applies these cuts to new data.

When there is nothing to find

A single stratum is an answer, not a failure, and the summary says so rather than reporting a cut that does not exist.
rng(3);
[~, Flat] = spine(randn(300,4), 'dist2median', "upper");
spineSummary(Flat)
SPINE 300 objects, 1 stratum measure dist2median | orientation upper stratum objects measure range score 1 300 0.5293 to 3.834 0.000 No cut. This measure does not separate these objects into scales, which is a property of the measure, not a failure of the partition.

Notes appear when they matter

Omitted objects, dropped columns, thinning, a measure used against its conventional orientation: each adds a line, and none appears otherwise.
Xm = X; Xm(4,2) = NaN; Xm(100,1) = NaN;
Xm = [Xm, ones(size(Xm,1),1)]; % a column with no spread
[~, Noted] = spine(Xm, 'zrownorm', "upper", 'Missing', "omit");
spineSummary(Noted)
SPINE 300 objects, 2 strata measure zrownorm | orientation upper stratum objects measure range score 1 283 0.7488 to 1.847 0.000 2 15 11.34 to 11.67 1.000 cut at 1.847 Result.boundaryValues applies these cuts to new data. note: 1 column dropped for having no spread: 9 note: 2 objects omitted for missing values; their scores are NaN

Returning the text

With an output argument it returns the text and prints nothing, so it composes into a figure title, a log, or a methods paragraph.
txt = spineSummary(Result);
fprintf('%d characters returned, nothing printed\n', strlength(txt));
374 characters returned, nothing printed

See also

spine to produce a Result, spineCompare to compare several measures, and spineDataPlot to see the partition rather than read it.
close all