Skip to content

Commit

Permalink
adapted documentation to version 0.1.4
Browse files Browse the repository at this point in the history
  • Loading branch information
AnFreTh committed Jun 3, 2024
1 parent 66f670a commit eb687f8
Show file tree
Hide file tree
Showing 42 changed files with 123 additions and 294 deletions.
123 changes: 0 additions & 123 deletions docs/_build/docs/_static/_sphinx_javascript_frameworks_compat.js

This file was deleted.

2 changes: 0 additions & 2 deletions docs/_build/docs/_static/jquery.js

This file was deleted.

Binary file modified docs/_build/doctrees/environment.pickle
Binary file not shown.
Binary file modified docs/_build/doctrees/homepage.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/index.doctree
Binary file not shown.
2 changes: 1 addition & 1 deletion docs/_build/html/_modules/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ <h1>All modules for which code is available</h1>
<div class="footer-item">

<p class="component-author">
By Anton Frederik Thielmann, Soheila Samiee, Christoph Weisser, Benjamin Saefken, Manish Kumar
By Anton Frederik Thielmann, Manish Kumar, Christoph Weisser, Benjamin Saefken, Soheila Samiee
</p>

</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -750,7 +750,7 @@ <h1>Source code for mambular.base_models.classifier</h1><div class="highlight"><
<div class="footer-item">

<p class="component-author">
By Anton Frederik Thielmann, Soheila Samiee, Christoph Weisser, Benjamin Saefken, Manish Kumar
By Anton Frederik Thielmann, Manish Kumar, Christoph Weisser, Benjamin Saefken, Soheila Samiee
</p>

</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -711,7 +711,7 @@ <h1>Source code for mambular.base_models.distributional</h1><div class="highligh
<div class="footer-item">

<p class="component-author">
By Anton Frederik Thielmann, Soheila Samiee, Christoph Weisser, Benjamin Saefken, Manish Kumar
By Anton Frederik Thielmann, Manish Kumar, Christoph Weisser, Benjamin Saefken, Soheila Samiee
</p>

</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -819,7 +819,7 @@ <h1>Source code for mambular.base_models.embedding_classifier</h1><div class="hi
<div class="footer-item">

<p class="component-author">
By Anton Frederik Thielmann, Soheila Samiee, Christoph Weisser, Benjamin Saefken, Manish Kumar
By Anton Frederik Thielmann, Manish Kumar, Christoph Weisser, Benjamin Saefken, Soheila Samiee
</p>

</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -735,7 +735,7 @@ <h1>Source code for mambular.base_models.embedding_regressor</h1><div class="hig
<div class="footer-item">

<p class="component-author">
By Anton Frederik Thielmann, Soheila Samiee, Christoph Weisser, Benjamin Saefken, Manish Kumar
By Anton Frederik Thielmann, Manish Kumar, Christoph Weisser, Benjamin Saefken, Soheila Samiee
</p>

</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -669,7 +669,7 @@ <h1>Source code for mambular.base_models.regressor</h1><div class="highlight"><p
<div class="footer-item">

<p class="component-author">
By Anton Frederik Thielmann, Soheila Samiee, Christoph Weisser, Benjamin Saefken, Manish Kumar
By Anton Frederik Thielmann, Manish Kumar, Christoph Weisser, Benjamin Saefken, Soheila Samiee
</p>

</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1034,7 +1034,7 @@ <h1>Source code for mambular.models.sklearn_classifier</h1><div class="highlight
<div class="footer-item">

<p class="component-author">
By Anton Frederik Thielmann, Soheila Samiee, Christoph Weisser, Benjamin Saefken, Manish Kumar
By Anton Frederik Thielmann, Manish Kumar, Christoph Weisser, Benjamin Saefken, Soheila Samiee
</p>

</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -991,7 +991,7 @@ <h1>Source code for mambular.models.sklearn_distributional</h1><div class="highl
<div class="footer-item">

