Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem obtaining the instances used during the run #63

Closed
ThomasF59 opened this issue Sep 29, 2023 · 1 comment
Closed

Problem obtaining the instances used during the run #63

ThomasF59 opened this issue Sep 29, 2023 · 1 comment

Comments

@ThomasF59
Copy link

Hello,
to this line :

# Get index of the instances

It says: pair.id <- which(!is.na(all.exp))
pair.id is normally supposed to correspond to the rowname and therefore the instances used, but it returns something else. The latter returns the index of non-empty cells if the dataframe is transformed into a huge column-by-column vector. So in the pdf, the mechanism returns instances but not the ones used.
To fix this, write :
pair.id <- which(!is.na(all.exp), arr.ind=TRUE)[, "row"]
There will be no conversion to vector.
I tested on irace 3.5 and with an all.exp of 32x1492

@MLopez-Ibanez
Copy link
Owner

Hi Thomas,

The example there is designed to work when all.exp is a vector, so is.na() and which() return vectors.

If you select two configurations or more, then all.exp is a matrix and, you would need to choose of these two options:

# You want instances where all configurations have been evaluated:
pair.id <- which(apply(!is.na(all.exp), 1, all))
# You want instances where at least one configuration has been evaluated:
pair.id <- which(apply(!is.na(all.exp), 1, any))

For the next version of irace, I am going to change this example to make the above clearer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants