⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 roccurve.cpp

📁 粗糙集应用软件
💻 CPP
字号:
//-------------------------------------------------------------------
// Author........: Aleksander 豩rn
// Date..........:
// Description...:
// Revisions.....:
//===================================================================

#include <stdafx.h> // Precompiled headers.
#include <copyright.h>

#include <kernel/structures/roccurve.h>

#include <kernel/basic/vector.h>
#include <kernel/basic/algorithm.h>
#include <kernel/basic/message.h>

#include <kernel/utilities/systemkit.h>
#include <kernel/utilities/iokit.h>
#include <kernel/utilities/cindexcomputer.h>

#include <kernel/system/fstream.h>
#include <kernel/system/math.h>

#include <common/configuration.h>

//-------------------------------------------------------------------
// Methods for class ROCCurve.
//===================================================================

//-------------------------------------------------------------------
// Constructors/destructor.
//===================================================================

ROCCurve::ROCCurve() {
	no_0s_              = 0;
	no_1s_              = 0;
	area_               = Undefined::Float();
	stderr_             = Undefined::Float();
	decision_attribute_ = Undefined::Integer();
	decision_class_     = Undefined::Integer();
}

ROCCurve::ROCCurve(const ROCCurve &in) {
	data_               = in.data_;
	no_0s_              = in.no_0s_;
	no_1s_              = in.no_1s_;
	area_               = in.area_;
	stderr_             = in.stderr_;
	decision_attribute_ = in.decision_attribute_;
	decision_class_     = in.decision_class_;
}

ROCCurve::~ROCCurve() {
}

//-------------------------------------------------------------------
// Methods inherited from Identifier.
//===================================================================

IMPLEMENTIDMETHODS(ROCCurve, ROCCURVE, BinaryOutcomeCurve)

//-------------------------------------------------------------------
// Methods inherited from Persistent.
//===================================================================

//-------------------------------------------------------------------
// Method........: Load
// Author........: Aleksander 豩rn
// Date..........:
// Description...:
// Comments......: BinaryOutcomeCurve::Load method not compatible with
//                 ROCCurve::Save method.
// Revisions.....:
//===================================================================

bool
ROCCurve::Load(ifstream &stream) {
	return BinaryOutcomeCurve::Load(stream);
}

//-------------------------------------------------------------------
// Method........: Save
// Author........: Aleksander 豩rn
// Date..........:
// Description...:
// Comments......:
// Revisions.....:
//===================================================================

bool
ROCCurve::Save(ofstream &stream) const {
	return Save(stream, Undefined::Id(), Undefined::String());
}

//-------------------------------------------------------------------
// Methods inherited from Structure.
//===================================================================

//-------------------------------------------------------------------
// Method........: Duplicate
// Author........: Aleksander 豩rn
// Date..........:
// Description...:
// Comments......:
// Revisions.....:
//===================================================================

Structure *
ROCCurve::Duplicate() const {
	return new ROCCurve(*this);
}

//-------------------------------------------------------------------
// Method........: Clear
// Author........: Aleksander 豩rn
// Date..........:
// Description...:
// Comments......:
// Revisions.....:
//===================================================================

void
ROCCurve::Clear() {

	// Erase data points.
	data_.erase(data_.begin(), data_.end());

	// Invalidate member variables.
	area_               = Undefined::Float();
	stderr_             = Undefined::Float();
	no_0s_              = 0;
	no_1s_              = 0;
	decision_attribute_ = Undefined::Integer();
	decision_class_     = Undefined::Integer();

}

//-------------------------------------------------------------------
// Methods inherited from BinaryOutcomeCurve
//===================================================================

//-------------------------------------------------------------------
// Method........: Create
// Author........: Aleksander 豩rn
// Date..........:
// Description...:
// Comments......:
// Revisions.....:
//===================================================================

bool
ROCCurve::Create(const Vector(int) &targets, const Vector(float) &outputs) {
	return Create(targets, outputs, 251);
}

//-------------------------------------------------------------------
// Local methods.
//===================================================================

//-------------------------------------------------------------------
// Method........: Create
// Author........: Aleksander 豩rn
// Date..........:
// Description...:
// Comments......:
// Revisions.....: A

⌨️ 快捷键说明

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