Skip to content

Commit

Permalink
[ENH] Add the classifier CI test (py-why#28)
Browse files Browse the repository at this point in the history
* Adding classifier CI test (ccit) and unit test
* Adds a simulation module for simulating non-linear additive noise models
* Add flaky to the unit test suite CCIT
* Address typing issues with regards to adding sklearn and pytorch NN modules as the "classifier"

Signed-off-by: Adam Li <adam2392@gmail.com>
  • Loading branch information
adam2392 committed Sep 22, 2022
1 parent 5b7465b commit 0771188
Show file tree
Hide file tree
Showing 11 changed files with 715 additions and 84 deletions.
1 change: 1 addition & 0 deletions doc/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ learning.
KernelCITest
GSquareCITest
FisherZCITest
ClassifierCITest

Graph protocols
===============
Expand Down
14 changes: 12 additions & 2 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,9 @@
"node",
"nodes",
"graph",
# numpy
"ScalarType",
"ArrayLike",
# shapes
"n_times",
"obj",
Expand All @@ -128,6 +131,9 @@
"n_variables",
"n_classes",
"NDArray",
# deep learning
"pytorch",
"model",
}
numpydoc_xref_aliases = {
# Networkx
Expand All @@ -142,11 +148,14 @@
"DAG": "dodiscover.DAG",
"BaseConditionalIndependenceTest": "dodiscover.ci.BaseConditionalIndependenceTest",
"Context": "dodiscover.Context",
"Column": "dodiscover.typing.Column",
# joblib
"joblib.Parallel": "joblib.Parallel",
# numpy
"NDArray": "numpy.ndarray",
"ArrayLike": ":term:`array_like`",
# pandas
"pd.DataFrame": "pandas.DataFrame",
"pandas.DataFrame": "pandas.DataFrame",
"column": "pandas.DataFrame.columns",
}

Expand Down Expand Up @@ -175,14 +184,15 @@

intersphinx_mapping = {
"python": ("https://docs.python.org/3", None),
"numpy": ("https://numpy.org/devdocs", None),
"numpy": ("https://numpy.org/doc/stable/", None),
"scipy": ("https://scipy.github.io/devdocs", None),
"pandas": ("https://pandas.pydata.org/pandas-docs/dev", None),
"networkx": ("https://networkx.org/documentation/latest/", None),
"pgmpy": ("https://pgmpy.org", None),
"sklearn": ("https://scikit-learn.org/stable", None),
"joblib": ("https://joblib.readthedocs.io/en/latest", None),
"matplotlib": ("https://matplotlib.org/stable", None),
"torch": ("https://pytorch.org/docs/master/", None),
}
intersphinx_timeout = 5

Expand Down
15 changes: 15 additions & 0 deletions doc/references.bib
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@ @article{Colombo2012
url = {https://doi.org/10.1214/11-AOS940}
}

@article{Lopez2016revisiting,
title = {Revisiting classifier two-sample tests},
author = {Lopez-Paz, David and Oquab, Maxime},
journal = {arXiv preprint arXiv:1610.06545},
year = {2016}
}

@article{Meek1995,
author = {Meek, Christopher},
year = {2013},
Expand All @@ -37,6 +44,14 @@ @book{Neapolitan2003
doi = {10.1145/1327942.1327961}
}

@article{Sen2017model,
title = {Model-powered conditional independence test},
author = {Sen, Rajat and Suresh, Ananda Theertha and Shanmugam, Karthikeyan and Dimakis, Alexandros G and Shakkottai, Sanjay},
journal = {Advances in neural information processing systems},
volume = {30},
year = {2017}
}

@article{Zhang2008,
title = {On the completeness of orientation rules for causal discovery in the presence of latent confounders and selection bias},
journal = {Artificial Intelligence},
Expand Down
1 change: 1 addition & 0 deletions doc/whats_new/v0.1.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ Changelog
- |Feature| Implement conditional independence tests under the ``dodiscover.ci`` submodule, by `Adam Li`_ (:pr:`16`)
- |Feature| Implement skeleton learning method, :class:`dodiscover.constraint.LearnSkeleton` under the ``dodiscover.constraint`` submodule, by `Adam Li`_ (:pr:`20`)
- |Feature| Implement confusion matrix method for comparing networkx-like graphs, :func:`dodiscover.metrics.confusion_matrix_networks`, by `Adam Li`_ (:pr:`48`)
- |Feature| Implement classification-based CI test (CCIT), :class:`dodiscover.ci.ClassifierCITest` under the ``dodiscover.ci`` submodule, by `Adam Li`_ (:pr:`28`)


Code and Documentation Contributors
Expand Down
1 change: 1 addition & 0 deletions dodiscover/ci/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from .base import BaseConditionalIndependenceTest
from .clf_test import ClassifierCITest
from .fisher_z_test import FisherZCITest
from .g_test import GSquareCITest
from .kernel_test import KernelCITest
Expand Down
Loading

0 comments on commit 0771188

Please sign in to comment.