# serengil/chefboost architecture

> Architecture diagram of the GitHub repository serengil/chefboost, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-17). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/serengil/chefboost
- Repository: https://github.com/serengil/chefboost

## Overview

ChefBoost is a Python decision-tree framework. Users pass a dataframe and configuration to fit; the library preprocesses features, trains a regular tree or ensemble, and exposes prediction, persistence, restoration and feature-importance operations. The graph includes documented capabilities whose source was not sampled, but their links are limited to documented or indexed relationships. Training internals and dynamic rule-module loading are shown where evidenced; unsampled evaluation and preprocessing details are not inferred beyond the excerpts.

Main entry points: [`chefboost/Chefboost.py`](https://github.com/serengil/chefboost/blob/master/chefboost/Chefboost.py) (ChefBoost API), [`chefboost/training/Training.py`](https://github.com/serengil/chefboost/blob/master/chefboost/training/Training.py) (Tree induction), [`chefboost/commons/module.py`](https://github.com/serengil/chefboost/blob/master/chefboost/commons/module.py) (Rule module loader), [`chefboost/tuning/gbm.py`](https://github.com/serengil/chefboost/blob/master/chefboost/tuning/gbm.py) (Gradient boosting)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["Public API"]
  node_api["ChefBoost API<br/>[Chefboost.py]"]
end

subgraph group_training["Tree Training"]
  node_preprocess["Feature preprocessing<br/>[Preprocess.py]"]
  node_tree["Tree induction<br/>[Training.py]"]
  node_rules["Generated rules<br/>[functions.py]"]
end

subgraph group_ensembles["Ensembles"]
  node_gbm["Gradient boosting<br/>[gbm.py]"]
  node_adaboost["AdaBoost<br/>[adaboost.py]"]
  node_forest["Random forest<br/>[randomforest.py]"]
end

subgraph group_runtime["Prediction and Utilities"]
  node_prediction["Bulk prediction<br/>[functions.py]"]
  node_module["Rule module loader<br/>[module.py]"]
  node_evaluate["Model evaluation<br/>[evaluate.py]"]
  node_importance["Feature importance<br/>[Chefboost.py]"]
  node_persistence["Save and restore<br/>[Chefboost.py]"]
  node_parallel["Parallel workers<br/>[daemon.py]"]
  node_logger["Logging<br/>[logger.py]"]
end

node_user(("Python user"))

node_user -->|"calls fit"| node_api
node_api -->|"preprocesses features"| node_preprocess
node_api -->|"builds trees"| node_tree
node_preprocess -->|"uses split search"| node_tree
node_tree -->|"writes rules"| node_rules
node_api -->|"dispatches boosting"| node_gbm
node_api -->|"dispatches boosting"| node_adaboost
node_api -->|"dispatches forest"| node_forest
node_gbm -->|"trains component trees"| node_tree
node_adaboost -->|"trains weak trees"| node_tree
node_forest -->|"trains sampled trees"| node_tree
node_user -->|"calls predict"| node_api
node_api -->|"predicts instances"| node_prediction
node_prediction -->|"calls prediction"| node_api
node_api -->|"loads rule modules"| node_module
node_gbm -->|"loads component trees"| node_module
node_adaboost -->|"loads weak rules"| node_module
node_forest -->|"loads tree modules"| node_module
node_api -->|"evaluates predictions"| node_evaluate
node_user -->|"requests importance"| node_api
node_api -->|"computes importance"| node_importance
node_user -->|"saves or restores"| node_api
node_api -->|"restores tree"| node_module
node_tree -.->|"uses worker pool"| node_parallel
node_api -->|"logs operations"| node_logger
node_tree -->|"logs training"| node_logger

click node_api "https://github.com/serengil/chefboost/blob/master/chefboost/Chefboost.py"
click node_preprocess "https://github.com/serengil/chefboost/blob/master/chefboost/training/Preprocess.py"
click node_tree "https://github.com/serengil/chefboost/blob/master/chefboost/training/Training.py"
click node_rules "https://github.com/serengil/chefboost/blob/master/chefboost/commons/functions.py"
click node_gbm "https://github.com/serengil/chefboost/blob/master/chefboost/tuning/gbm.py"
click node_adaboost "https://github.com/serengil/chefboost/blob/master/chefboost/tuning/adaboost.py"
click node_forest "https://github.com/serengil/chefboost/blob/master/chefboost/tuning/randomforest.py"
click node_prediction "https://github.com/serengil/chefboost/blob/master/chefboost/commons/functions.py"
click node_module "https://github.com/serengil/chefboost/blob/master/chefboost/commons/module.py"
click node_evaluate "https://github.com/serengil/chefboost/blob/master/chefboost/commons/evaluate.py"
click node_importance "https://github.com/serengil/chefboost/blob/master/chefboost/Chefboost.py"
click node_persistence "https://github.com/serengil/chefboost/blob/master/chefboost/Chefboost.py"
click node_parallel "https://github.com/serengil/chefboost/blob/master/chefboost/commons/daemon.py"
click node_logger "https://github.com/serengil/chefboost/blob/master/chefboost/commons/logger.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_api,node_user toneBlue
class node_preprocess,node_tree,node_rules toneAmber
class node_gbm,node_adaboost,node_forest toneMint
class node_prediction,node_module,node_evaluate,node_importance,node_persistence,node_parallel,node_logger toneRose
```

## Components

### Public API

- [ChefBoost API](https://github.com/serengil/chefboost/blob/master/chefboost/Chefboost.py): `chefboost/Chefboost.py`

### Tree Training

- [Feature preprocessing](https://github.com/serengil/chefboost/blob/master/chefboost/training/Preprocess.py): `chefboost/training/Preprocess.py`
- [Tree induction](https://github.com/serengil/chefboost/blob/master/chefboost/training/Training.py): `chefboost/training/Training.py`
- [Generated rules](https://github.com/serengil/chefboost/blob/master/chefboost/commons/functions.py): `chefboost/commons/functions.py`

### Ensembles

- [Gradient boosting](https://github.com/serengil/chefboost/blob/master/chefboost/tuning/gbm.py): `chefboost/tuning/gbm.py`
- [AdaBoost](https://github.com/serengil/chefboost/blob/master/chefboost/tuning/adaboost.py): `chefboost/tuning/adaboost.py`
- [Random forest](https://github.com/serengil/chefboost/blob/master/chefboost/tuning/randomforest.py): `chefboost/tuning/randomforest.py`

### Prediction and Utilities

- [Bulk prediction](https://github.com/serengil/chefboost/blob/master/chefboost/commons/functions.py): `chefboost/commons/functions.py`
- [Rule module loader](https://github.com/serengil/chefboost/blob/master/chefboost/commons/module.py): `chefboost/commons/module.py`
- [Model evaluation](https://github.com/serengil/chefboost/blob/master/chefboost/commons/evaluate.py): `chefboost/commons/evaluate.py`
- [Feature importance](https://github.com/serengil/chefboost/blob/master/chefboost/Chefboost.py): `chefboost/Chefboost.py`
- [Save and restore](https://github.com/serengil/chefboost/blob/master/chefboost/Chefboost.py): `chefboost/Chefboost.py`
- [Parallel workers](https://github.com/serengil/chefboost/blob/master/chefboost/commons/daemon.py): `chefboost/commons/daemon.py`
- [Logging](https://github.com/serengil/chefboost/blob/master/chefboost/commons/logger.py): `chefboost/commons/logger.py`

### Other components

- **Python user**

## Connections

- Python user → ChefBoost API: calls fit (evidence: `README.md`)
- ChefBoost API → Feature preprocessing: preprocesses features (evidence: `chefboost/Chefboost.py`)
- ChefBoost API → Tree induction: builds trees (evidence: `chefboost/Chefboost.py`)
- Feature preprocessing → Tree induction: uses split search (evidence: `chefboost/training/Preprocess.py`)
- Tree induction → Generated rules: writes rules (evidence: `chefboost/training/Training.py`)
- ChefBoost API → Gradient boosting: dispatches boosting (evidence: `chefboost/Chefboost.py`)
- ChefBoost API → AdaBoost: dispatches boosting (evidence: `chefboost/Chefboost.py`)
- ChefBoost API → Random forest: dispatches forest (evidence: `chefboost/Chefboost.py`)
- Gradient boosting → Tree induction: trains component trees (evidence: `chefboost/tuning/gbm.py`)
- AdaBoost → Tree induction: trains weak trees (evidence: `chefboost/tuning/adaboost.py`)
- Random forest → Tree induction: trains sampled trees (evidence: `chefboost/tuning/randomforest.py`)
- Python user → ChefBoost API: calls predict (evidence: `README.md`)
- ChefBoost API → Bulk prediction: predicts instances (evidence: `chefboost/Chefboost.py`)
- Bulk prediction → ChefBoost API: calls prediction (evidence: `chefboost/commons/functions.py`)
- ChefBoost API → Rule module loader: loads rule modules (evidence: `chefboost/commons/functions.py`)
- Gradient boosting → Rule module loader: loads component trees (evidence: `chefboost/tuning/gbm.py`)
- AdaBoost → Rule module loader: loads weak rules (evidence: `chefboost/tuning/adaboost.py`)
- Random forest → Rule module loader: loads tree modules (evidence: `chefboost/tuning/randomforest.py`)
- ChefBoost API → Model evaluation: evaluates predictions (evidence: `chefboost/Chefboost.py`)
- Python user → ChefBoost API: requests importance (evidence: `README.md`)
- ChefBoost API → Feature importance: computes importance (evidence: `chefboost/Chefboost.py`)
- Python user → ChefBoost API: saves or restores (evidence: `README.md`)
- ChefBoost API → Rule module loader: restores tree (evidence: `chefboost/commons/functions.py`)
- Tree induction → Parallel workers: uses worker pool (evidence: `chefboost/training/Training.py`)
- ChefBoost API → Logging: logs operations (evidence: `chefboost/Chefboost.py`)
- Tree induction → Logging: logs training (evidence: `chefboost/training/Training.py`)
