Skip to content

is variable feature from NodeBipartiteObs sorted by unique index? #236

Answered by gasse
th-yoon asked this question in Questions
Discussion options

You must be logged in to vote

Hi @th-yoon ,

The variable features in NodeBipartiteObs indeed are extracted for all variables in the current node's LP (obtained from SCIPgetLPCols()). They are also registered in the same order, and thus can be indexed using the column position (var.getCol().getLPPos()) of the variables. So, if you have a list of variables and you want to get their associated features in NodeBipartiteObs, you can use something like this:

import numpy as np

obs = ...  # NodeBipartiteObs

m = model.as_pyscipopt()
vars = m.getVars(transformed=True)
vars_in_lp = [var for var in vars if var.isInLP()]
lppos_vars_in_lp = np.asarray([var.getCol().getLPPos() for var in vars_in_lp])
feats_vars_in_lp = obs.column…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@th-yoon
Comment options

Answer selected by th-yoon
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants