CounterFact CounterFact Lab

Integration

Integrate CounterFact OPE into your workflow

How to Use CounterFact

Choose the integration method that works best for your needs

Web Interface

Use our web interface for interactive OPE evaluation and analysis

  • Upload data through browser
  • Interactive configuration
  • Visual results and diagnostics
  • No coding required
Try Web Interface

REST API

Programmatic access for integration into your workflows

  • JSON-based API (v3)
  • Single and multi-policy evaluation
  • CI/CD integration ready
  • Advanced features available
Learn More

Command Line

Run evaluations from the command line for automation and scripting

  • CLI tools for automation
  • Batch processing scripts
  • CI/CD integration
  • Server deployment
python -m ope.cli.evaluate \
  --logs data/logs.parquet \
  --candidates data/predictions.csv \
  --mode auto

REST API (Advanced)

Programmatic access available for integration into your workflows

CounterFact provides a REST API (v3) for programmatic evaluation. The API supports single policy evaluation, multi-policy leaderboards, and advanced features like propensity estimation and stress testing.

Key endpoints:

  • GET /api/v3/health - Check API health and feature availability
  • POST /api/v3/evaluate - Run OPE evaluation
  • POST /api/v3/pairwise-diff - Compare two policies from a leaderboard

For detailed API documentation, request examples, and integration guides, please contact us.

Data Requirements

Format your data correctly for optimal results

Historical Logs

Your existing user interaction data

Required columns:

  • user_id - Unique user identifier
  • item_id - Item that was shown
  • reward - Observed reward (click, purchase, etc.)

Optional columns:

  • propensity - Logging policy probability (required for Launch3.0 PC badge)
  • position - Position in recommendation slate

Candidate Predictions

Your new algorithm's recommendations

Required columns:

  • user_id - User identifier (must match logs)
  • item_id - Recommended item
  • score - Recommendation score

Optional columns:

  • propensity - Candidate policy probability (for Launch3.0 features)
  • timestamp - Timestamp for temporal ordering (for stress tests)

Getting Started

Start evaluating your recommendation policies in minutes

1

Prepare Your Data

Format your historical logs and candidate predictions. See data requirements below.

2

Use the Web Interface

Upload your files, configure settings, and run evaluations interactively.

3

Review Results

Analyze evaluation results, diagnostics, and make informed decisions.

Get Started with Web Interface

Need Help?

Get support and learn more about CounterFact OPE

Documentation

Comprehensive guides and technical reference

View Guide →

Contact

Get help from our team

Contact Us →