This implementation comes with a wrapper for Pittsburgh solutions, so we can use dimension reduction and other functions
Use the compiled version of pymoo to reduce computation time
pip uninstall pymoo
mkdir pymoo
cd pymoo
git clone https://github.com/anyoptimization/pymoo
cd pymoo
make compile
pip install .
python -c "from pymoo.util.function_loader import is_compiled;print('Compiled Extensions: ', is_compiled())"
If you don't need to edit the source code of this library you can just use :
pip install git+https://github.com/RobinMeneustOMU/MoFGBML_Python
python -m pip install virtualenv
python -m venv .venv
source .venv/bin/activate
(or ".venv/Scripts/activate.bat"
on Windows)python -m pip install -r requirements.txt
python setup.py build_ext --inplace
Please read the notebooks in examples/.
usage: ipykernel_launcher.py [-h] [--cache-size CACHE_SIZE] --experiment-id
EXPERIMENT_ID --algorithm-id ALGORITHM_ID
[--population-size POPULATION_SIZE]
(--terminate-generation TERMINATE_GENERATION | --terminate-evaluation TERMINATE_EVALUATION)
[--verbose] [--rand-seed RAND_SEED]
[--is-probability-dont-care]
[--antecedent-number-do-not-dont-care ANTECEDENT_NUMBER_DO_NOT_DONT_CARE]
[--dont-care-rt DONT_CARE_RT]
[--initiation-rule-num INITIATION_RULE_NUM]
[--max-num-rules MAX_NUM_RULES]
[--min-num-rules MIN_NUM_RULES]
[--antecedent-factory ANTECEDENT_FACTORY]
[--crossover-type CROSSOVER_TYPE]
[--hybrid-cross-rt HYBRID_CROSS_RT]
[--michigan-ope-rt MICHIGAN_OPE_RT]
[--rule-change-rt RULE_CHANGE_RT]
[--michigan-cross-rt MICHIGAN_CROSS_RT]
[--pittsburgh-cross-rt PITTSBURGH_CROSS_RT]
[--objectives OBJECTIVES [OBJECTIVES ...]]
[--root-folder ROOT_FOLDER] [--is-multi-label]
--train-file TRAIN_FILE --test-file TEST_FILE
--data-name DATA_NAME [--gen-plot]
[--no-output-files] [--pretty-xml]
[--offspring-population-size OFFSPRING_POPULATION_SIZE]
options:
-h, --help show this help message and exit
--cache-size CACHE_SIZE
Third argument has been left for test purposes but
it's not recommended to use it since the hashing
function has collisions. Cache size for fitness values
computation. A big cache might deteriorate performance
and increase RAM usage
--experiment-id EXPERIMENT_ID
Experiment ID (Used to create the path where results
are saved)
--algorithm-id ALGORITHM_ID
Algorithm ID (Used to create the path where results
are saved)
--population-size POPULATION_SIZE
Population size (Number of individuals per generation)
--terminate-generation TERMINATE_GENERATION
Set the termination criterion to the number of
generation, and set the max value
--terminate-evaluation TERMINATE_EVALUATION
Set the termination criterion to the number of
objective function evaluations, and set the max value
--verbose If True then display for each generation some
information
--rand-seed RAND_SEED
The seed for random operations
--is-probability-dont-care
If specified then use the don't care rate for the
antecedent factory, otherwise compute it from
antecedent num not don't care
--antecedent-number-do-not-dont-care ANTECEDENT_NUMBER_DO_NOT_DONT_CARE
Number of indices that are not 0 (which is don't care)
in an antecedent. Used by the antecedent factory
--dont-care-rt DONT_CARE_RT
Don't care probability for antecedent indices in
antecedent factory
--initiation-rule-num INITIATION_RULE_NUM
Number of rules in Pittsburgh solutions in the initial
population
--max-num-rules MAX_NUM_RULES
Maximum number of rules in Pittsburgh solutions
--min-num-rules MIN_NUM_RULES
Minimum number of rules in Pittsburgh solutions
--antecedent-factory ANTECEDENT_FACTORY
Antecedent factory used for fuzzy rule generation. If
crossover-type is hybrid then
--crossover-type CROSSOVER_TYPE
Crossover used in the GA algorithm
--hybrid-cross-rt HYBRID_CROSS_RT
Probability that a (hybrid) crossover occurs
--michigan-ope-rt MICHIGAN_OPE_RT
Probability that Michigan mating operators are used
instead of a Pittsburgh one
--rule-change-rt RULE_CHANGE_RT
Ratio of the rules that are changed in a Michigan
crossover
--michigan-cross-rt MICHIGAN_CROSS_RT
Probability that a Michigan crossover occurs
--pittsburgh-cross-rt PITTSBURGH_CROSS_RT
Probability that a Pittsburgh crossover occurs
--objectives OBJECTIVES [OBJECTIVES ...]
List of the objectives. Accepted values: 'error-rate',
'rule-interpretation', 'num-rules', 'total-rule-length
--root-folder ROOT_FOLDER
Path where results are saved
--is-multi-label Must be specified if the dataset is a multi label one
and not specified otherwise, which is the default
--train-file TRAIN_FILE
Path of the training dataset file
--test-file TEST_FILE
Path of the test dataset file
--data-name DATA_NAME
Dataset name. It's used to create the path where
results are saved
--gen-plot Generate matplotlib plots
--no-output-files Don't save results in files (plots, solutions,
arguments...)
--pretty-xml Save results in a pretty XML file (formated with
indentation)
--offspring-population-size OFFSPRING_POPULATION_SIZE
Number of offsprings generated per generation
Run python profiler.py MoFGBMLNSGAIIMain
(or replace MoFGBMLNSGAIIMain with the method you want to use)
gprof2dot
gprof2dot -f pstats Profile.pstats -o Profile.dot
dot Profile.dot -Tpng -o Profile.png
pip install sphinx myst_parser rst2pdf sphinx-mdinclude sphinx_rtd_theme
sphinx-apidoc -o docs/source/ src/mofgbmlpy
docs/make.bat html
docs/make.bat pdf
docs/_build/html/index.html
docs/_build/pdf/MoFGBMLPy.pdf