iscan.shifted_nodes.est_node_shifts

iscan.shifted_nodes.est_node_shifts(X: numpy.ndarray | torch.Tensor, Y: numpy.ndarray | torch.Tensor, eta_G: float = 0.001, eta_H: float = 0.001, normalize_var: bool = False, shifted_node_thres: float = 2.0, elbow: bool = False, elbow_thres: float = 30.0, elbow_online: bool = True, use_both_rank: bool = True, verbose: bool = False) tuple[list, list, dict]
Implementation of the iSCAN method of Chen et al. (2023).
Returns an estimated topological ordering, and estimated shifted nodes

References

Parameters:
X : Union[np.ndarray, torch.Tensor]

Dataset with shape \((n,d)\), where \(n\) is the number of samples, and \(d\) is the number of variables/nodes.

Y : Union[np.ndarray, torch.Tensor]

Dataset with shape \((n,d)\), where \(n\) is the number of samples, and \(d\) is the number of variables/nodes.

eta_G : float, optional

hyperparameter for the score’s Jacobian estimation, by default 0.001.

eta_H : float, optional

hyperparameter for the score’s Jacobian estimation, by default 0.001.

normalize_var : bool, optional

If True, the Hessian’s diagonal is normalized by the expected value, by default False.

shifted_node_thres : float, optional

Threshold to decide whether or not a variable has a distribution shift, by default 2.

elbow : bool, optional

If True, iscan uses the elbow heuristic to determine shifted nodes. By default True.

elbow_thres : float, optional

If using the elbow method, elbow_thres is the hard_thres in find_elbow() function, by default 30.

elbow_online : bool, optional

If using the elbow method, elbow_online is online in find_elbow() function, by default True.

use_both_rank : bool, optional

estimate topo order by X’s and Y’s rank sum. If False, only use X for topo order, by default False.

verbose : bool, optional

If True, prints to stdout the variances of the Hessian entries for the running leafs. By default False.

Returns:

estimated shifted nodes, topological order, and dict of variance ratios for all nodes.

Return type:

Tuple[list, list, dict]


Last update: Jan 14, 2024