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:Optional: Packaging Your Models
If you want to share your custom models, you can package them:- Create a
setup.py:
- Install your package:
Implementation Guide
Class Structure
Your adjustment method class needs three core methods:Return Format
Theadjust 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

