Configuration Utilities¶
API reference for configuration helpers that let you persist ANFIS setups, manage presets, and export trained models.
anfis_toolbox.config ¶
Configuration utilities for ANFIS models.
ANFISConfig ¶
Configuration manager for ANFIS models.
add_input_config ¶
add_input_config(
name: str,
range_min: float,
range_max: float,
n_mfs: int = 3,
mf_type: str = "gaussian",
overlap: float = 0.5,
) -> ANFISConfig
Add input configuration.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Input variable name |
required |
range_min
|
float
|
Minimum input range |
required |
range_max
|
float
|
Maximum input range |
required |
n_mfs
|
int
|
Number of membership functions |
3
|
mf_type
|
str
|
Type of membership functions |
'gaussian'
|
overlap
|
float
|
Overlap factor |
0.5
|
Returns:
| Type | Description |
|---|---|
ANFISConfig
|
Self for method chaining |
build_model ¶
load
classmethod
¶
Load configuration from JSON file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
filepath
|
str | Path
|
Path to configuration file |
required |
Returns:
| Type | Description |
|---|---|
ANFISConfig
|
ANFISConfig object |
save ¶
Save configuration to JSON file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
filepath
|
str | Path
|
Path to save configuration file |
required |
set_training_config ¶
set_training_config(
method: str = "hybrid",
epochs: int = 50,
learning_rate: float = 0.01,
verbose: bool = False,
) -> ANFISConfig
Set training configuration.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
method
|
str
|
Training method ('hybrid' or 'backprop') |
'hybrid'
|
epochs
|
int
|
Number of training epochs |
50
|
learning_rate
|
float
|
Learning rate |
0.01
|
verbose
|
bool
|
Whether to show training progress |
False
|
Returns:
| Type | Description |
|---|---|
ANFISConfig
|
Self for method chaining |
to_dict ¶
Convert configuration to dictionary.
Returns:
| Type | Description |
|---|---|
_ConfigDict
|
Configuration dictionary |
ANFISModelManager ¶
Model management utilities for saving/loading trained ANFIS models.
load_model
staticmethod
¶
Load trained ANFIS model from file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
filepath
|
str | Path
|
Path to model file |
required |
Returns:
| Type | Description |
|---|---|
TSKANFIS
|
Loaded ANFIS model |
create_config_from_preset ¶
Create configuration from predefined preset.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
preset_name
|
str
|
Name of predefined configuration |
required |
Returns:
| Type | Description |
|---|---|
ANFISConfig
|
ANFISConfig object |
Raises:
| Type | Description |
|---|---|
ValueError
|
If preset name not found |
list_presets ¶
List available predefined configurations.
Returns:
| Type | Description |
|---|---|
dict[str, str]
|
Dictionary mapping preset names to descriptions |