Documentation for Neural NARX
¶
Utilities fo data validation
check_X_y(X, y)
¶
Validate input and output data using some crucial tests.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
X | ndarray of floats | The input data. | required |
y | ndarray of floats | The output data. | required |
Source code in sysidentpy\utils\_check_arrays.py
check_dimension(X, y)
¶
Check if X and y have only real values.
If there is any string or object samples a ValueError is raised.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
X | ndarray of floats | The input data. | required |
y | ndarray of floats | The output data. | required |
Source code in sysidentpy\utils\_check_arrays.py
check_infinity(X, y)
¶
Check that X and y have no NaN or Inf samples.
If there is any NaN or Inf samples a ValueError is raised.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
X | ndarray of floats | The input data. | required |
y | ndarray of floats | The output data. | required |
Source code in sysidentpy\utils\_check_arrays.py
check_length(X, y)
¶
Check that X and y have the same number of samples.
If the length of X and y are different a ValueError is raised.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
X | ndarray of floats | The input data. | required |
y | ndarray of floats | The output data. | required |
Source code in sysidentpy\utils\_check_arrays.py
check_nan(X, y)
¶
Check that X and y have no NaN or Inf samples.
If there is any NaN or Inf samples a ValueError is raised.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
X | ndarray of floats | The input data. | required |
y | ndarray of floats | The output data. | required |
Source code in sysidentpy\utils\_check_arrays.py
check_random_state(seed)
¶
Turn seed
into a np.random.RandomState
instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
seed |
| required |
Returns:
Name | Type | Description |
---|---|---|
seed | Random number generator. |
Source code in sysidentpy\utils\_check_arrays.py
results(final_model=None, theta=None, err=None, n_terms=None, theta_precision=4, err_precision=8, dtype='dec')
¶
Write the model regressors, parameters and ERR values.
This function returns the model regressors, its respective parameter and ERR value on a string matrix.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
theta_precision | int (default | Precision of shown parameters values. | 4 |
err_precision | int (default | Precision of shown ERR values. | 8 |
dtype | string (default | Type of representation: sci - Scientific notation; dec - Decimal notation. | 'dec' |
Returns:
Name | Type | Description |
---|---|---|
output_matrix | string | Where: First column represents each regressor element; Second column represents associated parameter; Third column represents the error reduction ratio associated to each regressor. |
Source code in sysidentpy\utils\display_results.py
Utilities for data generation
get_miso_data(n=5000, colored_noise=False, sigma=0.05, train_percentage=90)
¶
Perform the Error Reduction Ration algorithm.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
n | int | The number of samples. | 5000 |
colored_noise | bool | Select white noise or colored noise (autoregressive noise). | False |
sigma | float | The standard deviation of the random distribution to generate the noise. | 0.05 |
train_percentage | int | The percentage of the data to be used as train data. | 90 |
Returns:
Type | Description |
---|---|
x_train, x_valid | The input data to be used in identification and validation, respectively. |
y_train, y_valid | The output data to be used in identification and validation, respectively. |
Source code in sysidentpy\utils\generate_data.py
get_siso_data(n=5000, colored_noise=False, sigma=0.05, train_percentage=90)
¶
Perform the Error Reduction Ration algorithm.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
n | int | The number of samples. | 5000 |
colored_noise | bool | Select white noise or colored noise (autoregressive noise). | False |
sigma | float | The standard deviation of the random distribution to generate the noise. | 0.05 |
train_percentage | int | The percentage of the data to be used as train data. | 90 |
Returns:
Type | Description |
---|---|
x_train, x_valid | The input data to be used in identification and validation, respectively. |
y_train, y_valid | The output data to be used in identification and validation, respectively. |
Source code in sysidentpy\utils\generate_data.py
load_model(*, file_name='model', path=None)
¶
This method loads the model from file "file_name.syspy" located at path "path"
Parameters:
Name | Type | Description | Default |
---|---|---|---|
file_name | model to be loaded | 'model' | |
path | None |
Returns:
Name | Type | Description |
---|---|---|
model_loaded | model loaded, as a variable, containing model and its attributes |
Source code in sysidentpy\utils\save_load.py
save_model(*, model=None, file_name='model', path=None)
¶
This method saves the model "model" in folder "folder" using an extension .syspy
Parameters:
Name | Type | Description | Default |
---|---|---|---|
model | None | ||
file_name | 'model' | ||
path | None |
Returns:
Type | Description |
---|---|
file file_name.syspy located at "path", containing the estimated model. |