diff --git a/docs/source/conf.py b/docs/source/conf.py index 67505546..72d6cfab 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -47,12 +47,17 @@ "sphinx.ext.autosectionlabel", "sphinx_autodoc_typehints", "sphinx_toolbox.more_autodoc.autoprotocol", + "sphinxcontrib.bibtex", ] nbsphinx_allow_errors = True # optional, avoids build breaking due to execution errors templates_path = ["_templates"] exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"] +bibtex_bibfiles = ["references.bib"] +bibtex_default_style = ( + "alpha" # set to alpha to not confuse references the docs with the footcites in docstrings. +) source_suffix = { ".rst": "restructuredtext", diff --git a/docs/source/example.md b/docs/source/example.md new file mode 100644 index 00000000..5d1708aa --- /dev/null +++ b/docs/source/example.md @@ -0,0 +1,3 @@ +# Example +`shapiq` is a Library for computing Shapley Interactions and Shapley Values +for Machine Learning {cite:p}`muschalikShapleyInteractions2024`. diff --git a/docs/source/index.rst b/docs/source/index.rst index b5de0b90..5e35e6f2 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -59,4 +59,5 @@ Contents :maxdepth: 1 :caption: BIBLIOGRAPHY - references + example + references_alternative diff --git a/docs/source/references.bib b/docs/source/references.bib new file mode 100644 index 00000000..b5b5c025 --- /dev/null +++ b/docs/source/references.bib @@ -0,0 +1,24 @@ +@inproceedings{muschalikShapleyInteractions2024, + author = {Maximilian Muschalik and + Hubert Baniecki and + Fabian Fumagalli and + Patrick Kolpaczki and + Barbara Hammer and + Eyke H{\"{u}}llermeier}, + editor = {Amir Globersons and + Lester Mackey and + Danielle Belgrave and + Angela Fan and + Ulrich Paquet and + Jakub M. Tomczak and + Cheng Zhang}, + title = {shapiq: Shapley Interactions for Machine Learning}, + booktitle = {Advances in Neural Information Processing Systems 38: Annual Conference + on Neural Information Processing Systems 2024, NeurIPS 2024, Vancouver, + BC, Canada, December 10 - 15, 2024}, + year = {2024}, + url = {http://papers.nips.cc/paper\_files/paper/2024/hash/eb3a9313405e2d4175a5a3cfcd49999b-Abstract-Datasets\_and\_Benchmarks\_Track.html}, + timestamp = {Thu, 13 Feb 2025 16:56:45 +0100}, + biburl = {https://dblp.org/rec/conf/nips/MuschalikBFKHH24.bib}, + bibsource = {dblp computer science bibliography, https://dblp.org} +} diff --git a/docs/source/references_alternative.rst b/docs/source/references_alternative.rst new file mode 100644 index 00000000..bb9c4e7d --- /dev/null +++ b/docs/source/references_alternative.rst @@ -0,0 +1,5 @@ +📚 Bibliography +=============== + +.. bibliography:: + :cited: diff --git a/pyproject.toml b/pyproject.toml index 73764922..3830179b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -231,6 +231,7 @@ docs = [ "sphinx-copybutton", "sphinx-autodoc-typehints", "sphinx_toolbox", + "sphinxcontrib-bibtex", # references based on bibtex "nbconvert", "nbsphinx", "commonmark", # Markdown parser and renderer diff --git a/shapiq/plot/si_graph.py b/shapiq/plot/si_graph.py index 8b9c2479..3c26bf75 100644 --- a/shapiq/plot/si_graph.py +++ b/shapiq/plot/si_graph.py @@ -61,7 +61,7 @@ def si_graph_plot( represent interactions between the players. The size of the nodes and edges represent the strength of the interaction values. The color of the edges represents the sign of the interaction values (red for positive and blue for negative). The SI-graph plot is presented in - Muschalik et al. (2024)[1]_. + :footcite:t:`muschalikShapleyInteractions2024`. Args: interaction_values: The interaction values to plot. @@ -146,7 +146,7 @@ def si_graph_plot( The figure and axis of the plot if ``show`` is ``False``. Otherwise, ``None``. References: - .. [1] Muschalik, M., Baniecki, H., Fumagalli, F., Kolpaczki, P., Hammer, B., and Hüllermeier, E. (2024). shapiq: Shapley Interactions for Machine Learning. In: The Thirty-eight Conference on Neural Information Processing Systems Datasets and Benchmarks Track. url: https://openreview.net/forum?id=knxGmi6SJi#discussion. + .. footbibliography:: """ if interaction_values is None: msg = "Interaction_values must be provided." diff --git a/uv.lock b/uv.lock index 796dacb7..cc1be33e 100644 --- a/uv.lock +++ b/uv.lock @@ -1644,6 +1644,15 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/3a/1d/50ad811d1c5dae091e4cf046beba925bcae0a610e79ae4c538f996f63ed5/kiwisolver-1.4.8-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:65ea09a5a3faadd59c2ce96dc7bf0f364986a315949dc6374f04396b0d60e09b", size = 71762 }, ] +[[package]] +name = "latexcodec" +version = "3.0.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/98/e7/ed339caf3662976949e4fdbfdf4a6db818b8d2aa1cf2b5f73af89e936bba/latexcodec-3.0.0.tar.gz", hash = "sha256:917dc5fe242762cc19d963e6548b42d63a118028cdd3361d62397e3b638b6bc5", size = 31023 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/b0/bf/ea8887e9f31a8f93ca306699d11909c6140151393a4216f0d9f85a004077/latexcodec-3.0.0-py3-none-any.whl", hash = "sha256:6f3477ad5e61a0a99bd31a6a370c34e88733a6bad9c921a3ffcfacada12f41a7", size = 18150 }, +] + [[package]] name = "lazy-loader" version = "0.4" @@ -2742,6 +2751,33 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/8e/37/efad0257dc6e593a18957422533ff0f87ede7c9c6ea010a2177d738fb82f/pure_eval-0.2.3-py3-none-any.whl", hash = "sha256:1db8e35b67b3d218d818ae653e27f06c3aa420901fa7b081ca98cbedc874e0d0", size = 11842 }, ] +[[package]] +name = "pybtex" +version = "0.24.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "latexcodec" }, + { name = "pyyaml" }, + { name = "six" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/46/9b/fd39836a6397fb363446d83075a7b9c2cc562f4c449292e039ed36084376/pybtex-0.24.0.tar.gz", hash = "sha256:818eae35b61733e5c007c3fcd2cfb75ed1bc8b4173c1f70b56cc4c0802d34755", size = 402879 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/ad/5f/40d8e90f985a05133a8895fc454c6127ecec3de8b095dd35bba91382f803/pybtex-0.24.0-py2.py3-none-any.whl", hash = "sha256:e1e0c8c69998452fea90e9179aa2a98ab103f3eed894405b7264e517cc2fcc0f", size = 561354 }, +] + +[[package]] +name = "pybtex-docutils" +version = "1.0.3" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "docutils" }, + { name = "pybtex" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/7e/84/796ea94d26188a853660f81bded39f8de4cfe595130aef0dea1088705a11/pybtex-docutils-1.0.3.tar.gz", hash = "sha256:3a7ebdf92b593e00e8c1c538aa9a20bca5d92d84231124715acc964d51d93c6b", size = 18348 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/11/b1/ce1f4596211efb5410e178a803f08e59b20bedb66837dcf41e21c54f9ec1/pybtex_docutils-1.0.3-py3-none-any.whl", hash = "sha256:8fd290d2ae48e32fcb54d86b0efb8d573198653c7e2447d5bec5847095f430b9", size = 6385 }, +] + [[package]] name = "pycparser" version = "2.22" @@ -3580,6 +3616,7 @@ dev = [ { name = "sphinx-autodoc-typehints" }, { name = "sphinx-copybutton" }, { name = "sphinx-toolbox" }, + { name = "sphinxcontrib-bibtex" }, { name = "twine" }, ] docs = [ @@ -3592,6 +3629,7 @@ docs = [ { name = "sphinx-autodoc-typehints" }, { name = "sphinx-copybutton" }, { name = "sphinx-toolbox" }, + { name = "sphinxcontrib-bibtex" }, ] lint = [ { name = "pre-commit" }, @@ -3649,6 +3687,7 @@ dev = [ { name = "sphinx-autodoc-typehints" }, { name = "sphinx-copybutton" }, { name = "sphinx-toolbox" }, + { name = "sphinxcontrib-bibtex" }, { name = "twine", specifier = ">=6.1.0" }, ] docs = [ @@ -3661,6 +3700,7 @@ docs = [ { name = "sphinx-autodoc-typehints" }, { name = "sphinx-copybutton" }, { name = "sphinx-toolbox" }, + { name = "sphinxcontrib-bibtex" }, ] lint = [ { name = "pre-commit", specifier = ">=4.2.0" }, @@ -3870,6 +3910,22 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/5d/85/9ebeae2f76e9e77b952f4b274c27238156eae7979c5421fba91a28f4970d/sphinxcontrib_applehelp-2.0.0-py3-none-any.whl", hash = "sha256:4cd3f0ec4ac5dd9c17ec65e9ab272c9b867ea77425228e68ecf08d6b28ddbdb5", size = 119300 }, ] +[[package]] +name = "sphinxcontrib-bibtex" +version = "2.6.3" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "docutils" }, + { name = "pybtex" }, + { name = "pybtex-docutils" }, + { name = "setuptools", marker = "python_full_version >= '3.12'" }, + { name = "sphinx" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/c1/ce/054a8ec04063f9a27772fea7188f796edbfa382e656d3b76428323861f0e/sphinxcontrib_bibtex-2.6.3.tar.gz", hash = "sha256:7c790347ef1cb0edf30de55fc324d9782d085e89c52c2b8faafa082e08e23946", size = 117177 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/8e/49/c23f9493c0a5d5881fb7ed3002e87708454fef860aa96a48e755d27bf6f0/sphinxcontrib_bibtex-2.6.3-py3-none-any.whl", hash = "sha256:ff016b738fcc867df0f75c29e139b3b2158d26a2c802db27963cb128be3b75fb", size = 40340 }, +] + [[package]] name = "sphinxcontrib-devhelp" version = "2.0.0"