  Machine learning can benefit from causal discovery for interpretation and
from causal inference for generalization. In this line of research, a few
invariant learning algorithms for out-of-distribution (OOD) generalization have
been proposed by using multiple training environments to find invariant
relationships. Some of them are focused on causal discovery as Invariant Causal
Prediction (ICP), which finds causal parents of a variable of interest, and
some directly provide a causal optimal predictor that generalizes well in OOD
environments as Invariant Risk Minimization (IRM). This group of algorithms
works under the assumption of multiple environments that represent different
interventions in the causal inference context. Those environments are not
normally available when working with observational data and real-world
applications. Here we propose a method to generate them in an efficient way. We
assess the performance of this unsupervised learning problem by implementing
ICP on simulated data. We also show how to apply ICP efficiently integrated
with our method for causal discovery. Finally, we proposed an improved version
of our method in combination with ICP for datasets with multiple covariates
where ICP and other causal discovery methods normally degrade in performance.
