Skip to content

Commit d33b294

Browse files
committed
Update docstring
1 parent 552e791 commit d33b294

File tree

3 files changed

+17
-20
lines changed

3 files changed

+17
-20
lines changed

evorbf/core/base_rbf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -329,8 +329,8 @@ class BaseNiaRbf(BaseRbf):
329329
"""
330330
Defines the most general class for Nature-inspired Algorithm-based RBF models that inherits the BaseRbf class
331331
332-
Note:
333-
-----
332+
Note
333+
----
334334
+ In this model, the sigmas will be learned during the training process.
335335
+ So the `sigmas` parameter is removed in the init function.
336336
+ Besides, the `sigmas` is a list of value, each value represent a `sigma` for Gaussian function used in hidden node.

evorbf/core/nia_rbf.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,9 @@ class NiaRbfRegressor(BaseNiaRbf, RegressorMixin):
2222
+ use non-linear Gaussian function with `sigmas` as standard deviation
2323
+ set up regulation term with hyperparameter `regularization`
2424
25-
Inherits
26-
--------
27-
BaseNiaRbf : The base class for NIA-based RBF networks.
28-
RegressorMixin : Scikit-learn mixin class for regression estimators.
25+
Inherits:
26+
+ BaseNiaRbf : The base class for NIA-based RBF networks.
27+
+ RegressorMixin : Scikit-learn mixin class for regression estimators.
2928
3029
Parameters
3130
----------
@@ -88,8 +87,8 @@ class NiaRbfRegressor(BaseNiaRbf, RegressorMixin):
8887
>>> data = Data(X, y)
8988
>>> data.split_train_test(test_size=0.2, random_state=1)
9089
>>> opt_paras = {"name": "GA", "epoch": 10, "pop_size": 30}
91-
>>> model = NiaRbfRegressor(size_hidden=10, center_finder="kmeans", regularization=False, lamda=0.01,
92-
>>> obj_name=None, optimizer="BaseGA", optimizer_paras=opt_paras, verbose=True, seed=42, obj_weights=None)
90+
>>> model = NiaRbfRegressor(size_hidden=10, center_finder="kmeans", regularization=False,
91+
>>> obj_name=None, optim="BaseGA", optim_paras=opt_paras, verbose=True, seed=42, obj_weights=None)
9392
>>> model.fit(data.X_train, data.y_train)
9493
>>> pred = model.predict(data.X_test)
9594
>>> print(pred)

evorbf/helpers/preprocessor.py

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@
44
# Github: https://github.com/thieu1995 %
55
# --------------------------------------------------%
66

7-
import pandas as pd
87
import numpy as np
9-
from pathlib import Path
108
from evorbf.helpers.scaler import DataTransformer
119
from sklearn.model_selection import train_test_split
1210

@@ -31,8 +29,8 @@ def fit(self, y):
3129
"""
3230
Fit label encoder to a given set of labels.
3331
34-
Parameters:
35-
-----------
32+
Parameters
33+
----------
3634
y : array-like
3735
Labels to encode.
3836
"""
@@ -44,13 +42,13 @@ def transform(self, y):
4442
"""
4543
Transform labels to encoded integer labels.
4644
47-
Parameters:
48-
-----------
45+
Parameters
46+
----------
4947
y : array-like (1-D vector)
5048
Labels to encode.
5149
52-
Returns:
53-
--------
50+
Returns
51+
-------
5452
encoded_labels : array-like
5553
Encoded integer labels.
5654
"""
@@ -79,13 +77,13 @@ def inverse_transform(self, y):
7977
"""
8078
Transform integer labels to original labels.
8179
82-
Parameters:
83-
-----------
80+
Parameters
81+
----------
8482
y : array-like
8583
Encoded integer labels.
8684
87-
Returns:
88-
--------
85+
Returns
86+
-------
8987
original_labels : array-like
9088
Original labels.
9189
"""

0 commit comments

Comments
 (0)