node.cpp

来自「c4.5决策树的实现,应用于一个医学诊断」· C++ 代码 · 共 51 行

CPP
51
字号
#include "Stdafx.h"
#include "Node.h"

Node:: Node()
{
    value = -1;
	attribute = -1;
	isLeaf = 0;
	depth=-1;
	leftchild = NULL;
	rightchild =NULL;
}

Node:: Node(double value,int attribute,int isLeaf = 0)
{
	this->value = value;
	this->index = index;
	this->isLeaf = isLeaf;
	leftchild = rightchild =0;
}
	
void Node:: SetValue(double value)
{
	this->value = value;
}
	
double Node:: GetValue()
{
	return this->value;
}
	
void Node:: SetAttribute(int attribute)
{
	this->attribute = attibute;
}

int Node:: GetAttribute()
{
	return this->attribute;
}
	
void Node:: SetLeaf(bool isLeaf)
{
	this->isLeaf = isLeaf;
}
	
int Node:: IsLeaf()
{
	return this->isLeaf;
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?