-
Notifications
You must be signed in to change notification settings - Fork 151
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add solution generator and evaluator for SA (#67) * Add warm startup for SA using population_generator. * Revert evaluator parametrization in SA. * Working on implementing a IntegerFloatSolution class * Update nsgaiii.py (#70) removed obsolete import * Fix conflict in file smpsorp_zdt4.py * Add new implementation of quality indicators. All of them receive a numpy array as a parameter instead of a list of solutions. * Refactor quality indicators. All of them receive as a parameter a numpy array instead of a list of solutions * Add file ZDT1.pf in the test folder (to be use to test quality indicators) * Feature/mixed solution (#73) * Working on implementing a IntegerFloatSolution class * Add unit test cases for class IntegerFloatProblem * Add class NMMin * Add class IntegerFloatSBXCrossover * Add test cases for SBXCrossover * Still working on implementing an approach for the IntegerFloatSolution class * Add user defined exceptiones in file checking.py * Working on the implementation of class CompositeSolution * Workon on class CompositeSolution * Class CompositeMutation implemented and tested * Fix a bug in class Neighborhood * Class CompositeCrossover implemented and tested * Add class * Add class * Rename file * Add problem ZDT1Modified * Add examples with NSGA-II * Add NSGA-II examples * Optimize imports * Minor changes * Changes on attribute name Co-authored-by: Yebisu <[email protected]> * Minor changes * Release v1.5.4 * Updating the MOEAD and variants examples * Minor changes * Add problem UF1 * Fix bug in ibea. * Refactor crossover and mutation operators * Refactor crossover and mutation operators * New minor version 1.5.5 * Adapt CXCrossover and ScrambleMutation to TSP (#80) * Added new minor version * Removed SyntaxWarning for with literals * Changed typing of frequency to int * Minor changes * Use of linters for catching errors and formatters to fix style * fix IntegerProblem cannot get upper bound value bug (#86) * optimise deepcopy for list (#87) * Added logging * Update __init__.py (#92) Export `RouletteWheelSelection` Co-authored-by: Antonio <[email protected]> * Minor changes * Python version 3.7 * Minor changes * Optimize imports * Minor changes * removing depricated functions (#118) * Fix #115 * fixing kursawe's function kursawe's f2 function must go through all variables * evaluate function for zdt6 class zdt6's f1 function is different from the others zdt functions * Fix style * Replace Travis with Github Actions * setup.py deprecated in favor of setup.cfg * Add develop branch for triggering options * Replace build badge Co-authored-by: Yevhenii Semendiak <[email protected]> Co-authored-by: ajnebro <[email protected]> Co-authored-by: Marvin Steijaert <[email protected]> Co-authored-by: benhid <[email protected]> Co-authored-by: Sizhe Yuen <[email protected]> Co-authored-by: Antonio J. Nebro <[email protected]> Co-authored-by: Yevhenii Semendiak <[email protected]> Co-authored-by: Lingpho <[email protected]> Co-authored-by: Wojciech Lewicki <[email protected]> Co-authored-by: root <root@9575ed024558> Co-authored-by: Arysson Oliveira <[email protected]> Co-authored-by: Isabela <[email protected]>
- Loading branch information
1 parent
c3a7be2
commit 9cadc68
Showing
165 changed files
with
4,172 additions
and
3,380 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
name: CI | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- main | ||
- develop | ||
pull_request: | ||
branches: | ||
- main | ||
- develop | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
py: [ 3.9, 3.8, 3.7 ] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Install Python ${{ matrix.py }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.py }} | ||
- name: Get full Python version | ||
shell: bash | ||
run: echo ::set-output name=version::$(python -c "import sys; print('-'.join(str(v) for v in sys.version_info))") | ||
- name: Install dependencies | ||
shell: bash | ||
run: | | ||
python -m pip install --upgrade pip | ||
python -m pip install -e .[test] | ||
- name: Run unittest | ||
shell: bash | ||
run: python -m unittest discover -q |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: release | ||
|
||
on: | ||
push: | ||
tags: | ||
- '*.*.*' | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Install Python 3.7 | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.7 | ||
- name: Get full Python version | ||
shell: bash | ||
run: echo ::set-output name=version::$(python -c "import sys; print('-'.join(str(v) for v in sys.version_info))") | ||
- name: Build project for distribution | ||
shell: bash | ||
run: | | ||
python -m pip install -q build | ||
python -m build | ||
- name: Create Release | ||
uses: ncipollo/release-action@v1 | ||
with: | ||
artifacts: "dist/*" | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
draft: false | ||
prerelease: steps.check-version.outputs.prerelease == 'true' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -112,6 +112,5 @@ dask-worker-space | |
# osx | ||
.DS_Store | ||
|
||
# R | ||
.RData | ||
.Rhistory | ||
# Github codespaces | ||
pythonenv3.8 |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,20 @@ | ||
# Minimal makefile for Sphinx documentation | ||
# | ||
install: | ||
@python setup.py build install | ||
|
||
# You can set these variables from the command line. | ||
SPHINXOPTS = | ||
SPHINXBUILD = sphinx-build | ||
SPHINXPROJ = jMetalPy | ||
SOURCEDIR = docs/source | ||
BUILDDIR = build | ||
install-dependencies: | ||
@python -m pip install -e .[all] | ||
|
||
# Put it first so that "make" without argument is like "make help". | ||
help: | ||
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) | ||
clean: | ||
@rm -rf build dist .eggs *.egg-info | ||
@find . -type d -name '.mypy_cache' -exec rm -rf {} + | ||
@find . -type d -name '__pycache__' -exec rm -rf {} + | ||
|
||
.PHONY: help Makefile | ||
black: clean | ||
@isort --profile black jmetal/ examples/ | ||
@black jmetal/ examples/ | ||
|
||
# "make github" option to build gh-pages | ||
github: | ||
@make html | ||
@cp -a $(BUILDDIR)/html/. docs | ||
@rm -r $(BUILDDIR) | ||
lint: | ||
@mypy jmetal/ examples/ --show-error-codes | ||
|
||
# Catch-all target: route all unknown targets to Sphinx using the new | ||
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). | ||
%: Makefile | ||
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) | ||
tests: | ||
@python -m unittest discover -q |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,68 +1,75 @@ | ||
from jmetal.lab.experiment import generate_boxplot, generate_latex_tables, compute_mean_indicator, compute_wilcoxon | ||
from jmetal.lab.experiment import ( | ||
compute_mean_indicator, | ||
compute_wilcoxon, | ||
generate_boxplot, | ||
generate_latex_tables, | ||
) | ||
from jmetal.lab.statistical_test.bayesian import * | ||
from jmetal.lab.statistical_test.functions import * | ||
from jmetal.lab.visualization import CDplot, plot_posterior | ||
|
||
if __name__ == '__main__': | ||
if __name__ == "__main__": | ||
# Generate Median & IQR tables | ||
generate_latex_tables(filename='QualityIndicatorSummary.csv') | ||
generate_latex_tables(filename="QualityIndicatorSummary.csv") | ||
|
||
# Generate boxplots | ||
generate_boxplot(filename='QualityIndicatorSummary.csv') | ||
generate_boxplot(filename="QualityIndicatorSummary.csv") | ||
|
||
# Wilcoxon | ||
compute_wilcoxon(filename='QualityIndicatorSummary.csv') | ||
compute_wilcoxon(filename="QualityIndicatorSummary.csv") | ||
|
||
# Statistical lab | ||
|
||
avg = compute_mean_indicator(filename='QualityIndicatorSummary.csv', indicator_name='HV') | ||
avg = compute_mean_indicator(filename="QualityIndicatorSummary.csv", indicator_name="HV") | ||
print(avg) | ||
|
||
# Non-parametric test | ||
print('-------- Sign Test --------') | ||
print(sign_test(avg[['NSGAII', 'SMPSO']])) | ||
print('-------- Friedman Test --------') | ||
print("-------- Sign Test --------") | ||
print(sign_test(avg[["NSGAII", "SMPSO"]])) | ||
print("-------- Friedman Test --------") | ||
print(friedman_test(avg)) | ||
print('-------- Friedman Aligned Rank Test --------') | ||
print("-------- Friedman Aligned Rank Test --------") | ||
print(friedman_aligned_rank_test(avg)) | ||
print('-------- Quade Test --------') | ||
print("-------- Quade Test --------") | ||
print(quade_test(avg)) | ||
|
||
# Post-hoc tests | ||
print('-------- Friedman Post-Hoc Test --------') | ||
z, p_val, adj_pval = friedman_ph_test(avg, control=0, apv_procedure='Bonferroni') | ||
print('z values \n', z) | ||
print('p-values \n', p_val) | ||
print('adjusted p-values \n', adj_pval) | ||
print('-------- Friedman Aligned Rank Post-Hoc Test --------') | ||
z, p_val, adj_pval = friedman_aligned_ph_test(avg, apv_procedure='Shaffer') | ||
print('z values \n', z) | ||
print('p-values \n', p_val) | ||
print('adjusted p-values \n', adj_pval) | ||
print('-------- QuadeTest Post-Hoc Test --------') | ||
z, p_val, adj_pval = quade_ph_test(avg, apv_procedure='Holm') | ||
print('z values \n', z) | ||
print('p-values \n', p_val) | ||
print('adjusted p-values \n', adj_pval) | ||
print("-------- Friedman Post-Hoc Test --------") | ||
z, p_val, adj_pval = friedman_ph_test(avg, control=0, apv_procedure="Bonferroni") | ||
print("z values \n", z) | ||
print("p-values \n", p_val) | ||
print("adjusted p-values \n", adj_pval) | ||
print("-------- Friedman Aligned Rank Post-Hoc Test --------") | ||
z, p_val, adj_pval = friedman_aligned_ph_test(avg, apv_procedure="Shaffer") | ||
print("z values \n", z) | ||
print("p-values \n", p_val) | ||
print("adjusted p-values \n", adj_pval) | ||
print("-------- QuadeTest Post-Hoc Test --------") | ||
z, p_val, adj_pval = quade_ph_test(avg, apv_procedure="Holm") | ||
print("z values \n", z) | ||
print("p-values \n", p_val) | ||
print("adjusted p-values \n", adj_pval) | ||
|
||
# Plot critical distance | ||
|
||
CDplot(avg.T, alpha=0.15, higher_is_better=True) | ||
|
||
print('-------- Bayesian Sign Test --------') | ||
bst, DProcess = bayesian_sign_test(avg[['NSGAII', 'SMPSO']], rope_limits=[-0.002, 0.002], | ||
prior_strength=0.5, return_sample=True) | ||
plot_posterior(DProcess, higher_is_better=True, alg_names=['NSGAII', 'SMPSO']) | ||
print("-------- Bayesian Sign Test --------") | ||
bst, DProcess = bayesian_sign_test( | ||
avg[["NSGAII", "SMPSO"]], rope_limits=[-0.002, 0.002], prior_strength=0.5, return_sample=True | ||
) | ||
plot_posterior(DProcess, higher_is_better=True, alg_names=["NSGAII", "SMPSO"]) | ||
|
||
print('Pr(NSGAII < SMPSO) = %.3f' % bst[0]) | ||
print('Pr(NSGAII ~= SMPSO) = %.3f' % bst[1]) | ||
print('Pr(NSGAII > SMPSO) = %.3f' % bst[2]) | ||
print("Pr(NSGAII < SMPSO) = %.3f" % bst[0]) | ||
print("Pr(NSGAII ~= SMPSO) = %.3f" % bst[1]) | ||
print("Pr(NSGAII > SMPSO) = %.3f" % bst[2]) | ||
|
||
print('-------- Bayesian Signed Rank Test --------') | ||
bst, DProcess = bayesian_signed_rank_test(avg[['NSGAII', 'SMPSO']], rope_limits=[-0.002, 0.002], | ||
prior_strength=0.5, return_sample=True) | ||
plot_posterior(DProcess, higher_is_better=True, alg_names=['NSGAII', 'SMPSO']) | ||
print("-------- Bayesian Signed Rank Test --------") | ||
bst, DProcess = bayesian_signed_rank_test( | ||
avg[["NSGAII", "SMPSO"]], rope_limits=[-0.002, 0.002], prior_strength=0.5, return_sample=True | ||
) | ||
plot_posterior(DProcess, higher_is_better=True, alg_names=["NSGAII", "SMPSO"]) | ||
|
||
print('Pr(NSGAII < SMPSO) = %.3f' % bst[0]) | ||
print('Pr(NSGAII ~= SMPSO) = %.3f' % bst[1]) | ||
print('Pr(NSGAII > SMPSO) = %.3f' % bst[2]) | ||
print("Pr(NSGAII < SMPSO) = %.3f" % bst[0]) | ||
print("Pr(NSGAII ~= SMPSO) = %.3f" % bst[1]) | ||
print("Pr(NSGAII > SMPSO) = %.3f" % bst[2]) |
Oops, something went wrong.