Skip to content

Commit

Permalink
Update tests folder
Browse files Browse the repository at this point in the history
  • Loading branch information
anh9895 committed Nov 2, 2024
1 parent 23e95c2 commit 60e1fdb
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 deletions.
4 changes: 2 additions & 2 deletions tests/test_MhaMlpClassifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ def test_MhaMlpClassifier_class():
y = np.random.randint(0, 2, size=100)

opt_paras = {"name": "GA", "epoch": 10, "pop_size": 30}
model = MhaMlpClassifier(hidden_size=50, act1_name="tanh", act2_name="sigmoid",
obj_name="CEL", optimizer="OriginalWOA", optimizer_paras=opt_paras, verbose=True)
model = MhaMlpClassifier(hidden_layers=(100,), act_names="ELU", dropout_rates=None, act_output=None,
optim="BaseGA", optim_paras=opt_paras, obj_name="F1S", seed=42, verbose=True)
model.fit(X, y)
pred = model.predict(X)
assert MhaMlpClassifier.SUPPORTED_CLS_OBJECTIVES == model.SUPPORTED_CLS_OBJECTIVES
Expand Down
4 changes: 2 additions & 2 deletions tests/test_MhaMlpRegressor.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ def test_MhaMlpRegressor_class():
y = 2 * X + 1 + noise

opt_paras = {"name": "GA", "epoch": 10, "pop_size": 30}
model = MhaMlpRegressor(hidden_size=50, act1_name="tanh", act2_name="sigmoid",
obj_name="MSE", optimizer="OriginalWOA", optimizer_paras=opt_paras, verbose=True)
model = MhaMlpRegressor(hidden_layers=(30, 15,), act_names="ELU", dropout_rates=0.2, act_output=None,
optim="BaseGA", optim_paras=opt_paras, obj_name="MSE", seed=42, verbose=True)
model.fit(X, y)

pred = model.predict(X)
Expand Down
6 changes: 4 additions & 2 deletions tests/test_MlpClassifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@ def test_MlpClassifier_class():
X = np.random.rand(100, 6)
y = np.random.randint(0, 2, size=100)

model = MlpClassifier(hidden_size=50, act1_name="tanh", act2_name="sigmoid", obj_name="NLLL",
max_epochs=1000, batch_size=32, optimizer="SGD", optimizer_paras=None, verbose=False)
model = MlpClassifier(hidden_layers=(30,), act_names="ReLU", dropout_rates=None, act_output=None,
epochs=10, batch_size=16, optim="Adam", optim_paras=None,
early_stopping=True, n_patience=10, epsilon=0.001, valid_rate=0.1,
seed=42, verbose=True)
model.fit(X, y)
pred = model.predict(X)
assert MlpClassifier.SUPPORTED_CLS_METRICS == model.SUPPORTED_CLS_METRICS
Expand Down
6 changes: 4 additions & 2 deletions tests/test_MlpRegressor.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@ def test_MlpRegressor_class():
noise = np.random.normal(loc=0.0, scale=0.1, size=(100, 5))
y = 2 * X + 1 + noise

model = MlpRegressor(hidden_size=50, act1_name="tanh", act2_name="sigmoid", obj_name="MSE",
max_epochs=1000, batch_size=32, optimizer="SGD", optimizer_paras=None, verbose=False)
model = MlpRegressor(hidden_layers=(30,), act_names="Tanh", dropout_rates=None, act_output=None,
epochs=10, batch_size=16, optim="Adam", optim_paras=None,
early_stopping=True, n_patience=10, epsilon=0.001, valid_rate=0.1,
seed=42, verbose=True)
model.fit(X, y)

pred = model.predict(X)
Expand Down

0 comments on commit 60e1fdb

Please sign in to comment.