{
  "schema_version": 1,
  "title": "Fictional Chapter 11 eight-point unsupervised-learning case",
  "fictional": true,
  "provenance": "Eight designed points fixed in tools/ch11-generate-case.py; not measurements of people or a natural population.",
  "n_points": 8,
  "distance": "Euclidean distance on the named feature space; k-means objective is within-cluster sum of squared Euclidean distances (SSE).",
  "kmeans_initialization_comparison": {
    "same_data_and_k": 2,
    "left_right_initialization": {
      "initial_point_ids": [
        "P01",
        "P05"
      ],
      "trace": [
        {
          "stage": "initial_centroids",
          "centroids": [
            [
              -5.0,
              -1.0,
              -1.0
            ],
            [
              3.0,
              -1.0,
              -1.0
            ]
          ]
        },
        {
          "stage": "iteration_1",
          "clusters": [
            [
              "P01",
              "P02",
              "P03",
              "P04"
            ],
            [
              "P05",
              "P06",
              "P07",
              "P08"
            ]
          ],
          "centroids": [
            [
              -4.0,
              0.0,
              0.0
            ],
            [
              4.0,
              0.0,
              0.0
            ]
          ],
          "objective_sse": 24.0
        },
        {
          "stage": "iteration_2",
          "clusters": [
            [
              "P01",
              "P02",
              "P03",
              "P04"
            ],
            [
              "P05",
              "P06",
              "P07",
              "P08"
            ]
          ],
          "centroids": [
            [
              -4.0,
              0.0,
              0.0
            ],
            [
              4.0,
              0.0,
              0.0
            ]
          ],
          "objective_sse": 24.0
        }
      ],
      "final": {
        "stage": "iteration_2",
        "clusters": [
          [
            "P01",
            "P02",
            "P03",
            "P04"
          ],
          [
            "P05",
            "P06",
            "P07",
            "P08"
          ]
        ],
        "centroids": [
          [
            -4.0,
            0.0,
            0.0
          ],
          [
            4.0,
            0.0,
            0.0
          ]
        ],
        "objective_sse": 24.0
      }
    },
    "upper_lower_initialization": {
      "initial_point_ids": [
        "P01",
        "P02"
      ],
      "trace": [
        {
          "stage": "initial_centroids",
          "centroids": [
            [
              -5.0,
              -1.0,
              -1.0
            ],
            [
              -5.0,
              1.0,
              1.0
            ]
          ]
        },
        {
          "stage": "iteration_1",
          "clusters": [
            [
              "P01",
              "P03",
              "P05",
              "P07"
            ],
            [
              "P02",
              "P04",
              "P06",
              "P08"
            ]
          ],
          "centroids": [
            [
              0.0,
              -1.0,
              -1.0
            ],
            [
              0.0,
              1.0,
              1.0
            ]
          ],
          "objective_sse": 136.0
        },
        {
          "stage": "iteration_2",
          "clusters": [
            [
              "P01",
              "P03",
              "P05",
              "P07"
            ],
            [
              "P02",
              "P04",
              "P06",
              "P08"
            ]
          ],
          "centroids": [
            [
              0.0,
              -1.0,
              -1.0
            ],
            [
              0.0,
              1.0,
              1.0
            ]
          ],
          "objective_sse": 136.0
        }
      ],
      "final": {
        "stage": "iteration_2",
        "clusters": [
          [
            "P01",
            "P03",
            "P05",
            "P07"
          ],
          [
            "P02",
            "P04",
            "P06",
            "P08"
          ]
        ],
        "centroids": [
          [
            0.0,
            -1.0,
            -1.0
          ],
          [
            0.0,
            1.0,
            1.0
          ]
        ],
        "objective_sse": 136.0
      }
    },
    "lesson": "Lloyd's algorithm reaches different local solutions from different initial centroids; initialization is part of the method specification."
  },
  "scale_sensitivity": {
    "raw_population_variances": {
      "feature_x": 17.0,
      "feature_y": 1.0,
      "feature_z": 1.0
    },
    "standardization": "Subtract zero means and divide each feature by its population standard deviation; no labels are used.",
    "raw_sse": {
      "left_right_partition": 24.0,
      "upper_lower_partition": 136.0
    },
    "standardized_sse": {
      "left_right_partition": 16.470588,
      "upper_lower_partition": 8.0
    },
    "lesson": "Changing units/scale reverses which of these two partitions has lower SSE."
  },
  "k_sensitivity": {
    "strategy": "Compare predeclared k values on the same raw features; SSE cannot increase as k grows, so inspect both fit and the substantive usefulness/stability of groups.",
    "candidate_partition_sse": [
      {
        "k": 1,
        "sse": 152.0
      },
      {
        "k": 2,
        "sse": 24.0
      },
      {
        "k": 3,
        "sse": 16.0
      },
      {
        "k": 4,
        "sse": 8.0
      }
    ]
  },
  "pca": {
    "centering": "All three feature means are zero; covariance divides by n=8 (population convention for this designed finite teaching set).",
    "covariance_matrix": [
      [
        17.0,
        0.0,
        0.0
      ],
      [
        0.0,
        1.0,
        1.0
      ],
      [
        0.0,
        1.0,
        1.0
      ]
    ],
    "eigenvalues_descending": [
      17.0,
      2.0,
      0.0
    ],
    "explained_variance_ratio": [
      0.894737,
      0.105263,
      0.0
    ],
    "component_vectors": [
      [
        1.0,
        0.0,
        0.0
      ],
      [
        0.0,
        0.707107,
        0.707107
      ],
      [
        0.0,
        0.707107,
        -0.707107
      ]
    ],
    "projections": [
      {
        "point_id": "P01",
        "pc1": -5,
        "pc2": -1.414214,
        "pc3": 0.0
      },
      {
        "point_id": "P02",
        "pc1": -5,
        "pc2": 1.414214,
        "pc3": 0.0
      },
      {
        "point_id": "P03",
        "pc1": -3,
        "pc2": -1.414214,
        "pc3": 0.0
      },
      {
        "point_id": "P04",
        "pc1": -3,
        "pc2": 1.414214,
        "pc3": 0.0
      },
      {
        "point_id": "P05",
        "pc1": 3,
        "pc2": -1.414214,
        "pc3": 0.0
      },
      {
        "point_id": "P06",
        "pc1": 3,
        "pc2": 1.414214,
        "pc3": 0.0
      },
      {
        "point_id": "P07",
        "pc1": 5,
        "pc2": -1.414214,
        "pc3": 0.0
      },
      {
        "point_id": "P08",
        "pc1": 5,
        "pc2": 1.414214,
        "pc3": 0.0
      }
    ],
    "sign_note": "An eigenvector and its negation are equivalent; the fixed signs above make the artifact reproducible."
  },
  "silhouette": {
    "strategy": "For each point, a is mean Euclidean distance to other points in its cluster and b is the smallest mean distance to another cluster; s=(b-a)/max(a,b). A singleton is assigned 0. Report the point values and unweighted mean; do not treat the score alone as proof of natural categories.",
    "left_right_partition": {
      "point_values": {
        "P01": 0.700178,
        "P02": 0.700178,
        "P03": 0.620286,
        "P04": 0.620286,
        "P05": 0.620286,
        "P06": 0.620286,
        "P07": 0.700178,
        "P08": 0.700178
      },
      "mean": 0.660232
    },
    "upper_lower_partition": {
      "point_values": {
        "P01": -0.056121,
        "P02": -0.056121,
        "P03": 0.00363,
        "P04": 0.00363,
        "P05": 0.00363,
        "P06": 0.00363,
        "P07": -0.056121,
        "P08": -0.056121
      },
      "mean": -0.026245
    }
  },
  "rounding": "Computed numeric outputs are rounded to 6 decimal places; CSV contains the exact integer teaching coordinates."
}
