-
Hi, I have a question about variable features extracted from NodeBipartiteObs module. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi @th-yoon , The variable features in 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_features[lppos_vars_in_lp] See also this post which is very related: Hope that helps, Best, |
Beta Was this translation helpful? Give feedback.
Hi @th-yoon ,
The variable features in
NodeBipartiteObs
indeed are extracted for all variables in the current node's LP (obtained fromSCIPgetLPCols()
). 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 inNodeBipartiteObs
, you can use something like this: