summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCoprDistGit <infra@openeuler.org>2023-06-20 03:48:59 +0000
committerCoprDistGit <infra@openeuler.org>2023-06-20 03:48:59 +0000
commitf6e30c343f8053de824645065124529cf253b45a (patch)
tree095fa0cc460bfe9927c117f71d9f29ed98c73212
parent8e493ea7672454f6e5f990b37111da1e9887cb13 (diff)
automatic import of python-dtreepltopeneuler20.03
-rw-r--r--.gitignore1
-rw-r--r--python-dtreeplt.spec263
-rw-r--r--sources1
3 files changed, 265 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index e69de29..58d8a29 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/dtreeplt-0.1.43.tar.gz
diff --git a/python-dtreeplt.spec b/python-dtreeplt.spec
new file mode 100644
index 0000000..30957bc
--- /dev/null
+++ b/python-dtreeplt.spec
@@ -0,0 +1,263 @@
+%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 <Python_Bot@openeuler.org> - 0.1.43-1
+- Package Spec generated
diff --git a/sources b/sources
new file mode 100644
index 0000000..de976ed
--- /dev/null
+++ b/sources
@@ -0,0 +1 @@
+73054dd6b956ee5c291d6e482f775887 dtreeplt-0.1.43.tar.gz