{
  "slug": "pca-visualizer",
  "name": "gizza-ai/pca-visualizer",
  "version": "0.1.0",
  "title": "PCA & t-SNE Visualizer — 2D Scatter Plot from CSV — gizza.ai",
  "description": "Paste a numeric table, reduce it to 2D with PCA or deterministic t-SNE, and get an SVG scatter plot colored by label, plus CSV/JSON coordinates.",
  "tags": [
    "pca visualizer",
    "tsne visualizer",
    "dimensionality reduction",
    "scatter plot",
    "csv pca",
    "2d projection",
    "cluster visualization",
    "svg scatter plot",
    "principal component analysis",
    "data visualization"
  ],
  "category": "data",
  "urls": {
    "page": "https://gizza.ai/tools/pca-visualizer/",
    "markdown": "https://gizza.ai/tools/pca-visualizer/index.md",
    "descriptor": "https://gizza.ai/tools/pca-visualizer/tool.json",
    "deep_link_example": "https://gizza.ai/tools/pca-visualizer/?data=sepal_len%2Csepal_wid%2Cpetal_len%2Cpetal_wid%2Cspecies%0A5.1%2C3.5%2C1.4%2C0.2%2Csetosa%0A4.9%2C3.0%2C1.4%2C0.2%2Csetosa%0A6.4%2C3.2%2C4.5%2C1.5%2Cversicolor%0A6.9%2C3.1%2C4.9%2C1.5%2Cversicolor%0A6.5%2C3.0%2C5.8%2C2.2%2Cvirginica%0A7.6%2C3.0%2C6.6%2C2.1%2Cvirginica&method=pca&label_column=species&scale=true&perplexity=30&iterations=500&learning_rate=200&show_labels=true&point_size=4&title=Iris%20measurements%20%E2%80%94%20PCA&width=720&height=520&format=svg"
  },
  "cli": "gizza tool pca-visualizer \"sepal_len,sepal_wid,petal_len,petal_wid,species\n5.1,3.5,1.4,0.2,setosa\n4.9,3.0,1.4,0.2,setosa\n6.4,3.2,4.5,1.5,versicolor\n6.9,3.1,4.9,1.5,versicolor\n6.5,3.0,5.8,2.2,virginica\n7.6,3.0,6.6,2.1,virginica\"",
  "tool": {
    "description": "Reduce a wide numeric table to two dimensions and draw it. Paste the table as `data` — one observation per row, one variable per column, commas/tabs/semicolons/pipes/spaces all work, and a header row is detected automatically. method='pca' (default) runs a deterministic Jacobi eigen-decomposition and labels each axis with the share of variance it explains; method='tsne' runs a PCA-seeded t-distributed stochastic neighbor embedding, tuned with perplexity, iterations and learning_rate. One non-numeric column is used as the class label: it colours the points and builds the legend, auto-detected or named through label_column (header name or 1-based index). scale standardizes the variables first (default true, correlation PCA); set false for covariance PCA. Tune the picture with show_labels, point_size, title, width and height. format='svg' (default) returns a standalone scatter plot, 'csv' returns index,label,pc1,pc2 coordinate rows, and 'json' returns the whole projection including explained variance. Fully deterministic — no RNG — so the same table always yields byte-identical output. Limits: 5000 rows and 100 numeric variables for PCA, 1000 rows for t-SNE.",
    "parameters": {
      "additionalProperties": false,
      "properties": {
        "data": {
          "description": "The table to project: one observation per row, one variable per column, separated by commas, tabs, semicolons, pipes or spaces. A header row is detected automatically. One non-numeric column may hold the class label. Limits: 5000 rows and 100 numeric columns (1000 rows for t-SNE), minimum 3 rows and 2 numeric columns.",
          "type": "string"
        },
        "format": {
          "default": "svg",
          "description": "Output format: svg (default) is a standalone scatter plot with axes, legend and grid; csv returns index,label,pc1,pc2 (tsne1,tsne2 for t-SNE) coordinate rows for another chart tool; json returns the full projection — coordinates, categories, variable names and the explained variance per axis.",
          "enum": [
            "svg",
            "csv",
            "json"
          ],
          "type": "string"
        },
        "height": {
          "default": 520,
          "description": "SVG height in pixels, 200 to 2000. Default 520. Ignored when format=csv or json.",
          "maximum": 2000,
          "minimum": 200,
          "type": "integer"
        },
        "iterations": {
          "default": 500,
          "description": "t-SNE only: gradient-descent iterations, 50 to 2000. Default 500. More iterations settle the layout further at a linear cost in time; the first quarter runs with early exaggeration to separate clusters. Ignored when method=pca.",
          "maximum": 2000,
          "minimum": 50,
          "type": "integer"
        },
        "label_column": {
          "description": "Header name or 1-based column index of the column holding each row's class/group label, e.g. \"species\" or \"5\". It is dropped from the maths and used to colour the points and build the legend. Empty (the default) auto-detects the single non-numeric column, if the table has exactly one.",
          "type": "string"
        },
        "learning_rate": {
          "default": 200,
          "description": "t-SNE only: gradient-descent step size, 1 to 1000. Default 200. Too low leaves the points in a dense ball, too high scatters them into a uniform cloud. Ignored when method=pca.",
          "maximum": 1000,
          "minimum": 1,
          "type": "number"
        },
        "method": {
          "default": "pca",
          "description": "Which 2-D projection to compute: pca (default) is linear and keeps global structure, with each axis labelled by the share of variance it explains; tsne is non-linear and pulls local neighbourhoods apart into visible clusters. Both are deterministic — t-SNE is seeded from the PCA scores, so the same table always gives the same picture.",
          "enum": [
            "pca",
            "tsne"
          ],
          "type": "string"
        },
        "perplexity": {
          "default": 30,
          "description": "t-SNE only: roughly how many neighbours each point tries to keep close, 1 to 100. Default 30. Lower values expose small tight clusters, higher values favour the broad shape. Automatically clamped to (rows - 1) / 3 on small tables. Ignored when method=pca.",
          "maximum": 100,
          "minimum": 1,
          "type": "number"
        },
        "point_size": {
          "default": 4,
          "description": "Marker radius in pixels, 1 to 20. Default 4. Drop to 2 for a few hundred crowded points, raise to 6-8 for a small table or a chart that will be viewed from a distance.",
          "maximum": 20,
          "minimum": 1,
          "type": "number"
        },
        "scale": {
          "default": true,
          "description": "Standardize every numeric column to unit variance before projecting (correlation-matrix PCA). Default true, which is what you want when the variables are in different units. Set false to keep the raw units so high-variance columns dominate (covariance-matrix PCA).",
          "type": "boolean"
        },
        "show_labels": {
          "default": false,
          "description": "Draw each point's label text next to its marker, on top of the colour coding. Default false. Only usable up to 200 points, above which the text is unreadable and the tool refuses it.",
          "type": "boolean"
        },
        "title": {
          "description": "Optional chart title drawn across the top of the SVG, e.g. \"Iris measurements — PCA\". Empty (the default) leaves the plot area untitled and reclaims the space.",
          "type": "string"
        },
        "width": {
          "default": 720,
          "description": "SVG width in pixels, 300 to 2000. Default 720. The legend takes a fixed strip on the right, so widen the chart when the label names are long. Ignored when format=csv or json.",
          "maximum": 2000,
          "minimum": 300,
          "type": "integer"
        }
      },
      "required": [
        "data"
      ],
      "type": "object"
    }
  }
}