<p class="component-author">
By Anton Frederik Thielmann, Soheila Samiee, Christoph Weisser, Benjamin Saefken, Manish Kumar
By Anton Frederik Thielmann, Manish Kumar, Christoph Weisser, Benjamin Saefken, Soheila Samiee
</p>

</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1058,7 +1058,7 @@ <h1>Source code for mambular.models.sklearn_embedding_classifier</h1><div class=
<div class="footer-item">

<p class="component-author">
By Anton Frederik Thielmann, Soheila Samiee, Christoph Weisser, Benjamin Saefken, Manish Kumar
By Anton Frederik Thielmann, Manish Kumar, Christoph Weisser, Benjamin Saefken, Soheila Samiee
</p>

</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -994,7 +994,7 @@ <h1>Source code for mambular.models.sklearn_embedding_regressor</h1><div class="
<div class="footer-item">

<p class="component-author">
By Anton Frederik Thielmann, Soheila Samiee, Christoph Weisser, Benjamin Saefken, Manish Kumar
By Anton Frederik Thielmann, Manish Kumar, Christoph Weisser, Benjamin Saefken, Soheila Samiee
</p>

</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -938,7 +938,7 @@ <h1>Source code for mambular.models.sklearn_regressor</h1><div class="highlight"
<div class="footer-item">

<p class="component-author">
By Anton Frederik Thielmann, Soheila Samiee, Christoph Weisser, Benjamin Saefken, Manish Kumar
By Anton Frederik Thielmann, Manish Kumar, Christoph Weisser, Benjamin Saefken, Soheila Samiee
</p>

</div>
Expand Down
2 changes: 1 addition & 1 deletion docs/_build/html/_modules/mambular/utils/preprocessor.html
Original file line number Diff line number Diff line change
Expand Up @@ -790,7 +790,7 @@ <h1>Source code for mambular.utils.preprocessor</h1><div class="highlight"><pre>
<div class="footer-item">

<p class="component-author">
By Anton Frederik Thielmann, Soheila Samiee, Christoph Weisser, Benjamin Saefken, Manish Kumar
By Anton Frederik Thielmann, Manish Kumar, Christoph Weisser, Benjamin Saefken, Soheila Samiee
</p>

</div>
Expand Down
42 changes: 16 additions & 26 deletions docs/_build/html/_sources/homepage.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Mambular: Tabular Deep Learning with Mamba Architectures

Mambular is a Python package that brings the power of Mamba architectures to tabular data, offering a suite of deep learning models for regression, classification, and distributional regression tasks. Designed with ease of use in mind, Mambular models adhere to scikit-learn's `BaseEstimator` interface, making them highly compatible with the familiar scikit-learn ecosystem. This means you can fit, predict, and transform using Mambular models just as you would with any traditional scikit-learn model, but with the added performance and flexibility of deep learning.
Mambular is a Python package that brings the power of Mamba architectures to tabular data, offering a suite of deep learning models for regression, classification, and distributional regression tasks. Designed with ease of use in mind, Mambular models adhere to scikit-learn's `BaseEstimator` interface, making them highly compatible with the familiar scikit-learn ecosystem. This means you can fit, predict, and evaluate using Mambular models just as you would with any traditional scikit-learn model, but with the added performance and flexibility of deep learning.

## Features

Expand All @@ -14,29 +14,26 @@ Mambular is a Python package that brings the power of Mamba architectures to tab

## Preprocessing

Mambular elevates the preprocessing stage of model development, employing a sophisticated suite of techniques to ensure your data is in the best shape for the Mamba architectures. Our preprocessing module is designed to be both powerful and intuitive, offering a range of options to transform your tabular data efficiently.
Mambular simplifies the preprocessing stage of model development with a comprehensive set of techniques to prepare your data for Mamba architectures. Our preprocessing module is designed to be both powerful and easy to use, offering a variety of options to efficiently transform your tabular data.

### Data Type Detection and Transformation

