mirror of
https://github.com/Doctorado-ML/STree.git
synced 2025-08-17 16:36:01 +00:00
Update notebooks and readme with cosmetic changes
This commit is contained in:
16
README.md
16
README.md
@@ -4,11 +4,21 @@
|
|||||||
|
|
||||||
Oblique Tree classifier based on SVM nodes
|
Oblique Tree classifier based on SVM nodes
|
||||||
|
|
||||||
## Example
|
## Examples
|
||||||
|
|
||||||
### Jupyter
|
### Jupyter notebooks
|
||||||
|
|
||||||
[](https://mybinder.org/v2/gh/Doctorado-ML/STree/master?urlpath=lab/tree/test.ipynb)
|
##### Slow launch but better integration
|
||||||
|
|
||||||
|
* [](https://mybinder.org/v2/gh/Doctorado-ML/STree/master?urlpath=lab/tree/test.ipynb) Test notebook
|
||||||
|
|
||||||
|
##### Fast launch but have to run first commented out cell for setup
|
||||||
|
|
||||||
|
* [](https://colab.research.google.com/github/Doctorado-ML/STree/blob/master/test.ipynb) Test notebook
|
||||||
|
|
||||||
|
* [](https://colab.research.google.com/github/Doctorado-ML/STree/blob/master/test2.ipynb) Another Test notebook
|
||||||
|
|
||||||
|
* [](https://colab.research.google.com/github/Doctorado-ML/STree/blob/master/test_graphs.ipynb) Test Graphics notebook
|
||||||
|
|
||||||
### Command line
|
### Command line
|
||||||
|
|
||||||
|
15
test.ipynb
15
test.ipynb
@@ -1,5 +1,20 @@
|
|||||||
{
|
{
|
||||||
"cells": [
|
"cells": [
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"execution_count": null,
|
||||||
|
"metadata": {},
|
||||||
|
"outputs": [],
|
||||||
|
"source": [
|
||||||
|
"#\n",
|
||||||
|
"# Google Colab setup\n",
|
||||||
|
"#\n",
|
||||||
|
"#import os\n",
|
||||||
|
"#os.chdir(\"/content\")\n",
|
||||||
|
"#!git clone https://github.com/Doctorado-ML/STree.git\n",
|
||||||
|
"#os.chdir(\"/content/STree\")"
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": 1,
|
"execution_count": 1,
|
||||||
|
@@ -9,10 +9,10 @@
|
|||||||
"#\n",
|
"#\n",
|
||||||
"# Google Colab setup\n",
|
"# Google Colab setup\n",
|
||||||
"#\n",
|
"#\n",
|
||||||
"#!git clone https://github.com/Doctorado-ML/STree.git\n",
|
|
||||||
"# Set working dir to Stree\n",
|
|
||||||
"#import os\n",
|
"#import os\n",
|
||||||
"#os.chdir(\"STree\")"
|
"#os.chdir(\"/content\")\n",
|
||||||
|
"#!git clone https://github.com/Doctorado-ML/STree.git\n",
|
||||||
|
"#os.chdir(\"/content/STree\")"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
File diff suppressed because one or more lines are too long
@@ -31,12 +31,12 @@ class Snode_graph(Snode):
|
|||||||
return False
|
return False
|
||||||
|
|
||||||
def plot_hyperplane(self):
|
def plot_hyperplane(self):
|
||||||
# get the splitting hyperplane
|
|
||||||
def hyperplane(x, y): return (-self._interceptor - self._vector[0][0] * x
|
|
||||||
- self._vector[0][1] * y) / self._vector[0][2]
|
|
||||||
fig = plt.figure(figsize=self._plot_size)
|
fig = plt.figure(figsize=self._plot_size)
|
||||||
ax = fig.add_subplot(1, 1, 1, projection='3d')
|
ax = fig.add_subplot(1, 1, 1, projection='3d')
|
||||||
if not self._is_pure():
|
if not self._is_pure():
|
||||||
|
# get the splitting hyperplane
|
||||||
|
def hyperplane(x, y): return (-self._interceptor - self._vector[0][0] * x
|
||||||
|
- self._vector[0][1] * y) / self._vector[0][2]
|
||||||
# Can't plot hyperplane of leaves with one label because it hasn't classiffier
|
# Can't plot hyperplane of leaves with one label because it hasn't classiffier
|
||||||
tmpx = np.linspace(self._X[:, 0].min(), self._X[:, 0].max())
|
tmpx = np.linspace(self._X[:, 0].min(), self._X[:, 0].max())
|
||||||
tmpy = np.linspace(self._X[:, 1].min(), self._X[:, 1].max())
|
tmpy = np.linspace(self._X[:, 1].min(), self._X[:, 1].max())
|
||||||
|
Reference in New Issue
Block a user