# scikit-link documentation > Machine learning on multiple related tables, with the scikit-learn API. scikit-link (import sklink) is an open-source Python library, MIT licensed, for machine learning when the data is in several tables linked by keys, such as customers, orders and products. It follows the scikit-learn API: RelationalFeaturizer turns related tables into columns for any estimator, and RelationalDecisionTreeClassifier/Regressor, RelationalRandomForestClassifier/Regressor and RelationalGradientBoostingClassifier/Regressor learn aggregates and conditions on the related rows while they fit, such as count(orders[type == "express"]). RelationalKMeans and RelationalClusteringTree group entities without labels, and RelationalIsolationForest finds unusual ones. TransformedTablesEstimator fits scikit-learn transformers, such as TfidfVectorizer, on the related tables. sklink.inspection explains models by table and expression, and per sample. Per-sample cutoff dates and TemporalCutoffSplit prevent leakage from future rows. It runs on CPU with NumPy, without a GPU or a database server, and is an alternative to Featuretools deep feature synthesis that fits inside cross-validation. Install with pip install scikit-link. Source: https://github.com/rodrigo-arenas/scikit-link ## Pages ### Getting started - [Install scikit-link](/stable/getting-started/installation.md): Install scikit-link from PyPI, choose the table format you use, and check the installation. - [Quickstart: fit two models on related tables](/stable/getting-started/quickstart.md): Fit a pipeline and a relational decision tree on the shop dataset, then inspect the tree's first split. - [Core concepts of relational machine learning](/stable/getting-started/concepts.md): The ideas behind scikit-link: the Database, the entity table, X with one row per sample, relationships, canonical expression names and cutoffs. - [Common errors and how to fix them](/stable/getting-started/troubleshooting.md): What scikit-link's errors and warnings mean and how to fix them: duplicate keys, orphan rows, unknown keys, detached models, missing time columns. - [Choose a tutorial](/stable/tutorials.md): Choose a path from related tables to a scikit-learn pipeline or relational model, then validate, explain and deploy it. ### Build a model - [Describe your database: tables, keys and relationships](/stable/tutorials/describe-your-database.md): Build a scikit-link Database from pandas, Polars, PyArrow or Parquet: primary keys, relationships, column types, exclusions, orphans and validation. - [From your own tables to X and y](/stable/tutorials/your-own-data.md): Turn your own related tables into X and y for scikit-link: one row per prediction, a label without leakage, cutoff dates and a churn example. - [Relational features for any scikit-learn model](/stable/tutorials/relational-features.md): Turn related tables into features for any scikit-learn model with RelationalFeaturizer: depth, primitives, conditional aggregates and catalog control. - [Relational decision trees in Python](/stable/tutorials/relational-decision-trees.md): Fit relational decision trees that learn conditions on related tables: choose split conditions, handle missing values and read the fitted rules. - [Relational random forests in Python](/stable/tutorials/relational-random-forests.md): Relational random forests for classification and regression: out-of-bag score, max_features, parallel training and grouped feature importances. - [Relational gradient boosting in Python](/stable/tutorials/relational-gradient-boosting.md): Gradient boosting of relational decision trees: learning rate, early stopping, staged predictions and quantile regression on related tables. - [Cluster entities with related tables in Python](/stable/tutorials/clustering.md): Unsupervised segmentation of entities by their related rows, such as customers by their orders: relational k-means and clustering trees that read as rules. - [Find unusual entities in related tables with Python](/stable/tutorials/anomaly-detection.md): Anomaly detection on multi-table data: a relational isolation forest flags entities, such as customers, whose related rows look unlike anyone else's. ### Evaluate and interpret - [Model selection and hyperparameter search](/stable/tutorials/model-selection.md): Tune relational models with GridSearchCV and cross_validate, choose a splitter, and use pipelines and scikit-learn meta-estimators with scikit-link. - [Time, cutoffs and temporal cross-validation](/stable/tutorials/time-and-cutoffs.md): Predict at a point in time: declare time columns, pass a cutoff per sample, use windows such as the last 30 days, and validate with TemporalCutoffSplit. - [Inspect and explain relational models](/stable/tutorials/inspect-and-explain.md): Read fitted relational trees and forests: export rules as text or JSON, explain single predictions and group importances by table or primitive. - [Plot schemas, trees, forests and predictions](/stable/tutorials/plotting.md): Draw what a relational model reads, learns and predicts with sklink.plotting: schemas, trees, split search, predictions, importances and temporal splits. ### Deploy and extend - [Save, load and deploy relational models](/stable/tutorials/save-and-deploy.md): Save a fitted relational model without its database rows, then load it with pickle and attach the tables used for prediction. - [Custom primitives and expressions](/stable/tutorials/custom-primitives.md): Extend scikit-link with your own aggregation primitive, written as a NumPy kernel, and read, build and validate expressions from their canonical names. ### Case studies - [Case studies](/stable/case-studies.md): End-to-end scikit-link projects on related tables: churn prediction, scikit-learn ensembles and thresholds, forecasts with intervals, segments and anomalies. - [Case study: predict churn from usage and support tickets](/stable/case-studies/subscription-churn.md): An end-to-end churn model on related tables: build the database, label each account at monthly cutoffs, compare models by date, explain one account and deploy. - [Case study: relational models with scikit-learn tools](/stable/case-studies/scikit-learn-toolbox.md): Blend relational boosting and a featurizer pipeline in a VotingClassifier, then pick the threshold that minimizes business cost with TunedThresholdClassifierCV. - [Case study: machine condition forecasts with intervals](/stable/case-studies/machine-condition-intervals.md): Quantile relational gradient boosting on sensor readings and repair logs: forecast next month's vibration with an interval, then calibrate its coverage. - [Case study: segment accounts and flag anomalies](/stable/case-studies/segment-and-flag-accounts.md): Unsupervised learning on transactions and merchants: a clustering tree whose segments read as rules, k-means for comparison, and an isolation forest for review. ### Cookbook - [Cookbook: short recipes for related tables](/stable/cookbook.md): Short, runnable scikit-link recipes for loading relational data, building pipelines, evaluating and tuning models and interpreting what they learned. - [Cookbook: loading relational data](/stable/cookbook/loading-data.md): Recipes to build a scikit-link Database from CSV files, a SQL database, NumPy arrays without pandas, Parquet folders and Polars, and to keep extra columns in X. - [Cookbook: pipelines and meta-estimators with related tables](/stable/cookbook/pipelines.md): Recipes for scikit-link in scikit-learn pipelines: categorical features, missing values, calibration, bagging, stacking, imbalance and lookalikes. - [Cookbook: evaluation and tuning](/stable/cookbook/evaluation.md): Recipes to evaluate relational models: cross-validation, grouped and temporal splits, hyperparameter search and fair comparisons with flattened features. - [Cookbook: interpreting relational models](/stable/cookbook/interpretation.md): Recipes to read relational models: importances as a DataFrame, the tables a model needs, top featurizer columns, batch explanations and rules as JSON. - [Cookbook: use scikit-link with skrub, SHAP, skops and MLflow](/stable/cookbook/ecosystem.md): Recipes that combine scikit-link with skrub's TableVectorizer, SHAP explanations, skops and MLflow model files, and joblib worker processes. - [Cookbook: fit relational trees and forests faster](/stable/cookbook/performance.md): Speed up scikit-link: compile the tree loops with Numba, choose n_jobs, narrow the search of a tree, and limit memory when predicting on large tables. ### Guides - [Tune relational models: where to start](/stable/guides/tuning.md): How to tune scikit-link's trees, forests, gradient boosting and featurizer: which parameters matter first, search budgets, splitters and recipes by situation. - [Tune relational trees and forests](/stable/guides/tune-trees-and-forests.md): The effect of each parameter of scikit-link's relational decision trees and random forests, measured on executed examples, with search ranges to start from. - [Tune relational gradient boosting](/stable/guides/tune-gradient-boosting.md): How learning rate, number of trees, depth, subsampling, L2 regularization and early stopping change scikit-link's relational gradient boosting. - [Use scikit-link with scikit-learn](/stable/guides/scikit-learn.md): Use scikit-link models in scikit-learn pipelines, searches and meta-estimators, and fit scikit-learn transformers such as TF-IDF on the related tables. - [Migrate from Featuretools to scikit-link](/stable/guides/migrate-from-featuretools.md): Move Featuretools code to scikit-link: EntitySet to Database, dfs to RelationalFeaturizer, where primitives, cutoff times, windows and saved features. ### API reference - [API reference](/stable/api.md): Every public class and function of scikit-link, grouped by what you use it for, with links to the reference generated from docstrings. - [sklink.cluster](/stable/api/sklink.cluster.md): API reference of sklink.cluster. Clustering of the entities of a multi-table database. - [sklink.compose](/stable/api/sklink.compose.md): API reference of sklink.compose. Combine relational estimators with scikit-learn transformers of tables. - [sklink.database](/stable/api/sklink.database.md): API reference of sklink.database. Relational databases: tables, keys, relationships and their schema. - [sklink.datasets](/stable/api/sklink.datasets.md): API reference of sklink.datasets. Synthetic relational datasets and a small bundled example database. - [sklink.engine](/stable/api/sklink.engine.md): API reference of sklink.engine. Evaluation of expressions on a database: the only layer that reads data. - [sklink.ensemble](/stable/api/sklink.ensemble.md): API reference of sklink.ensemble. Ensembles of relational models: forests, gradient boosting, isolation forests. - [sklink.exceptions](/stable/api/sklink.exceptions.md): API reference of sklink.exceptions. Exceptions and warnings raised by scikit-link. - [sklink.expressions](/stable/api/sklink.expressions.md): API reference of sklink.expressions. Expressions: the shared language of relational features. - [sklink.feature_extraction](/stable/api/sklink.feature_extraction.md): API reference of sklink.feature_extraction. Turn relational data into flat feature matrices for any estimator. - [sklink.inspection](/stable/api/sklink.inspection.md): API reference of sklink.inspection. Read what a relational model learned, in terms of tables and columns. - [sklink](/stable/api/sklink.md): API reference of sklink. Relational machine learning on multi-table data, compatible with scikit-learn. - [sklink.model_selection](/stable/api/sklink.model_selection.md): API reference of sklink.model_selection. Validation tools for relational data. - [sklink.plotting](/stable/api/sklink.plotting.md): API reference of sklink.plotting. Figures that show what a relational model reads, learns and predicts. - [sklink.primitives](/stable/api/sklink.primitives.md): API reference of sklink.primitives. Aggregation primitives: what an expression computes over related rows. - [sklink.tree](/stable/api/sklink.tree.md): API reference of sklink.tree. Decision trees that ask about aggregates of related tables. - [sklink.utils.estimator_checks](/stable/api/sklink.utils.estimator_checks.md): API reference of sklink.utils.estimator_checks. Checks that every relational estimator must pass. - [sklink.utils](/stable/api/sklink.utils.md): API reference of sklink.utils. Validation helpers and reusable checks for relational estimators. - [sklink.utils.validation](/stable/api/sklink.utils.validation.md): API reference of sklink.utils.validation. Validation of the population table ``X`` and of the ``database`` parameter. ### Development - [Contributing](/stable/development/contributing.md): Set up scikit-link for development, choose checks for your change, and preview the documentation locally. - [Visual identity](/stable/development/visual-identity.md): Use the Atlas latente artwork, color roles, page layouts and components in the scikit-link website, documentation, diagrams and plots. ### Other - [Release notes](/stable/release-notes.md): What changed in each version of scikit-link: new features, fixes, deprecations and documentation changes.