OpenViSTAI · Agents · Blockchain · Crypto
Menu
AI Data & Analytics

Apricot

Apricot is an open-source Python library that applies submodular optimization to summarize large datasets as minimally redundant, representative subsets. The selected examples can support machine-learning training with fewer data points or visualization of dataset structure.

Independent OpenViST project profile, based on linked sources.

Apricot — Reducing the number of examples used in machine-learning experiments
OpenViST project illustration. See the linked sources for product details.
Understand the project

Practical overview

When it fits

Use Apricot during dataset preparation when a smaller representative sample could support model training or visualization. Consider the memory implications before choosing similarity-based facility-location selection on very large datasets.

Who it is for

  • Machine-learning practitioners preparing training data from large datasets.
  • Researchers and data teams creating representative summaries for visualization or experiments.

Documented uses

  • Select a smaller set of examples before model training.
  • Summarize dataset diversity for visualization.
  • Choose subsets using built-in submodular functions and optimization strategies.
Before you choose

Requirements & limits

The public GitHub repository lists an MIT license. Its README documents installation from PyPI with `pip install apricot-select`.

  • Apricot offers multiple built-in submodular functions, including feature-based, facility location, graph cut, maximum coverage and sum redundancy.
  • Several optimizer choices are available, including lazy greedy, stochastic greedy and two-stage greedy.
  • Facility location can select examples representing underrepresented parts of the data, but its full similarity matrix has quadratic memory requirements.
  • The selectors provide fit, transform and fit_transform methods in a scikit-learn-style interface.

Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.

Source-based practical guide

Select a subset with facility location

Reduce a dataset to a specified number of representative examples using the documented facility-location workflow.

Before you start

  • Python environment with apricot-select installed from PyPI.
  • A dataset available as an input array; the example uses NumPy.

Steps

  1. Install the library with the command below.

    Documented command
    pip install apricot-select
  2. Import NumPy and FacilityLocationSelection.

  3. Pass the dataset to FacilityLocationSelection with the desired subset size, metric and optimizer, then call fit_transform to select and return the subset.

Expected outcome

A reduced dataset containing the requested number of selected examples; the README example selects 100 from 5,000 using Euclidean distance and the lazy optimizer.

Guide limitations

  • Facility-location selection uses pairwise similarities; storing the full similarity matrix requires quadratic memory with the number of examples and may be impractical for large datasets.
Evidence and transparency

Sources & review

Source record details
Source availability
Active
Sources checked
11 November 2026
Original website title
jmschrei/apricot · Official homepage title · retained in its source language