.. note:: :class: sphx-glr-download-link-note Click :ref:`here ` to download the full example code .. rst-class:: sphx-glr-example-title .. _sphx_glr_auto_examples_cross_val.py: ============================================ Perform cross validation on a pruneable tree ============================================ Calculate the cross validation score of a :class:`pruneabletree.prune.PruneableDecisionTreeClassifier` using the Reduced Error Pruning strategy trained on pairs of features of the iris dataset. .. code-block:: python print(__doc__) from sklearn.datasets import load_iris from sklearn.model_selection import cross_val_score from pruneabletree import PruneableDecisionTreeClassifier clf = PruneableDecisionTreeClassifier(random_state=0, prune='rep') iris = load_iris() print(cross_val_score(clf, iris.data, iris.target, cv=10)) **Total running time of the script:** ( 0 minutes 0.000 seconds) .. _sphx_glr_download_auto_examples_cross_val.py: .. only :: html .. container:: sphx-glr-footer :class: sphx-glr-footer-example .. container:: sphx-glr-download :download:`Download Python source code: cross_val.py ` .. container:: sphx-glr-download :download:`Download Jupyter notebook: cross_val.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_