Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
r_prag01 committed Aug 25, 2023
2 parents f43397b + 4e80a0d commit 4689566
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 10 deletions.
20 changes: 19 additions & 1 deletion Readme.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
![Github Status](https://github.com/reiyan/pflacco/actions/workflows/python-package.yml/badge.svg?branch=master)
![Github Status](https://github.com/reiyan/pflacco/actions/workflows/python-package.yml/badge.svg?branch=master) [![Documentation Status](https://readthedocs.org/projects/pflacco/badge/?version=latest)](https://pflacco.readthedocs.io/en/latest/?badge=latest)
# pflacco: The R-package flacco in native Python code
For people who are not comfortable with R.

Expand Down Expand Up @@ -152,6 +152,24 @@ for fid in range(1,25):
features = pd.concat(features).reset_index(drop = True)
```

## Citation
If you are using pflacco in any capacity, I would appreciate a citation. You can use the following bibtex:
```
@article{10.1162/evco_a_00341,
author = {Prager, Raphael Patrick and Trautmann, Heike},
title = "{Pflacco: Feature-Based Landscape Analysis of Continuous and Constrained Optimization Problems in Python}",
journal = {Evolutionary Computation},
pages = {1-25},
year = {2023},
month = {07},
abstract = "{The herein proposed Python package pflacco provides a set of numerical features to characterize single-objective continuous and constrained optimization problems. Thereby, pflacco addresses two major challenges in the area optimization. Firstly, it provides the means to develop an understanding of a given problem instance, which is crucial for designing, selecting, or configuring optimization algorithms in general. Secondly, these numerical features can be utilized in the research streams of automated algorithm selection and configuration. While the majority of these landscape features is already available in the R package flacco, our Python implementation offers these tools to an even wider audience and thereby promotes research interests and novel avenues in the area of optimization.}",
issn = {1063-6560},
doi = {10.1162/evco_a_00341},
url = {https://doi.org/10.1162/evco\_a\_00341},
eprint = {https://direct.mit.edu/evco/article-pdf/doi/10.1162/evco\_a\_00341/2148122/evco\_a\_00341.pdf},
}
```

## Documentation
A comprehensive documentation can be found [here](https://pflacco.readthedocs.io/en/latest/index.html).

Expand Down
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
copyright = '2022, Raphael Patrick Prager'
author = 'Raphael Patrick Prager'
version = '1.2'
release = '1.2.1'
release = '1.2.2'

# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
Expand Down
14 changes: 7 additions & 7 deletions pflacco/classical_ela_features.py
Original file line number Diff line number Diff line change
Expand Up @@ -321,9 +321,9 @@ def calculate_nbc(
i = i[-1]
else:
raise ValueError('Possible tie breaker methods are "sample", "first", and "last"')

# Transform array of length 1 to a single scalar
i = i[0]
else:
# Transform array of length 1 to a single scalar
i = i[0]

results.append([idx, ind_alt[i], d[i]])

Expand Down Expand Up @@ -495,7 +495,7 @@ def calculate_information_content(
"""
start_time = time.monotonic()
X, y = _validate_variable_types(X, y)

n = X.shape[1]
ic_aggregate_duplicated = 'mean'
if not np.issubdtype(ic_epsilon.dtype, np.number):
Expand All @@ -521,8 +521,8 @@ def calculate_information_content(
complete = pd.concat([X, pd.DataFrame(y, columns = ['y'])], axis = 1).duplicated()
# Remove complete duplicates, because these cannot be aggregated using e.g. the mean of y
if complete.any():
X = X[~complete]
y = y[~complete]
X = X[~complete].reset_index(drop=True)
y = y[~complete].reset_index(drop=True)
dup_index = X.duplicated(keep = False)

# TODO Check with Pascal: the next line seems utterly pointless, a flip of the second array is missing. yes double flip.. that is why it is pointless.
Expand All @@ -534,7 +534,7 @@ def calculate_information_content(

while len(v) > 1:
index = np.array([(Z.iloc[0] == Z.iloc[idx]).all() for idx in range(Z.shape[0])])
X = pd.concat([X, Z.iloc[[0]]], ignore_index = True)
X = pd.concat([X, Z.iloc[[0]]], ignore_index = True).reset_index(drop = True)
Z = Z[~index]
y = pd.concat([y, pd.DataFrame([v[index].mean()])], ignore_index = True)
v = v[~index]
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

setuptools.setup(
name='pflacco',
version='1.2.1',
version='1.2.2',
author="Raphael Patrick Prager",
author_email="[email protected]",
description="A Python implementation and extension to the R package flacco for computing ELA features.",
Expand Down

0 comments on commit 4689566

Please sign in to comment.