Mambular automatically identifies the type of each feature in your dataset, applying the most suitable transformations to numerical and categorical variables. This includes:
Mambular automatically identifies the type of each feature in your dataset and applies the most appropriate transformations for numerical and categorical variables. This includes:

- **Ordinal Encoding**: Categorical features are seamlessly transformed into numerical values, preserving their inherent order and making them model-ready.
- **One-Hot Encoding**: For nominal data, Mambular employs one-hot encoding to capture the presence or absence of categories without imposing ordinality.
- **Binning**: Numerical features can be discretized into bins, a useful technique for handling continuous variables in certain modeling contexts.
- **Decision Tree Binning**: Optionally, Mambular can use decision trees to find the optimal binning strategy for numerical features, enhancing model interpretability and performance.
- **Normalization**: Mambular can easily handle numerical features without specifically turning them into categorical features. Standard preprocessing steps such as normalization per feature are possible
- **Standardization**: Similarly, Standardization instead of Normalization can be used.
- **PLE**: Periodic Linear Encodings for numerical features can enhance performance for tabular DL methods.


### Handling Missing Values

Our preprocessing pipeline gracefully handles missing data, employing strategies like mean imputation for numerical features and mode imputation for categorical ones, ensuring that your models receive complete data inputs without manual intervention.
Our preprocessing pipeline effectively handles missing data by using mean imputation for numerical features and mode imputation for categorical features. This ensures that your models receive complete data inputs without needing manual intervention.
Additionally, Mambular can manage unknown categorical values during inference by incorporating classical <UNK> tokens in categorical preprocessing.

### Flexible and Customizable

While Mambular excels in automating the preprocessing workflow, it also offers flexibility. You can customize the preprocessing steps to fit the unique needs of your dataset, ensuring that you're not locked into a one-size-fits-all approach.

By integrating Mambular's preprocessing module into your workflow, you're not just preparing your data for deep learning; you're optimizing it for excellence. This commitment to data quality is what sets Mambular apart, making it an indispensable tool in your machine learning arsenal.

## Fit a Model
Fitting a model in mambular is as simple as it gets. All models in mambular are sklearn BaseEstimators. Thus the `.fit` method is implemented for all of them. Additionally, this allows for using all other sklearn inherent methods such as their built in hyperparameter optimization tools.
Expand All @@ -45,14 +42,14 @@ Fitting a model in mambular is as simple as it gets. All models in mambular are
from mambular.models import MambularClassifier
# Initialize and fit your model
model = MambularClassifier(
dropout=0.01,
d_model=128,
n_layers=6,
numerical_preprocessing="normalization",
d_model=64,
n_layers=8,
numerical_preprocessing="ple",
n_bins=50
)

