|
@@ -158,6 +158,8 @@ const metrics = [
|
|
|
},
|
|
|
// hue angle
|
|
|
(stats, q) => angleDiff(selectedSummary(stats, q)[0].hue, q.hue),
|
|
|
+ // max inertia
|
|
|
+ (stats) => -stats.inertia,
|
|
|
// custom
|
|
|
(stats, q) => (state.includeX ? stats.inertia : 0) - state.closeCoeff * vectorDot(
|
|
|
selectedSummary(stats, q)[0][state.normQY ? "unit" : "vector"],
|
|
@@ -215,9 +217,10 @@ const mathDefinitions = {
|
|
|
|
|
|
const metricText = [
|
|
|
muArg => String.raw`${mathArgBest("min", "P")}\left[I\left(P\right) - 2\vec{q}\cdot \vec{\mu}\left(${muArg}\right)\right]`,
|
|
|
- muArg => String.raw`${mathArgBest("max", "P")}\left[\cos\left(\angle \left(\vec{q}, \vec{\mu}\left(${muArg}\right)\right)\right)\right]`,
|
|
|
+ muArg => String.raw`${mathArgBest("min", "P")}\left[-\cos\left(\angle \left(\vec{q}, \vec{\mu}\left(${muArg}\right)\right)\right)\right]`,
|
|
|
muArg => String.raw`${mathArgBest("min", "P")}\left[${state.meanArgument > 0 && state.includeScaleInDist ? String.raw`\frac{\left|P\right|}{\left|${muArg}\right|}` : ""} \left|\left| \vec{q} - \vec{\mu}\left(${muArg}\right) \right|\right|^2\right]`,
|
|
|
muArg => String.raw`${mathArgBest("min", "P")}\left[\angle \left(\vec{q}_{\perp}, \vec{\mu}\left(${muArg}\right)_{\perp} \right)\right]`,
|
|
|
+ muArg => String.raw`${mathArgBest("min", "P")}\left[-I\left(P\right)\right]`,
|
|
|
].map(s => muArg => TeXZilla.toMathML(s(muArg)));
|
|
|
|
|
|
const muArgs = [
|
|
@@ -240,12 +243,12 @@ const updateObjective = () => {
|
|
|
} else {
|
|
|
const qyMod = normQY ? renderNorm : c => c;
|
|
|
tex = TeXZilla.toMathML(String.raw`
|
|
|
- ${mathArgBest(includeX ? "min" : "max", "P")}
|
|
|
+ ${mathArgBest("min", "P")}
|
|
|
\left[
|
|
|
${includeX ? String.raw`I\left(P\right)` : ""}
|
|
|
${closeCoeff === 0 ? "" : String.raw`
|
|
|
- ${includeX ? "-" : ""}
|
|
|
- ${(includeX && closeCoeff !== 1) ? closeCoeff : ""}
|
|
|
+ -
|
|
|
+ ${closeCoeff}
|
|
|
${qyMod("\\vec{q}")}
|
|
|
\cdot
|
|
|
${qyMod(String.raw`\vec{\mu}\left(${muArg}\right)`)}
|
|
@@ -521,7 +524,7 @@ const onMetricChanged = skipScore => {
|
|
|
state.metric = metric;
|
|
|
checkClusterMeanWarning();
|
|
|
checkScaleByClusterToggle();
|
|
|
- if (state.metric === 4) { // Custom
|
|
|
+ if (state.metric === 5) { // Custom
|
|
|
showCustomControls();
|
|
|
onCustomControlsChanged(skipScore); // triggers rescore
|
|
|
} else {
|