Skip to content

Commit

Permalink
include new preprocessor arguments into documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
thielmaf committed May 31, 2024
1 parent 45e2878 commit 79db0f9
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 1 deletion.
7 changes: 7 additions & 0 deletions mambular/models/sklearn_classifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,10 @@ class MambularClassifier(BaseEstimator):
Defines the strategy for binning numerical features. Default is 'uniform'.
task : str, optional
Indicates the type of machine learning task ('regression' or 'classification'). Default is 'regression'.
cat_cutoff: float or int, optional
Indicates the cutoff after which integer values are treated as categorical. If float, it's treated as a percentage. If int, it's the maximum number of unique values for a column to be considered categorical. Default is 3%
treat_all_integers_as_numerical : bool, optional
If True, all integer columns will be treated as numerical, regardless of their unique value count or proportion. Default is False
Expand Down Expand Up @@ -140,7 +144,10 @@ def __init__(self, **kwargs):
"use_decision_tree_bins",
"binning_strategy",
"task",
"cat_cutoff",
"treat_all_integers_as_numerical",
]

self.config_kwargs = {k: v for k, v in kwargs.items() if k in config_arg_names}
self.config = DefaultMambularConfig(**self.config_kwargs)

Expand Down
7 changes: 7 additions & 0 deletions mambular/models/sklearn_distributional.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,10 @@ class MambularLSS(BaseEstimator):
Defines the strategy for binning numerical features. Default is 'uniform'.
task : str, optional
Indicates the type of machine learning task ('regression' or 'classification'). Default is 'regression'.
cat_cutoff: float or int, optional
Indicates the cutoff after which integer values are treated as categorical. If float, it's treated as a percentage. If int, it's the maximum number of unique values for a column to be considered categorical. Default is 3%
treat_all_integers_as_numerical : bool, optional
If True, all integer columns will be treated as numerical, regardless of their unique value count or proportion. Default is False
Expand Down Expand Up @@ -152,7 +156,10 @@ def __init__(self, **kwargs):
"use_decision_tree_bins",
"binning_strategy",
"task",
"cat_cutoff",
"treat_all_integers_as_numerical",
]

self.config_kwargs = {k: v for k, v in kwargs.items() if k in config_arg_names}
self.config = DefaultMambularConfig(**self.config_kwargs)

Expand Down
6 changes: 6 additions & 0 deletions mambular/models/sklearn_embedding_classifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@ class EmbeddingMambularClassifier(BaseEstimator):
Defines the strategy for binning numerical features. Default is 'uniform'.
task : str, optional
Indicates the type of machine learning task ('regression' or 'classification'). Default is 'regression'.
cat_cutoff: float or int, optional
Indicates the cutoff after which integer values are treated as categorical. If float, it's treated as a percentage. If int, it's the maximum number of unique values for a column to be considered categorical. Default is 3%
treat_all_integers_as_numerical : bool, optional
If True, all integer columns will be treated as numerical, regardless of their unique value count or proportion. Default is False
Attributes
Expand Down Expand Up @@ -140,6 +144,8 @@ def __init__(self, **kwargs):
"use_decision_tree_bins",
"binning_strategy",
"task",
"cat_cutoff",
"treat_all_integers_as_numerical",
]

self.config_kwargs = {k: v for k, v in kwargs.items() if k in config_arg_names}
Expand Down
6 changes: 6 additions & 0 deletions mambular/models/sklearn_embedding_regressor.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,10 @@ class EmbeddingMambularRegressor(BaseEstimator):
Defines the strategy for binning numerical features. Default is 'uniform'.
task : str, optional
Indicates the type of machine learning task ('regression' or 'classification'). Default is 'regression'.
cat_cutoff: float or int, optional
Indicates the cutoff after which integer values are treated as categorical. If float, it's treated as a percentage. If int, it's the maximum number of unique values for a column to be considered categorical. Default is 3%
treat_all_integers_as_numerical : bool, optional
If True, all integer columns will be treated as numerical, regardless of their unique value count or proportion. Default is False
Attributes
Expand Down Expand Up @@ -137,6 +141,8 @@ def __init__(self, **kwargs):
"use_decision_tree_bins",
"binning_strategy",
"task",
"cat_cutoff",
"treat_all_integers_as_numerical",
]

self.config_kwargs = {k: v for k, v in kwargs.items() if k in config_arg_names}
Expand Down
8 changes: 7 additions & 1 deletion mambular/models/sklearn_regressor.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from sklearn.model_selection import train_test_split
from torch.utils.data import DataLoader
import warnings

import numpy as np
from ..base_models.regressor import BaseMambularRegressor
from ..utils.dataset import MambularDataModule, MambularDataset
from ..utils.preprocessor import Preprocessor
Expand Down Expand Up @@ -88,6 +88,10 @@ class MambularRegressor(BaseEstimator):
Defines the strategy for binning numerical features. Default is 'uniform'.
task : str, optional
Indicates the type of machine learning task ('regression' or 'classification'). Default is 'regression'.
cat_cutoff: float or int, optional
Indicates the cutoff after which integer values are treated as categorical. If float, it's treated as a percentage. If int, it's the maximum number of unique values for a column to be considered categorical. Default is 3%
treat_all_integers_as_numerical : bool, optional
If True, all integer columns will be treated as numerical, regardless of their unique value count or proportion. Default is False
Expand Down Expand Up @@ -138,6 +142,8 @@ def __init__(self, **kwargs):
"use_decision_tree_bins",
"binning_strategy",
"task",
"cat_cutoff",
"treat_all_integers_as_numerical",
]

self.config_kwargs = {k: v for k, v in kwargs.items() if k in config_arg_names}
Expand Down

0 comments on commit 79db0f9

Please sign in to comment.