Skip to main content
You can leverage the TACT infrastructure to create custom adjustment models by extending the base AdjustmentMethod class. This guide will show you how to create and register your own model.

Overview

A valid adjustment method must:
  • Define required input parameters
  • Specify required data columns
  • Implement the adjustment logic
  • Register with TACT’s registry system

Creating Your Custom Model Package

The recommended way to create custom models is to keep them in your own project, separate from the TACT installation. Here’s a typical project structure:

Creating a Custom Model

Here’s an example of creating a simple custom adjustment model:

Using Your Custom Model

To use your custom model, simply import and register it before using TACT:
The registration system will automatically make your method available to TACT when it’s imported. You don’t need to modify the TACT package itself.

Optional: Packaging Your Models

If you want to share your custom models, you can package them:
  1. Create a setup.py:
  1. Install your package:

Implementation Guide

Class Structure

Your adjustment method class needs three core methods:

Return Format

The adjust method should return a dictionary with:

Troubleshooting

Method Registration

If your method isn’t available:

Data Validation

Common data issues and solutions:

Performance Issues

If your method is slow:
  • Use pandas vectorized operations
  • Pre-compute repeated values
  • Consider data preprocessing
  • Profile your code with cProfile
For more examples, see the SSSF and Baseline implementations.