Skip to content

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
thieupu committed Nov 5, 2023
1 parent 90cce42 commit 7c3fe54
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,12 @@ print(f"Best solution: {g_best.solution}, Best fitness: {g_best.target.fitness}"

**Define a custom Problem class**


**Please note that, there is no more `generate_position`, `amend_solution`, and `fitness_function` in Problem class.**
We take care everything under the DataType Class above. Just choose which one fit for your problem.
**We recommend you define a custom class that inherit `Problem` class if your decision variable is not FloatVar**


```python
from mealpy import Problem, FloatVar, BBO
import numpy as np
Expand All @@ -219,10 +225,6 @@ g_best = model.solve(problem)

#### The benefit of using custom Problem class

**Please note that, there is no more `generate_position`, `amend_solution`, and `fitness_function` in Problem class.**
We take care everything under the DataType Class above. Just choose which one fit for your problem.
**We recommend you define a custom class that inherit `Problem` class if your decision variable is not FloatVar**

```python
from sklearn.svm import SVC
from sklearn.model_selection import train_test_split
Expand Down

0 comments on commit 7c3fe54

Please sign in to comment.