%global _empty_manifest_terminate_build 0 Name: python-dtreeplt Version: 0.1.43 Release: 1 Summary: Visualize Decision Tree without Graphviz. License: MIT URL: https://github.com/nekoumei/dtreeplt Source0: https://mirrors.aliyun.com/pypi/web/packages/8d/de/403ad62e0b27a65259fff36b9b27d46d9cb055fe7cd4ff166dfb72c4f3e5/dtreeplt-0.1.43.tar.gz BuildArch: noarch Requires: python3-numpy Requires: python3-matplotlib Requires: python3-scikit-learn Requires: python3-ipython Requires: python3-ipywidgets %description # dtreeplt it draws Decision Tree not using Graphviz, but only matplotlib. If `interactive == True`, it draws Interactive Decision Tree on Notebook. ## Output Image using proposed method: dtreeplt (using only matplotlib) ![graphviz](output/result.png) ## Output Image using conventional method: export_graphviz (Using Graphviz) ![graphviz](output/using_graphviz.png) ## Output Image using dtreeplt Interactive Decision Tree ![graphviz](output/idt_demo.gif) ## Installation If you want to use the latest version, please use them on git. `pip install git+https://github.com/nekoumei/dtreeplt.git` when it comes to update, command like below. `pip install git+https://github.com/nekoumei/dtreeplt.git -U` Requirements: see requirements.txt Python 3.6.X. ## Usage ### Quick Start ```python from dtreeplt import dtreeplt dtree = dtreeplt() dtree.view() # If you want to use interactive mode, set the parameter like below. # dtree.view(interactive=True) ``` ### Using trained DecisionTreeClassifier ```python # You should prepare trained model,feature_names, target_names. # in this example, use iris datasets. from sklearn.datasets import load_iris from sklearn.tree import DecisionTreeClassifier from dtreeplt import dtreeplt iris = load_iris() model = DecisionTreeClassifier() model.fit(iris.data, iris.target) dtree = dtreeplt( model=model, feature_names=iris.feature_names, target_names=iris.target_names ) fig = dtree.view() #if you want save figure, use savefig method in returned figure object. #fig.savefig('output.png') ``` %package -n python3-dtreeplt Summary: Visualize Decision Tree without Graphviz. Provides: python-dtreeplt BuildRequires: python3-devel BuildRequires: python3-setuptools BuildRequires: python3-pip %description -n python3-dtreeplt # dtreeplt it draws Decision Tree not using Graphviz, but only matplotlib. If `interactive == True`, it draws Interactive Decision Tree on Notebook. ## Output Image using proposed method: dtreeplt (using only matplotlib) ![graphviz](output/result.png) ## Output Image using conventional method: export_graphviz (Using Graphviz) ![graphviz](output/using_graphviz.png) ## Output Image using dtreeplt Interactive Decision Tree ![graphviz](output/idt_demo.gif) ## Installation If you want to use the latest version, please use them on git. `pip install git+https://github.com/nekoumei/dtreeplt.git` when it comes to update, command like below. `pip install git+https://github.com/nekoumei/dtreeplt.git -U` Requirements: see requirements.txt Python 3.6.X. ## Usage ### Quick Start ```python from dtreeplt import dtreeplt dtree = dtreeplt() dtree.view() # If you want to use interactive mode, set the parameter like below. # dtree.view(interactive=True) ``` ### Using trained DecisionTreeClassifier ```python # You should prepare trained model,feature_names, target_names. # in this example, use iris datasets. from sklearn.datasets import load_iris from sklearn.tree import DecisionTreeClassifier from dtreeplt import dtreeplt iris = load_iris() model = DecisionTreeClassifier() model.fit(iris.data, iris.target) dtree = dtreeplt( model=model, feature_names=iris.feature_names, target_names=iris.target_names ) fig = dtree.view() #if you want save figure, use savefig method in returned figure object. #fig.savefig('output.png') ``` %package help Summary: Development documents and examples for dtreeplt Provides: python3-dtreeplt-doc %description help # dtreeplt it draws Decision Tree not using Graphviz, but only matplotlib. If `interactive == True`, it draws Interactive Decision Tree on Notebook. ## Output Image using proposed method: dtreeplt (using only matplotlib) ![graphviz](output/result.png) ## Output Image using conventional method: export_graphviz (Using Graphviz) ![graphviz](output/using_graphviz.png) ## Output Image using dtreeplt Interactive Decision Tree ![graphviz](output/idt_demo.gif) ## Installation If you want to use the latest version, please use them on git. `pip install git+https://github.com/nekoumei/dtreeplt.git` when it comes to update, command like below. `pip install git+https://github.com/nekoumei/dtreeplt.git -U` Requirements: see requirements.txt Python 3.6.X. ## Usage ### Quick Start ```python from dtreeplt import dtreeplt dtree = dtreeplt() dtree.view() # If you want to use interactive mode, set the parameter like below. # dtree.view(interactive=True) ``` ### Using trained DecisionTreeClassifier ```python # You should prepare trained model,feature_names, target_names. # in this example, use iris datasets. from sklearn.datasets import load_iris from sklearn.tree import DecisionTreeClassifier from dtreeplt import dtreeplt iris = load_iris() model = DecisionTreeClassifier() model.fit(iris.data, iris.target) dtree = dtreeplt( model=model, feature_names=iris.feature_names, target_names=iris.target_names ) fig = dtree.view() #if you want save figure, use savefig method in returned figure object. #fig.savefig('output.png') ``` %prep %autosetup -n dtreeplt-0.1.43 %build %py3_build %install %py3_install install -d -m755 %{buildroot}/%{_pkgdocdir} if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi pushd %{buildroot} if [ -d usr/lib ]; then find usr/lib -type f -printf "\"/%h/%f\"\n" >> filelist.lst fi if [ -d usr/lib64 ]; then find usr/lib64 -type f -printf "\"/%h/%f\"\n" >> filelist.lst fi if [ -d usr/bin ]; then find usr/bin -type f -printf "\"/%h/%f\"\n" >> filelist.lst fi if [ -d usr/sbin ]; then find usr/sbin -type f -printf "\"/%h/%f\"\n" >> filelist.lst fi touch doclist.lst if [ -d usr/share/man ]; then find usr/share/man -type f -printf "\"/%h/%f.gz\"\n" >> doclist.lst fi popd mv %{buildroot}/filelist.lst . mv %{buildroot}/doclist.lst . %files -n python3-dtreeplt -f filelist.lst %dir %{python3_sitelib}/* %files help -f doclist.lst %{_docdir}/* %changelog * Tue Jun 20 2023 Python_Bot - 0.1.43-1 - Package Spec generated