OpenViSTAI · Agents · Blockchain · Crypto
Menu
AI Developer Tools & SDKs

Pecos

Pecos is a modular, open-source Python machine-learning framework for training and inference on large-output-space problems, including extreme multi-label ranking and large-scale retrieval. It provides X-Linear and XR-Transformer approaches for multi-label prediction, plus an HNSW approximate-nearest-neighbor module.

Independent OpenViST project profile, based on linked sources.

Pecos — OpenViST project profile in AI Developer Tools & SDKs.
OpenViST project illustration. See the linked sources for product details.
Understand the project

Practical overview

When it fits

Use Pecos when building a custom learning or retrieval pipeline where the number of possible outputs is very large and a ranked subset of relevant results is needed.

Who it is for

  • Machine-learning developers working with very large label or output sets.
  • Teams building ranking, classification or retrieval workflows that need to return a small set of relevant results from a large candidate pool.

Documented uses

  • Train an extreme multi-label ranking model using features, labels and a hierarchical label structure.
  • Generate and rank relevant labels for input instances.
  • Evaluate predictions with precision and recall metrics.
  • Use approximate nearest-neighbor search with sparse or dense features.
Before you choose

Requirements & limits

Pecos is open source under the Apache-2.0 license. The README documents installation with Python and pip and lists Ubuntu 20.04/22.04 and Amazon Linux 2 as supporting platforms.

  • The documented XMR example requires feature and label matrices in SciPy CSR format.
  • The project offers distinct approaches: recursive linear models, transformer-based multi-label learning and HNSW approximate-nearest-neighbor search.
  • The stated Python versions are 3.9–3.12, with pip 19.3 or later; setup.py contains additional dependencies.
  • The documented platform list is Ubuntu 20.04/22.04 and Amazon Linux 2.

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

Install Pecos from a wheel

Install the libpecos package in a Python environment.

Before you start

  • Python 3.9, 3.10, 3.11 or 3.12
  • pip 19.3 or later
  • A virtual environment is recommended by the project documentation

Steps

  1. Create and activate a Python virtual environment.

  2. Run the command below.

    Documented command
    python3 -m pip install libpecos

Expected outcome

The README documents the pip command for installing Pecos from a wheel.

Guide limitations

  • The README lists Ubuntu 20.04 and 22.04 and Amazon Linux 2 as supporting platforms.
  • Additional dependencies are listed in the repository's setup.py.
Source-based practical guide

Train and predict with the X-Linear example

Build a hierarchical label structure, train an X-Linear model, and use it for prediction and evaluation.

Before you start

  • Pecos installed in a Python environment
  • Feature matrix X and label matrix Y in SciPy CSR format
  • Evaluation inputs Xt and Yt for the documented prediction and metric example

Steps

  1. Create label features from Y and X with LabelEmbeddingFactory.

  2. Generate a cluster chain with Indexer.gen.

  3. Train an XLinearModel using X, Y and the cluster chain, then save the model.

  4. Predict on Xt and generate metrics with smat_util.Metrics.generate.

Expected outcome

The example produces model predictions and calculates precision and recall at k=10.

Guide limitations

  • The README presents this as a toy XMR example; it does not define a complete data-preparation workflow.
Evidence and transparency

Sources & review

Source record details
Source availability
Active
Sources checked
14 October 2026
Original website title
amzn/pecos · Official homepage title · retained in its source language