Combinations
Combinations are at the core of Carvers. They are used to identify the best combination
from all possible combinations with up to max_n_mod modalities.
Classification tasks
Cramér’s V Combinations
See Cramér’s V for more details on the metric.
- class AutoCarver.combinations.CramervCombinations(max_n_mod: int = 5, **kwargs)
Cramér’s V based combination evaluation toolkit
- Parameters:
max_n_mod (int, optional) –
Maximum number of modalities per feature, by default
5The combination with the best association will be selected.
All combinations of sizes from 1 to
max_n_modare tested out.
Tip
Set between
3(faster, more robust) and7(slower, less robust)- Keyword Arguments:
min_freq (float, optional) –
Minimum frequency per modality per feature, by default
NoneFeatures need at least one modality more frequent than
min_freqDefines number of quantiles of continuous features
Minimum frequency of modality of quantitative features
Tip
Set between
0.01(slower, less robust) and0.2(faster, more robust)dropna (bool, optional) –
True, try to groupnanwith other modalities.False,nanare ignored (not grouped), by defaultFalse
verbose (bool, optional) –
True, withoutIPython: prints raw statiticsTrue, withIPython: prints HTML statistics, by defaultFalse
- classmethod load(file: str | dict) CombinationEvaluator
Allows one to load a
CombinationEvaluatorsaved as a .json file.- Parameters:
file (str | dict) – String of .json file name or content of the file.
- Returns:
A ready-to-use
CombinationEvaluator- Return type:
CombinationEvaluator
- save(file_name: str) None
Saves
CombinationEvaluatorto .json file.- Parameters:
file_name (str) – String of .json file name
Tschuprow’s T Combinations
See Tschuprow’s T for more details on the metric.
- class AutoCarver.combinations.TschuprowtCombinations(max_n_mod: int = 5, **kwargs)
Tschuprow’s T based combination evaluation toolkit
- Parameters:
max_n_mod (int, optional) –
Maximum number of modalities per feature, by default
5The combination with the best association will be selected.
All combinations of sizes from 1 to
max_n_modare tested out.
Tip
Set between
3(faster, more robust) and7(slower, less robust)- Keyword Arguments:
min_freq (float, optional) –
Minimum frequency per modality per feature, by default
NoneFeatures need at least one modality more frequent than
min_freqDefines number of quantiles of continuous features
Minimum frequency of modality of quantitative features
Tip
Set between
0.01(slower, less robust) and0.2(faster, more robust)dropna (bool, optional) –
True, try to groupnanwith other modalities.False,nanare ignored (not grouped), by defaultFalse
verbose (bool, optional) –
True, withoutIPython: prints raw statiticsTrue, withIPython: prints HTML statistics, by defaultFalse
- classmethod load(file: str | dict) CombinationEvaluator
Allows one to load a
CombinationEvaluatorsaved as a .json file.- Parameters:
file (str | dict) – String of .json file name or content of the file.
- Returns:
A ready-to-use
CombinationEvaluator- Return type:
CombinationEvaluator
- save(file_name: str) None
Saves
CombinationEvaluatorto .json file.- Parameters:
file_name (str) – String of .json file name
Regression tasks
Kruskal’s H Combinations
See Kruskal-Wallis’ H test statistic for more details on the metric.
- class AutoCarver.combinations.KruskalCombinations(max_n_mod: int = 5, **kwargs)
Kruskal-Wallis’ H based combination evaluation toolkit
- Parameters:
max_n_mod (int, optional) –
Maximum number of modalities per feature, by default
5The combination with the best association will be selected.
All combinations of sizes from 1 to
max_n_modare tested out.
Tip
Set between
3(faster, more robust) and7(slower, less robust)- Keyword Arguments:
min_freq (float, optional) –
Minimum frequency per modality per feature, by default
NoneFeatures need at least one modality more frequent than
min_freqDefines number of quantiles of continuous features
Minimum frequency of modality of quantitative features
Tip
Set between
0.01(slower, less robust) and0.2(faster, more robust)dropna (bool, optional) –
True, try to groupnanwith other modalities.False,nanare ignored (not grouped), by defaultFalse
verbose (bool, optional) –
True, withoutIPython: prints raw statiticsTrue, withIPython: prints HTML statistics, by defaultFalse
- classmethod load(file: str | dict) CombinationEvaluator
Allows one to load a
CombinationEvaluatorsaved as a .json file.- Parameters:
file (str | dict) – String of .json file name or content of the file.
- Returns:
A ready-to-use
CombinationEvaluator- Return type:
CombinationEvaluator
- save(file_name: str) None
Saves
CombinationEvaluatorto .json file.- Parameters:
file_name (str) – String of .json file name