# X can be a dataframe or something that can be easily transformed into a pd.DataFrame as a np.array
model.fit(X, y, max_epochs=500, lr=1e-03, patience=25)
model.fit(X, y, max_epochs=150, lr=1e-04)
```

Predictions are also easily obtained:
Expand Down Expand Up @@ -94,12 +91,6 @@ Mambular introduces a cutting-edge approach to distributional regression through
These distribution classes allow `MambularLSS` to flexibly model a wide variety of data types and distributions, providing users with the tools needed to capture the full complexity of their data.


### Use Cases for MambularLSS:

- **Risk Assessment**: In finance or insurance, understanding the range and likelihood of potential losses is as important as predicting average outcomes.
- **Demand Forecasting**: For inventory management, capturing the variability in product demand helps in optimizing stock levels.
- **Personalized Medicine**: In healthcare, distributional regression can predict a range of possible patient responses to a treatment, aiding in personalized therapy planning.

### Getting Started with MambularLSS:

To integrate distributional regression into your workflow with `MambularLSS`, start by initializing the model with your desired configuration, similar to other Mambular models:
Expand All @@ -110,17 +101,16 @@ from mambular.models import MambularLSS
# Initialize the MambularLSS model
model = MambularLSS(
dropout=0.2,
d_model=256,
n_layers=4,

d_model=64,
n_layers=8,
)

# Fit the model to your data
model.fit(
X,
y,
max_epochs=300,
lr=1e-03,
max_epochs=150,
lr=1e-04,
patience=10,
family="normal" # define your distribution
)
Expand All @@ -134,7 +124,7 @@ If you find this project useful in your research or in scientific publication, p
```BibTeX
@software{mambular2024,
title={Mambular: Tabular Deep Learning with Mamba Architectures},
author={Anton Frederik Thielmann, Soheila Samiee, Christoph Weisser, Benjamin Saefken, Manish Kumar},
author={Anton Frederik Thielmann, Manish Kumar, Christoph Weisser, Benjamin Saefken, Soheila Samiee},
url = {https://github.com/basf/mamba-tabular},
year={2024}
}
Expand Down
2 changes: 1 addition & 1 deletion docs/_build/html/_static/documentation_options.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
var DOCUMENTATION_OPTIONS = {
URL_ROOT: document.getElementById("documentation_options").getAttribute('data-url_root'),
VERSION: '0.1.3',
VERSION: '0.1.4',
LANGUAGE: 'en',
COLLAPSE_INDEX: false,
BUILDER: 'html',
Expand Down
2 changes: 1 addition & 1 deletion docs/_build/html/api/base_models/BaseModels.html
Original file line number Diff line number Diff line change
Expand Up @@ -2026,7 +2026,7 @@ <h1>mambular.base_models<a class="headerlink" href="#mambular-base-models" title
<div class="footer-item">

<p class="component-author">
By Anton Frederik Thielmann, Soheila Samiee, Christoph Weisser, Benjamin Saefken, Manish Kumar
By Anton Frederik Thielmann, Manish Kumar, Christoph Weisser, Benjamin Saefken, Soheila Samiee
</p>

</div>
Expand Down
2 changes: 1 addition & 1 deletion docs/_build/html/api/base_models/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ <h1>BaseModels<a class="headerlink" href="#basemodels" title="Permalink to this
<div class="footer-item">

<p class="component-author">
By Anton Frederik Thielmann, Soheila Samiee, Christoph Weisser, Benjamin Saefken, Manish Kumar
By Anton Frederik Thielmann, Manish Kumar, Christoph Weisser, Benjamin Saefken, Soheila Samiee
</p>

</div>
Expand Down
2 changes: 1 addition & 1 deletion docs/_build/html/api/models/Models.html
Original file line number Diff line number Diff line change
Expand Up @@ -1974,7 +1974,7 @@ <h1>mambular.models<a class="headerlink" href="#mambular-models" title="Permalin
<div class="footer-item">

<p class="component-author">
By Anton Frederik Thielmann, Soheila Samiee, Christoph Weisser, Benjamin Saefken, Manish Kumar
By Anton Frederik Thielmann, Manish Kumar, Christoph Weisser, Benjamin Saefken, Soheila Samiee
</p>

</div>
Expand Down
2 changes: 1 addition & 1 deletion docs/_build/html/api/models/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ <h1>Models<a class="headerlink" href="#models" title="Permalink to this heading"
<div class="footer-item">

<p class="component-author">
By Anton Frederik Thielmann, Soheila Samiee, Christoph Weisser, Benjamin Saefken, Manish Kumar
By Anton Frederik Thielmann, Manish Kumar, Christoph Weisser, Benjamin Saefken, Soheila Samiee
</p>

</div>
Expand Down
2 changes: 1 addition & 1 deletion docs/_build/html/api/utils/Preprocessor.html
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,7 @@ <h1>mambular.utils<a class="headerlink" href="#mambular-utils" title="Permalink
<div class="footer-item">

<p class="component-author">
By Anton Frederik Thielmann, Soheila Samiee, Christoph Weisser, Benjamin Saefken, Manish Kumar
By Anton Frederik Thielmann, Manish Kumar, Christoph Weisser, Benjamin Saefken, Soheila Samiee
</p>

</div>
Expand Down
Loading

0 comments on commit eb687f8

Please sign in to comment.