  Fair machine learning aims to avoid treating individuals or sub-populations
unfavourably based on \textit{sensitive attributes}, such as gender and race.
Those methods in fair machine learning that are built on causal inference
ascertain discrimination and bias through causal effects. Though
causality-based fair learning is attracting increasing attention, current
methods assume the true causal graph is fully known. This paper proposes a
general method to achieve the notion of counterfactual fairness when the true
causal graph is unknown. To be able to select features that lead to
counterfactual fairness, we derive the conditions and algorithms to identify
ancestral relations between variables on a \textit{Partially Directed Acyclic
Graph (PDAG)}, specifically, a class of causal DAGs that can be learned from
observational data combined with domain knowledge. Interestingly, we find that
counterfactual fairness can be achieved as if the true causal graph were fully
known, when specific background knowledge is provided: the sensitive attributes
do not have ancestors in the causal graph. Results on both simulated and
real-world datasets demonstrate the effectiveness of our method.
