diff --git a/demo/DemoClassification.ipynb b/demo/DemoClassification.ipynb
index 26bac02c..f36ddeff 100644
--- a/demo/DemoClassification.ipynb
+++ b/demo/DemoClassification.ipynb
@@ -13,7 +13,7 @@
},
{
"cell_type": "code",
- "execution_count": 1,
+ "execution_count": 16,
"id": "6b710e7c",
"metadata": {},
"outputs": [],
@@ -46,7 +46,7 @@
},
{
"cell_type": "code",
- "execution_count": 2,
+ "execution_count": 17,
"id": "f8e46c49",
"metadata": {},
"outputs": [],
@@ -65,7 +65,7 @@
},
{
"cell_type": "code",
- "execution_count": 3,
+ "execution_count": 18,
"id": "38d5afb0",
"metadata": {},
"outputs": [],
@@ -84,7 +84,7 @@
},
{
"cell_type": "code",
- "execution_count": 4,
+ "execution_count": 19,
"id": "4f807185",
"metadata": {},
"outputs": [
@@ -93,7 +93,7 @@
"text/plain": " target\n0 setosa\n1 setosa\n2 setosa\n3 setosa\n4 setosa\n.. ...\n145 virginica\n146 virginica\n147 virginica\n148 virginica\n149 virginica\n\n[150 rows x 1 columns]",
"text/html": "
\n\n
\n \n \n | \n target | \n
\n \n \n \n 0 | \n setosa | \n
\n \n 1 | \n setosa | \n
\n \n 2 | \n setosa | \n
\n \n 3 | \n setosa | \n
\n \n 4 | \n setosa | \n
\n \n ... | \n ... | \n
\n \n 145 | \n virginica | \n
\n \n 146 | \n virginica | \n
\n \n 147 | \n virginica | \n
\n \n 148 | \n virginica | \n
\n \n 149 | \n virginica | \n
\n \n
\n
150 rows × 1 columns
\n
"
},
- "execution_count": 4,
+ "execution_count": 19,
"metadata": {},
"output_type": "execute_result"
}
@@ -114,7 +114,7 @@
},
{
"cell_type": "code",
- "execution_count": 5,
+ "execution_count": 20,
"id": "7ac49b4e",
"metadata": {},
"outputs": [
@@ -123,7 +123,7 @@
"text/plain": " SepalLength SepalWidth PetalLength PetalWidth iris\n0 5.1 3.5 1.4 0.2 setosa\n1 4.9 3.0 1.4 0.2 setosa\n2 4.7 3.2 1.3 0.2 setosa\n3 4.6 3.1 1.5 0.2 setosa\n4 5.0 3.6 1.4 0.2 setosa\n.. ... ... ... ... ...\n145 6.7 3.0 5.2 2.3 virginica\n146 6.3 2.5 5.0 1.9 virginica\n147 6.5 3.0 5.2 2.0 virginica\n148 6.2 3.4 5.4 2.3 virginica\n149 5.9 3.0 5.1 1.8 virginica\n\n[150 rows x 5 columns]",
"text/html": "\n\n
\n \n \n | \n SepalLength | \n SepalWidth | \n PetalLength | \n PetalWidth | \n iris | \n
\n \n \n \n 0 | \n 5.1 | \n 3.5 | \n 1.4 | \n 0.2 | \n setosa | \n
\n \n 1 | \n 4.9 | \n 3.0 | \n 1.4 | \n 0.2 | \n setosa | \n
\n \n 2 | \n 4.7 | \n 3.2 | \n 1.3 | \n 0.2 | \n setosa | \n
\n \n 3 | \n 4.6 | \n 3.1 | \n 1.5 | \n 0.2 | \n setosa | \n
\n \n 4 | \n 5.0 | \n 3.6 | \n 1.4 | \n 0.2 | \n setosa | \n
\n \n ... | \n ... | \n ... | \n ... | \n ... | \n ... | \n
\n \n 145 | \n 6.7 | \n 3.0 | \n 5.2 | \n 2.3 | \n virginica | \n
\n \n 146 | \n 6.3 | \n 2.5 | \n 5.0 | \n 1.9 | \n virginica | \n
\n \n 147 | \n 6.5 | \n 3.0 | \n 5.2 | \n 2.0 | \n virginica | \n
\n \n 148 | \n 6.2 | \n 3.4 | \n 5.4 | \n 2.3 | \n virginica | \n
\n \n 149 | \n 5.9 | \n 3.0 | \n 5.1 | \n 1.8 | \n virginica | \n
\n \n
\n
150 rows × 5 columns
\n
"
},
- "execution_count": 5,
+ "execution_count": 20,
"metadata": {},
"output_type": "execute_result"
}
@@ -145,7 +145,7 @@
},
{
"cell_type": "code",
- "execution_count": 6,
+ "execution_count": 21,
"id": "03fc5e2c",
"metadata": {},
"outputs": [],
@@ -164,7 +164,7 @@
},
{
"cell_type": "code",
- "execution_count": 7,
+ "execution_count": 22,
"id": "aa8a3128",
"metadata": {},
"outputs": [
@@ -172,7 +172,7 @@
"data": {
"text/plain": "0.96"
},
- "execution_count": 7,
+ "execution_count": 22,
"metadata": {},
"output_type": "execute_result"
}
@@ -185,7 +185,7 @@
},
{
"cell_type": "code",
- "execution_count": 8,
+ "execution_count": 23,
"outputs": [
{
"name": "stdout",
@@ -231,24 +231,64 @@
},
{
"cell_type": "code",
- "execution_count": 9,
+ "execution_count": 24,
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"CART performance (3 rules):\n",
- "Accuracy = 0.95\n",
- "Fidelity = 0.96\n",
+ "Accuracy = 0.40\n",
+ "Fidelity = 0.39\n",
"\n",
"\n",
"CART extracted rules:\n",
"\n",
+ "iris(PetalLength, PetalWidth, SepalLength, SepalWidth, virginica) :-\n",
+ " PetalWidth =< 0.45, SepalLength =< 4.65, SepalWidth =< 2.65.\n",
+ "iris(PetalLength, PetalWidth, SepalLength, SepalWidth, setosa) :-\n",
+ " PetalWidth =< 0.45, SepalLength =< 4.65, SepalWidth =< 3.15.\n",
+ "iris(PetalLength, PetalWidth, SepalLength, SepalWidth, versicolor) :-\n",
+ " PetalWidth =< 0.45, SepalLength =< 4.65, PetalWidth =< 0.25, SepalLength =< 4.5.\n",
+ "iris(PetalLength, PetalWidth, SepalLength, SepalWidth, setosa) :-\n",
+ " PetalWidth =< 0.45, SepalLength =< 4.65, PetalWidth =< 0.25.\n",
+ "iris(PetalLength, PetalWidth, SepalLength, SepalWidth, versicolor) :-\n",
+ " PetalWidth =< 0.45, SepalLength =< 4.65.\n",
+ "iris(PetalLength, PetalWidth, SepalLength, SepalWidth, setosa) :-\n",
+ " PetalWidth =< 0.45, SepalWidth =< 4.05, SepalWidth =< 3.75, PetalWidth =< 0.35, PetalLength =< 1.35.\n",
+ "iris(PetalLength, PetalWidth, SepalLength, SepalWidth, setosa) :-\n",
+ " PetalWidth =< 0.45, SepalWidth =< 4.05, SepalWidth =< 3.75, PetalWidth =< 0.35, SepalWidth =< 3.55, SepalWidth =< 3.05, SepalLength =< 4.85.\n",
+ "iris(PetalLength, PetalWidth, SepalLength, SepalWidth, virginica) :-\n",
+ " PetalWidth =< 0.45, SepalWidth =< 4.05, SepalWidth =< 3.75, PetalWidth =< 0.35, SepalWidth =< 3.55, SepalWidth =< 3.05, SepalLength =< 4.95.\n",
+ "iris(PetalLength, PetalWidth, SepalLength, SepalWidth, setosa) :-\n",
+ " PetalWidth =< 0.45, SepalWidth =< 4.05, SepalWidth =< 3.75, PetalWidth =< 0.35, SepalWidth =< 3.55, SepalWidth =< 3.05.\n",
+ "iris(PetalLength, PetalWidth, SepalLength, SepalWidth, virginica) :-\n",
+ " PetalWidth =< 0.45, SepalWidth =< 4.05, SepalWidth =< 3.75, PetalWidth =< 0.35, SepalWidth =< 3.55, SepalWidth =< 3.15, PetalWidth =< 0.15.\n",
+ "iris(PetalLength, PetalWidth, SepalLength, SepalWidth, versicolor) :-\n",
+ " PetalWidth =< 0.45, SepalWidth =< 4.05, SepalWidth =< 3.75, PetalWidth =< 0.35, SepalWidth =< 3.55, SepalWidth =< 3.15.\n",
+ "iris(PetalLength, PetalWidth, SepalLength, SepalWidth, virginica) :-\n",
+ " PetalWidth =< 0.45, SepalWidth =< 4.05, SepalWidth =< 3.75, PetalWidth =< 0.35, SepalWidth =< 3.55, SepalWidth =< 3.45.\n",
+ "iris(PetalLength, PetalWidth, SepalLength, SepalWidth, setosa) :-\n",
+ " PetalWidth =< 0.45, SepalWidth =< 4.05, SepalWidth =< 3.75, PetalWidth =< 0.35, SepalWidth =< 3.55, PetalWidth =< 0.25.\n",
+ "iris(PetalLength, PetalWidth, SepalLength, SepalWidth, virginica) :-\n",
+ " PetalWidth =< 0.45, SepalWidth =< 4.05, SepalWidth =< 3.75, PetalWidth =< 0.35, SepalWidth =< 3.55.\n",
+ "iris(PetalLength, PetalWidth, SepalLength, SepalWidth, versicolor) :-\n",
+ " PetalWidth =< 0.45, SepalWidth =< 4.05, SepalWidth =< 3.75, PetalWidth =< 0.35.\n",
+ "iris(PetalLength, PetalWidth, SepalLength, SepalWidth, setosa) :-\n",
+ " PetalWidth =< 0.45, SepalWidth =< 4.05, SepalWidth =< 3.75.\n",
+ "iris(PetalLength, PetalWidth, SepalLength, SepalWidth, virginica) :-\n",
+ " PetalWidth =< 0.45, SepalWidth =< 4.05.\n",
+ "iris(PetalLength, PetalWidth, SepalLength, SepalWidth, setosa) :-\n",
+ " PetalWidth =< 0.45.\n",
+ "iris(PetalLength, PetalWidth, SepalLength, SepalWidth, versicolor) :-\n",
+ " PetalLength =< 4.2.\n",
+ "iris(PetalLength, PetalWidth, SepalLength, SepalWidth, virginica) :-\n",
+ " SepalLength =< 6.5, SepalLength =< 5.8.\n",
"iris(PetalLength, PetalWidth, SepalLength, SepalWidth, setosa) :-\n",
- " PetalLength =< 2.35.\n",
+ " SepalLength =< 6.5, PetalLength =< 4.85.\n",
"iris(PetalLength, PetalWidth, SepalLength, SepalWidth, versicolor) :-\n",
- " PetalWidth =< 1.75.\n",
- "iris(PetalLength, PetalWidth, SepalLength, SepalWidth, virginica).\n"
+ " SepalLength =< 6.5.\n",
+ "iris(PetalLength, PetalWidth, SepalLength, SepalWidth, versicolor).\n"
]
}
],
@@ -279,7 +319,7 @@
},
{
"cell_type": "code",
- "execution_count": 10,
+ "execution_count": 25,
"outputs": [
{
"name": "stdout",
@@ -317,7 +357,7 @@
},
{
"cell_type": "code",
- "execution_count": 11,
+ "execution_count": 26,
"outputs": [
{
"name": "stdout",
@@ -392,7 +432,7 @@
},
{
"cell_type": "code",
- "execution_count": 12,
+ "execution_count": 27,
"outputs": [
{
"name": "stdout",
@@ -429,7 +469,7 @@
},
{
"cell_type": "code",
- "execution_count": 13,
+ "execution_count": 28,
"outputs": [
{
"name": "stdout",
@@ -466,7 +506,7 @@
},
{
"cell_type": "code",
- "execution_count": 12,
+ "execution_count": 28,
"outputs": [],
"source": [],
"metadata": {