Why I started CodAdapt
I've been interested in experimenting with alternative approaches to machine learning, especially for tabular data.
That's what led me to start CodAdapt, a personal research and experimentation project built around a different learning architecture.
The goal wasn't to recreate XGBoost, Random Forest, or other established algorithms. I wanted to explore whether a model based on adaptive coded memory and shared multi-resolution encoding could offer an interesting balance between predictive quality, computational efficiency, memory usage, and ease of use.
I also wanted the library to feel familiar to Python developers, with an API similar to scikit-learn.
The idea behind CodAdapt
CodAdapt takes a different approach from traditional tree-based models and neural networks.
Instead of learning a collection of decision trees or layers of neural network weights, it encodes numerical and categorical features and learns residual contributions through lookup memories.
The architecture uses multiple encoding levels, allowing the model to work with different levels of detail while keeping the lookup budget bounded.
The library supports binary and multiclass classification, single-target regression, numerical and categorical features, and missing values.
One thing I wanted to preserve throughout development was a simple interface, regardless of the underlying algorithm.
Using CodAdapt in Python
CodAdapt is available on PyPI:
pip install codadapt
Here's a small classification example using scikit-learn's Breast Cancer dataset:
from sklearn.datasets import load_breast_cancer
from sklearn.model_selection import train_test_split
from codadapt import CodAdaptClassifier
X, y = load_breast_cancer(return_X_y=True, as_frame=True)
X_train, X_test, y_train, y_test = train_test_split(
X, y, test_size=0.2, random_state=42, stratify=y
)
model = CodAdaptClassifier(random_state=42)
model.fit(X_train, y_train)
print("Test accuracy:", model.score(X_test, y_test))
The idea is to keep the usual fit, predict, and score workflow while experimenting with a different learning mechanism.
This is a basic usage example, not a reproduction of the project's benchmark protocol.
What the benchmarks showed
One of the most interesting parts of developing CodAdapt has been evaluating its strengths and weaknesses against established models.
The repository includes an exploratory benchmark panel covering 14 dataset origins, comparing CodAdapt 2.1.0 with fixed configurations of Logistic/Ridge, Random Forest, HistGradientBoosting, XGBoost, LightGBM, and CatBoost.
The results are mixed.
For example, on the Danish occupancy dataset, CodAdapt recorded:
- ROC-AUC: 0.939468
- Fit and preparation time: 0.079 seconds
- Serialized model size: approximately 35.7 KiB
The quality-selected CatBoost comparator recorded:
- ROC-AUC: 0.951437
- Fit and preparation time: 0.5687 seconds
- Serialized model size: approximately 86.3 KiB
Under this specific benchmark configuration, CodAdapt was faster to fit and produced a smaller serialized model, but CatBoost achieved better predictive quality.
Other datasets showed less favorable results for CodAdapt, particularly in some multiclass classification and regression tasks.
These results don't establish that CodAdapt is generally better than existing algorithms.
They show that different learning architectures can have different trade-offs, and that computational efficiency alone doesn't tell the whole story.
The benchmark panel is exploratory, not an independent certification of predictive superiority.
What changed in version 2.2.0?
CodAdapt has evolved through multiple releases.
Version 2.2.0 focuses on technical improvements rather than changing the underlying predictive algorithm.
It introduces combined classifier outputs, prepared inputs for repeated inference requests, and optional compressed model snapshots.
The goal is to improve particular inference and storage workflows without making unsupported claims about predictive accuracy.
The current release is pure Python and requires Python 3.12 or later.
What I learned
Building CodAdapt has been an opportunity to explore much more than a different algorithm.
I've worked on model architecture, numerical and categorical preprocessing, API design, performance measurement, serialization, testing, and compatibility.
One important lesson is that developing an algorithm and demonstrating that it performs competitively are two different challenges.
A model can perform well in certain situations and poorly in others. Understanding those differences is more useful than looking for a single benchmark where it wins.
There is still plenty of room for experimentation and independent evaluation.
Sharing the project
CodAdapt is open source and available on GitHub and PyPI.
The repository includes source code, documentation, examples, benchmark data, methodology, and known limitations.
I originally started this as a personal research project, but decided to share it so others can explore the approach, test it, or provide technical feedback.
- GitHub: https://github.com/lucalullo/codadapt
- PyPI: https://pypi.org/project/codadapt/
- Benchmarks: https://github.com/lucalullo/codadapt/tree/main/benchmarks
I'm especially interested in feedback on the learning architecture and how to evaluate its predictive-quality and resource trade-offs more rigorously.
AI disclosure: I use AI coding assistants, including Codex, to support development, testing, and code review. I also used AI assistance to translate, organize, and polish this article in English. CodAdapt is my personal research and experimentation project, and the technical choices, results, and limitations presented here are based on the project's implementation and documentation.
Top comments (0)