mirror of
https://github.com/ltcptgeneral/IdealRMT-DecisionTrees.git
synced 2025-09-05 23:07:24 +00:00
fix issue in tree saving
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
"cells": [
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 26,
|
||||
"execution_count": 31,
|
||||
"id": "d5618056",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
@@ -21,7 +21,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 27,
|
||||
"execution_count": 32,
|
||||
"id": "d336971a",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
@@ -92,6 +92,8 @@
|
||||
" i = node\n",
|
||||
" if i[1] == \"l\":\n",
|
||||
" clause.append({\"feature\": i[3], \"operation\": \"<=\", \"value\": i[2]})\n",
|
||||
" else:\n",
|
||||
" clause.append({\"feature\": i[3], \"operation\": \">\", \"value\": i[2]})\n",
|
||||
" \n",
|
||||
" a = list(value[node][0])\n",
|
||||
" ind = a.index(max(a))\n",
|
||||
@@ -103,10 +105,19 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"execution_count": 33,
|
||||
"id": "b96f3403",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"train accuracy: 0.879490682862549\n",
|
||||
"test accuracy: 0.879490682862549\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"# Training set X and Y\n",
|
||||
"Set1 = pd.read_csv(inputfile)\n",
|
||||
@@ -138,7 +149,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"execution_count": 34,
|
||||
"id": "7f36344d",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
@@ -154,7 +165,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"execution_count": 35,
|
||||
"id": "cf8832b9",
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
|
Reference in New Issue
Block a user