Renumics Spotlight

repository·main·Indexed 22 days ago

https://github.com/renumics/spotlight

A tool for the interactive exploration of unstructured datasets (images, audio, text, video, etc.) directly from dataframes. It enables machine learning teams to identify data issues, visualize embeddings, and understand complex data distributions using UI components such as Similarity Maps, Scatter Plots, Histograms, and an Inspector.

Tokens
50K
Snippets
132
Records
227
Agent score
78%

What's inside renumics-spotlight

  1. Overview of Spotlight UI components

    main

    Spotlight provides several specialized components for different stages of data analysis:

    Individual Data Point Analysis

    • Data Table: The primary view for inspecting data. It supports displaying specific columns and allows for editing datapoints, including creating new columns.
    • Inspector: Provides in-depth views for individual data points, supporting various types such as images, audio, and 3D meshes.

    Global Data Distribution Analysis

    • Similarity Map: Maps vectors to a scatter plot using dimensionality reduction (UMAP or PCA). It supports metadata/embedding normalization and allows customizing dot color and size.
    • Scatter Plot: Used to determine correlations between metadata information. Dot size and color can be customized.
    • Histogram: Provides insights into data segments. Histograms can be stacked to view distributions across two different dimensions.

    Data Selection

    • Filter Bar: A special component used to filter data based on feature values. Filtering and selecting datapoints in the Filter Bar affects how data is presented in all other components.
  2. Explore the MNIST (tiny) sample dataset

    main

    The MNIST (tiny) dataset is a small subset of the original MNIST handwritten digit database, provided as sample data for testing or demonstration purposes. It contains 30 samples and consists of two main components:

    1. Individual Images: PNG files named 0.png through 29.png, each representing a 28×28 handwritten digit.
    2. Metadata Table: A file named mnist-tiny.csv that maps each image to its corresponding label and a pre-generated embedding vector.
  3. Explore Spotlight use cases for unstructured data

    main

    Spotlight supports various workflows for analyzing and visualizing unstructured data across different domains. You can find specialized guides for the following use cases:

    • Audio: Workflows for audio classification.
    • Computer Vision: Workflows for image classification.
    • NLP (Natural Language Processing): Workflows for text classification.
    • Multimodal: Complex workflows combining different data types, such as motorsports telemetry.
  4. Explore the `renumics.spotlight` Python API

    main

    The renumics.spotlight Python package provides the core interface for interacting with Spotlight. The API is organized into several key modules:

    • renumics.spotlight.dataset: Handles the Spotlight HDF5 dataset.
    • renumics.spotlight.dtypes: Manages the Spotlight type system.
    • renumics.spotlight.layout: Controls build inspection layouts.
  5. Explore Data Curation Playbooks

    main

    The Spotlight Playbook provides a collection of curated workflows (called plays) for managing unstructured data. These workflows are categorized by complexity and technique:

    • Rookie plays: Basic data enrichment workflows, such as creating embeddings using Huggingface or Towhee, and extracting decision boundaries.
    • Veteran plays: Established data curation solutions, including duplicate detection with Annoy, leakage detection, data drift detection, and error detection (label errors, outliers, or image error patterns) using tools like Cleanlab.
    • All-star plays: State-of-the-art techniques, such as finding data slices using Sliceguard.
  6. Use the Histogram component to visualize data distributions

    main

    The Histogram component in Spotlight visualizes the distribution of data across a continuous range of values by grouping data into bins. It is useful for identifying patterns, outliers, and characteristics in numerical or categorical datasets.

    It supports two modes:

    1. Single Column (Default): Visualizes the distribution of a single variable.
    2. Stacked Histogram: By specifying a column to stackBy, the distribution of values for that column is plotted within each bin.
  7. Available UI components in Spotlight

    main

    Spotlight provides several components to offer different perspectives on your data:

    Individual Datapoint Analysis

    • Inspector: Used for analyzing and understanding individual datapoints.
    • Data Table: Used for analyzing and understanding individual datapoints.

    Data Distribution Analysis

    • Similarity Map: Helps understand the overall distribution of your data.
    • Scatter Plot: Helps understand the overall distribution of your data.
    • Histogram: Helps understand the overall distribution of your data.

    Data Filtering

    • Filter Bar: A special component that allows you to filter your data based on the values of your features. Filtering and selecting datapoints via the Filter Bar can affect how data is presented in other components, aiding in reasoning about your data.
  8. Use the Inspector Widget to examine and edit data points

    main

    The Inspector Widget is a Spotlight component used to examine and edit the features of individual data points in a dataset. It provides specialized views for different modalities, allowing for deep exploration of a data point's underlying structure and direct editing of features within the view.

    Key Capabilities:

    • Multimodal Exploration: Specialized views for text, audio, video, images, 3D geometry, and more.
    • Direct Editing: Modify data point features directly within the Inspector view.
    • Configuration: You can customize how each datapoint is represented using configuration options available in the upper right corner of the view.

    Note on Versions:

    • Open Source version: Allows for inspecting data to find critical segments.
    • Pro version: Enables additional data tagging and annotation capabilities.
  9. Create and manage Spotlight layouts

    main

    Spotlight layouts, which define how data is inspected and visualized, can be managed in two ways:

    1. Through the UI: Users can interactively create, save, and load layouts directly within the Spotlight interface.
    2. Through the Python API: Developers can programmatically define layouts using the layout class for reproducible data inspection workflows.

    For detailed programmatic configuration, refer to the layout class API documentation.

  10. Understand column importance in the Data Table

    main

    Spotlight calculates a column importance indicator to help identify relevant rows based on a group of selected rows.

    How it works: The importance is calculated by comparing the value distribution of all selected rows against the value distribution of all filtered rows.

    Usage: You can order columns by their calculated relevance within the settings menu.

  11. Detect decision boundaries using certainty ratios

    main

    Decision boundary detection involves computing a score based on class probability vectors.

    Inputs:

    • df['probabilities']: A column containing the class probability vector inferred by the model.

    Outputs:

    • df['decision_boundary_score']: A score between 0 and 1 indicating proximity to the decision boundary. A value of 1 means the sample is on the boundary, while 0 means it is far away.
    • df['decision_boundary_alternate_label']: The label of the second most likely class.

    Note for Colab users: Use Chrome to run Spotlight in Colab. Due to Colab restrictions (e.g. no websocket support), performance is limited. For the full experience, run the notebook locally.