Skip to main content

Pecan's Data Science: A Peek Behind The Scenes

Learn about Pecan's state-of-the-art pipeline for tailored ML models and automated feature engineering - while keeping your data safe.

Pecan runs an automated pipeline that builds high-performance machine learning models, tailored to the specific data and question in front of it. Here's what happens under the hood.

How does Pecan execute automated feature engineering?

Feature engineering is where most of a model's predictive power comes from, so Pecan analyzes your data closely before generating anything. The system adapts its techniques to the content type of each column:

  • Continuous numerical variables Pecan generates statistical features including average, standard deviation (std), minimum (min), maximum (max), and mode. It also derives more involved features, such as the coefficients from a linear fit of a given entity's historical values.

  • Categorical variables Pecan identifies and retrieves prevalent historical categories for the entity in question. Depending on how the data is distributed, it encodes that information in different ways, including one-hot encoding, ordinal encoding, and target encoding, among others.

  • Dates Pecan recognizes patterns and significant events in date data, extracting features like day of the week, month, seasonality patterns, and the relative distance between dates to capture temporal information.

Denoising autoencoders and unsupervised methods such as clustering (for identifying lookalikes, for example) are used to strengthen the feature set further.

How does Pecan determine feature selection and significance?

Pecan applies standard feature selection methods, including variance threshold and correlation coefficients. On top of those foundations, it uses permutation importance, permutation tests, and SHAP (Shapley) values to measure how much each feature actually contributes to model performance.

Features that add noise rather than signal get dropped before training.

What modeling techniques does Pecan use?

Pecan builds every model with gradient boosted decision trees, using two algorithms: LightGBM (LGBM) and CatBoost.

That focus is deliberate. On tabular business data, meaning the customer, transaction, and event tables behind most business questions, gradient boosted trees consistently outperform deep learning and classical statistical approaches. This holds across published academic benchmarks and across thousands of real customer deployments. Concentrating on the two strongest implementations lets Pecan go deeper on everything that surrounds the algorithm, which is where the remaining accuracy gains live.

LGBM and CatBoost bring different strengths. LGBM is fast and highly efficient on large datasets with many features. CatBoost handles high-cardinality categorical data with less risk of overfitting, which matters when your data includes fields like product SKU, store location, or acquisition channel. Both compete on every predictive question, and the winner varies from one model to the next.

How does Pecan choose the best model for your data?

Selection happens at the configuration level. For a single business question, Pecan trains and scores many candidate models, each with a different combination of features, hyperparameters, and loss function.

Bayesian Optimization drives the search across the hyperparameter space, so each round of experimentation is informed by the results of the last one instead of sweeping blindly. Candidates are scored against a validation set held out from the training data, set to 10% by default.

Pecan also evaluates multiple loss functions based on the task and the shape of your data. Log loss, Tweedie, and others are tested rather than assumed. A demand forecasting model with a long tail of zero-sales days needs a different loss function than a churn model with a balanced label, and Pecan makes that call automatically.

The candidate that performs best on your selected optimization metric is the one that gets deployed.

Optimization metric

Choosing the metric to optimize for is one of the more consequential decisions in the modeling process, and you control it. You can change the default optimization metric at any time.

Did this answer your question?