{
  "name": "scikit-learn sklearn.impute classes compared",
  "description": "Original comparison of the four tools in sklearn.impute (SimpleImputer, KNNImputer, IterativeImputer, MissingIndicator), compiled from the scikit-learn user guide section 6.4 and the SimpleImputer API page: whether each uses other columns, whether it fills values, and the documented key settings.",
  "page": "https://casrai.org/guides/sklearn-impute",
  "publisher": "CASRAI",
  "license": "https://creativecommons.org/licenses/by/4.0/",
  "dateModified": "2026-11-23T09:05:00Z",
  "temporalCoverage": null,
  "spatialCoverage": null,
  "columns": [
    {
      "name": "Class",
      "unit": "",
      "description": ""
    },
    {
      "name": "Uses other columns",
      "unit": "",
      "description": ""
    },
    {
      "name": "Fills missing values",
      "unit": "",
      "description": ""
    },
    {
      "name": "Key settings in the documentation",
      "unit": "",
      "description": ""
    },
    {
      "name": "Documented caveat",
      "unit": "",
      "description": ""
    }
  ],
  "rows": [
    {
      "Class": "SimpleImputer",
      "Uses other columns": "No (per-column statistic)",
      "Fills missing values": "Yes",
      "Key settings in the documentation": "strategy: mean, median, most_frequent, constant; add_indicator; keep_empty_features",
      "Documented caveat": "most_frequent and constant also work on strings and categorical data; all-missing columns dropped unless strategy is constant or keep_empty_features=True"
    },
    {
      "Class": "KNNImputer",
      "Uses other columns": "Yes (nearest samples)",
      "Fills missing values": "Yes",
      "Key settings in the documentation": "n_neighbors; weights: uniform or distance; metric nan_euclidean",
      "Documented caveat": "Sensitive to feature scale; uses the training mean if no neighbour has a valid value"
    },
    {
      "Class": "IterativeImputer",
      "Uses other columns": "Yes (round-robin regression)",
      "Fills missing values": "Yes",
      "Key settings in the documentation": "max_iter; random_state; sample_posterior; estimator",
      "Documented caveat": "Experimental: needs enable_iterative_imputer; very different scales can hurt it"
    },
    {
      "Class": "MissingIndicator",
      "Uses other columns": "Not applicable",
      "Fills missing values": "No (flags only)",
      "Key settings in the documentation": "features: missing-only (default) or all",
      "Documented caveat": "Used alone or via add_indicator; features_ lists indexed columns"
    }
  ],
  "sources": [
    {
      "title": "scikit-learn: 6.4. Imputation of missing values",
      "url": "https://scikit-learn.org/stable/modules/impute.html",
      "accessed": "2026-11-17"
    },
    {
      "title": "scikit-learn: SimpleImputer",
      "url": "https://scikit-learn.org/stable/modules/generated/sklearn.impute.SimpleImputer.html",
      "accessed": "2026-11-17"
    },
    {
      "title": "scikit-learn: Imputing missing values before building an estimator",
      "url": "https://scikit-learn.org/stable/auto_examples/impute/plot_missing_values.html",
      "accessed": "2026-11-17"
    }
  ]
}