diff --git a/.buildinfo b/.buildinfo new file mode 100644 index 0000000..044dbba --- /dev/null +++ b/.buildinfo @@ -0,0 +1,4 @@ +# Sphinx build info version 1 +# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. +config: f51136111eba58b7ed8810f833e65d91 +tags: 645f666f9bcd5a90fca523b33c5a78b7 diff --git a/.nojekyll b/.nojekyll new file mode 100644 index 0000000..e69de29 diff --git a/_downloads/07fcc19ba03226cd3d83d4e40ec44385/auto_examples_python.zip b/_downloads/07fcc19ba03226cd3d83d4e40ec44385/auto_examples_python.zip new file mode 100644 index 0000000..bb499fc Binary files /dev/null and b/_downloads/07fcc19ba03226cd3d83d4e40ec44385/auto_examples_python.zip differ diff --git a/_downloads/084669b45b226af6f637ab8457c8c5aa/plot_classifier.py b/_downloads/084669b45b226af6f637ab8457c8c5aa/plot_classifier.py new file mode 100644 index 0000000..c09fd11 --- /dev/null +++ b/_downloads/084669b45b226af6f637ab8457c8c5aa/plot_classifier.py @@ -0,0 +1,41 @@ +""" +============================ +Plotting Template Classifier +============================ + +An example plot of :class:`skltemplate.template.TemplateClassifier` +""" + +# %% +# Train our classifier on very simple dataset +from skltemplate import TemplateClassifier + +X = [[0, 0], [1, 1]] +y = [0, 1] +clf = TemplateClassifier().fit(X, y) + +# %% +# Create a test dataset +import numpy as np + +rng = np.random.RandomState(13) +X_test = rng.rand(500, 2) + +# %% +# Use scikit-learn to display the decision boundary +from sklearn.inspection import DecisionBoundaryDisplay + +disp = DecisionBoundaryDisplay.from_estimator(clf, X_test) +disp.ax_.scatter( + X_test[:, 0], + X_test[:, 1], + c=clf.predict(X_test), + s=20, + edgecolors="k", + linewidths=0.5, +) +disp.ax_.set( + xlabel="Feature 1", + ylabel="Feature 2", + title="Template Classifier Decision Boundary", +) diff --git a/_downloads/2844e15e96683b9e78e43f57c6f47e9e/plot_template.py b/_downloads/2844e15e96683b9e78e43f57c6f47e9e/plot_template.py new file mode 100644 index 0000000..ab473da --- /dev/null +++ b/_downloads/2844e15e96683b9e78e43f57c6f47e9e/plot_template.py @@ -0,0 +1,18 @@ +""" +=========================== +Plotting Template Estimator +=========================== + +An example plot of :class:`skltemplate.template.TemplateEstimator` +""" +import numpy as np +from matplotlib import pyplot as plt + +from skltemplate import TemplateEstimator + +X = np.arange(100).reshape(100, 1) +y = np.zeros((100,)) +estimator = TemplateEstimator() +estimator.fit(X, y) +plt.plot(estimator.predict(X)) +plt.show() diff --git a/_downloads/33e3b8fda2687ae96879282d905830b7/plot_template.ipynb b/_downloads/33e3b8fda2687ae96879282d905830b7/plot_template.ipynb new file mode 100644 index 0000000..b10cb43 --- /dev/null +++ b/_downloads/33e3b8fda2687ae96879282d905830b7/plot_template.ipynb @@ -0,0 +1,43 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "\n# Plotting Template Estimator\n\nAn example plot of :class:`skltemplate.template.TemplateEstimator`\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "import numpy as np\nfrom matplotlib import pyplot as plt\n\nfrom skltemplate import TemplateEstimator\n\nX = np.arange(100).reshape(100, 1)\ny = np.zeros((100,))\nestimator = TemplateEstimator()\nestimator.fit(X, y)\nplt.plot(estimator.predict(X))\nplt.show()" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.12.3" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} \ No newline at end of file diff --git a/_downloads/35939d2f12dbb3de2b921c8a33dd72c2/plot_transformer.py b/_downloads/35939d2f12dbb3de2b921c8a33dd72c2/plot_transformer.py new file mode 100644 index 0000000..4263906 --- /dev/null +++ b/_downloads/35939d2f12dbb3de2b921c8a33dd72c2/plot_transformer.py @@ -0,0 +1,27 @@ +""" +============================= +Plotting Template Transformer +============================= + +An example plot of :class:`skltemplate.template.TemplateTransformer` +""" +import numpy as np +from matplotlib import pyplot as plt + +from skltemplate import TemplateTransformer + +X = np.arange(50, dtype=np.float64).reshape(-1, 1) +X /= 50 +estimator = TemplateTransformer() +X_transformed = estimator.fit_transform(X) + +plt.plot(X.flatten(), label="Original Data") +plt.plot(X_transformed.flatten(), label="Transformed Data") +plt.title("Plots of original and transformed data") + +plt.legend(loc="best") +plt.grid(True) +plt.xlabel("Index") +plt.ylabel("Value of Data") + +plt.show() diff --git a/_downloads/5b2cebfab9d8cca4393d66b1e4b8a8e7/plot_transformer.ipynb b/_downloads/5b2cebfab9d8cca4393d66b1e4b8a8e7/plot_transformer.ipynb new file mode 100644 index 0000000..829d205 --- /dev/null +++ b/_downloads/5b2cebfab9d8cca4393d66b1e4b8a8e7/plot_transformer.ipynb @@ -0,0 +1,43 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "\n# Plotting Template Transformer\n\nAn example plot of :class:`skltemplate.template.TemplateTransformer`\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "import numpy as np\nfrom matplotlib import pyplot as plt\n\nfrom skltemplate import TemplateTransformer\n\nX = np.arange(50, dtype=np.float64).reshape(-1, 1)\nX /= 50\nestimator = TemplateTransformer()\nX_transformed = estimator.fit_transform(X)\n\nplt.plot(X.flatten(), label=\"Original Data\")\nplt.plot(X_transformed.flatten(), label=\"Transformed Data\")\nplt.title(\"Plots of original and transformed data\")\n\nplt.legend(loc=\"best\")\nplt.grid(True)\nplt.xlabel(\"Index\")\nplt.ylabel(\"Value of Data\")\n\nplt.show()" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.12.3" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} \ No newline at end of file diff --git a/_downloads/6f1e7a639e0699d6164445b55e6c116d/auto_examples_jupyter.zip b/_downloads/6f1e7a639e0699d6164445b55e6c116d/auto_examples_jupyter.zip new file mode 100644 index 0000000..1dcabed Binary files /dev/null and b/_downloads/6f1e7a639e0699d6164445b55e6c116d/auto_examples_jupyter.zip differ diff --git a/_downloads/fed3e85cac62fc93e088aa8cb008d467/plot_classifier.ipynb b/_downloads/fed3e85cac62fc93e088aa8cb008d467/plot_classifier.ipynb new file mode 100644 index 0000000..ecc13d5 --- /dev/null +++ b/_downloads/fed3e85cac62fc93e088aa8cb008d467/plot_classifier.ipynb @@ -0,0 +1,86 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "\n# Plotting Template Classifier\n\nAn example plot of :class:`skltemplate.template.TemplateClassifier`\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Train our classifier on very simple dataset\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "from skltemplate import TemplateClassifier\n\nX = [[0, 0], [1, 1]]\ny = [0, 1]\nclf = TemplateClassifier().fit(X, y)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Create a test dataset\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "import numpy as np\n\nrng = np.random.RandomState(13)\nX_test = rng.rand(500, 2)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Use scikit-learn to display the decision boundary\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "from sklearn.inspection import DecisionBoundaryDisplay\n\ndisp = DecisionBoundaryDisplay.from_estimator(clf, X_test)\ndisp.ax_.scatter(\n X_test[:, 0],\n X_test[:, 1],\n c=clf.predict(X_test),\n s=20,\n edgecolors=\"k\",\n linewidths=0.5,\n)\ndisp.ax_.set(\n xlabel=\"Feature 1\",\n ylabel=\"Feature 2\",\n title=\"Template Classifier Decision Boundary\",\n)" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.12.3" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} \ No newline at end of file diff --git a/_images/index_api.svg b/_images/index_api.svg new file mode 100644 index 0000000..69f7ba1 --- /dev/null +++ b/_images/index_api.svg @@ -0,0 +1,97 @@ + + + + diff --git a/_images/index_examples.svg b/_images/index_examples.svg new file mode 100644 index 0000000..de3d902 --- /dev/null +++ b/_images/index_examples.svg @@ -0,0 +1,76 @@ + + + + diff --git a/_images/index_getting_started.svg b/_images/index_getting_started.svg new file mode 100644 index 0000000..2d36622 --- /dev/null +++ b/_images/index_getting_started.svg @@ -0,0 +1,66 @@ + + + + diff --git a/_images/index_user_guide.svg b/_images/index_user_guide.svg new file mode 100644 index 0000000..bd17053 --- /dev/null +++ b/_images/index_user_guide.svg @@ -0,0 +1,67 @@ + + + + diff --git a/_images/sphx_glr_plot_classifier_001.png b/_images/sphx_glr_plot_classifier_001.png new file mode 100644 index 0000000..cb6627c Binary files /dev/null and b/_images/sphx_glr_plot_classifier_001.png differ diff --git a/_images/sphx_glr_plot_classifier_thumb.png b/_images/sphx_glr_plot_classifier_thumb.png new file mode 100644 index 0000000..21c06e4 Binary files /dev/null and b/_images/sphx_glr_plot_classifier_thumb.png differ diff --git a/_images/sphx_glr_plot_template_001.png b/_images/sphx_glr_plot_template_001.png new file mode 100644 index 0000000..389451f Binary files /dev/null and b/_images/sphx_glr_plot_template_001.png differ diff --git a/_images/sphx_glr_plot_template_thumb.png b/_images/sphx_glr_plot_template_thumb.png new file mode 100644 index 0000000..41b0302 Binary files /dev/null and b/_images/sphx_glr_plot_template_thumb.png differ diff --git a/_images/sphx_glr_plot_transformer_001.png b/_images/sphx_glr_plot_transformer_001.png new file mode 100644 index 0000000..8f50fe6 Binary files /dev/null and b/_images/sphx_glr_plot_transformer_001.png differ diff --git a/_images/sphx_glr_plot_transformer_thumb.png b/_images/sphx_glr_plot_transformer_thumb.png new file mode 100644 index 0000000..3ad084e Binary files /dev/null and b/_images/sphx_glr_plot_transformer_thumb.png differ diff --git a/_sources/api.rst.txt b/_sources/api.rst.txt new file mode 100644 index 0000000..108342c --- /dev/null +++ b/_sources/api.rst.txt @@ -0,0 +1,48 @@ +.. _api: + +############# +API Reference +############# + +This is an example on how to document the API of your own project. + +.. currentmodule:: skltemplate + +Estimator +========= + +.. autosummary:: + :toctree: generated/ + :template: class.rst + + TemplateEstimator + +Transformer +=========== + +.. autosummary:: + :toctree: generated/ + :template: class.rst + + TemplateTransformer + +Predictor +========= + +.. autosummary:: + :toctree: generated/ + :template: class.rst + + TemplateClassifier + + +Utilities +========= + +.. autosummary:: + :toctree: generated/ + :template: functions.rst + + utils.discovery.all_estimators + utils.discovery.all_displays + utils.discovery.all_functions diff --git a/_sources/auto_examples/index.rst.txt b/_sources/auto_examples/index.rst.txt new file mode 100644 index 0000000..7233c57 --- /dev/null +++ b/_sources/auto_examples/index.rst.txt @@ -0,0 +1,101 @@ +:orphan: + +.. _general_examples: + +Example Gallery +=============== + +Introductory examples. + + + +.. raw:: html + +