Introducing scikit-link
scikit-link is an open source Python library for training scikit-learn models on related tables. You can compute features in a pipeline, fit relational trees, forests and gradient boosting models that split on related records, or cluster entities and flag anomalies by their related rows.
The gap
Suppose the customer table is the input to a churn model. A customer's order count and average order amount both belong in that customer's feature row, but the amounts live in a separate table. For a new question, such as how many express orders exceeded a threshold, the aggregation changes again.
We built scikit-link to do that work inside a scikit-learn estimator. A pipeline can compute the aggregates during each training fold, and a relational tree can learn which orders to count.
What scikit-link does
- Describe the tables and keys in a
Database.Xhas one row per sample with the key that links it to the database. - Compute features such as
count(orders[type == 'express']), or fit a relational decision tree or forest that learns conditions on orders from the labels. Gradient boosting adds trees that correct each other. - Cluster customers (
RelationalKMeans,RelationalClusteringTree) or score anomalies (RelationalIsolationForest) from their related rows. - Use scikit-learn cross-validation and hyperparameter search. Each fit learns from the training samples. For temporal data, give samples a cutoff so features only use events visible at prediction time.
scikit-link is on PyPI. Follow the installation guide and quickstart to run a small example. See the roadmap for release plans.
Follow along
The code is on GitHub. If you work with multi-table data, or moved away from Featuretools, we would like to hear about your use case in Discussions.