亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? approximation.cpp

?? 粗慥集成算法集合 ,并有詳細(xì)的文檔資料和測試數(shù)據(jù)處
?? CPP
?? 第 1 頁 / 共 2 頁
字號(hào):
//-------------------------------------------------------------------
// Author........: Aleksander 豩rn
// Date..........:
// Description...:
// Revisions.....:
//===================================================================

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

#include <kernel/structures/approximation.h>

#include <kernel/utilities/iokit.h>
#include <kernel/utilities/creator.h>

//-------------------------------------------------------------------
// Static methods (file scope).
//===================================================================

//-------------------------------------------------------------------
// Method........: StaticSetPointers
// Author........: Aleksander 豩rn
// Date..........:
// Description...: Sets the pointers (handles) in one array to point
//                 similarly as they do in the other.  Used for
//                 duplication and assignment.
// Comments......: Assumes the array to set has been emptied.
// Revisions.....:
//===================================================================

static bool
StaticSetPointers(Handle<EquivalenceClasses> set1, const Handle<EquivalenceClasses> universe1,
									const Handle<EquivalenceClasses> set2, const Handle<EquivalenceClasses> universe2) {

	int i, no_classes = set2->GetNoEquivalenceClasses();

	for (i = 0; i < no_classes; i++) {

		// Find out to where into the universe the pointer points.
		int index = universe2->FindMember(set2->GetEquivalenceClass(i));

		if (index == Undefined::Integer()) {
			Message::Error("Could not set pointer array properly.");
			return false;
		}

		// Set the other pointer accordingly.
    set1->AppendStructure(universe1->GetEquivalenceClass(index));

	}

	return true;

}

//-------------------------------------------------------------------
// Method........: StaticSaveSet
// Author........: Aleksander 豩rn
// Date..........:
// Description...: Saves the size and indices only of the given set.
//                 Pointers can then easily be reconstructed later.
// Comments......:
// Revisions.....:
//===================================================================

static bool
StaticSaveSet(ofstream &stream, const Handle<EquivalenceClasses> set, const Handle<EquivalenceClasses> universe) {

	int i, no_classes = set->GetNoEquivalenceClasses();

	if (!IOKit::Save(stream, no_classes))
		return false;

	if (!IOKit::Save(stream, '\n'))
		return false;

	for (i = 0; i < no_classes; i++) {

		// Find out to where into the universe the pointer points.
		int index = universe->FindMember(set->GetEquivalenceClass(i));

		if (index == Undefined::Integer()) {
			Message::Error("Could not locate pointer into universe.");
			return false;
		}

		// Save the index only.
		if (!IOKit::Save(stream, index))
			return false;
	}

	if (!IOKit::Save(stream, '\n'))
		return false;

	return true;

}

//-------------------------------------------------------------------
// Method........: StaticLoadSet
// Author........: Aleksander 豩rn
// Date..........:
// Description...: Inverse of StaticSaveSet.
// Comments......:
// Revisions.....:
//===================================================================

static bool
StaticLoadSet(ifstream &stream, Handle<EquivalenceClasses> set, const Handle<EquivalenceClasses> universe) {

	int i, no_classes, index;

	// Load the number of eq. classes to append.
	if (!IOKit::Load(stream, no_classes))
		return false;

	for (i = 0; i < no_classes; i++) {

		// Load the index.
		if (!IOKit::Load(stream, index))
			return false;

		// Append an eq. class.
		if (!set->AppendStructure(universe->GetEquivalenceClass(index)))
			return false;

	}

	return true;

}

//-------------------------------------------------------------------
// Method........: StaticGetRatio
// Author........: Aleksander 豩rn
// Date..........:
// Description...:
// Description...: Returns the ratio between the number of objects in
//                 the given eq. class set that are correctly classified
//                 by the approximation, and the total number of objects
//                 with the decision value that was attempted approximated.
//
// Comments......: The counter and denominator of the ratio can optionally
//                 be returned in-place.
//
//                 So that sensitivity and specificty computation share the
//                 same implementation.
// Revisions.....:
//===================================================================

static float
StaticGetRatio(Handle<EquivalenceClasses> set, int decision, bool equality,
							 int *no_correct, int *no_total, const DecisionTable *table) {

	if (no_correct != NULL)
		*no_correct = 0;

	if (no_total != NULL)
		*no_total = 0;

	// Was the originating decision table supplied?
	if (table == NULL) {
		Message::Error("Could not acquire originating decision table.");
		return Undefined::Float();
	}

	// Operate on a masked table.
	bool masked = true;

	// Acquire the index of the table's decision attribute.
	int decision_attribute = table->GetDecisionAttribute(masked);

	if (decision_attribute == Undefined::Integer()) {
		Message::Error("Could not acquire the index of the decision attribute in the originating decision table.");
		return Undefined::Float();
	}

  int no_classes = set->GetNoEquivalenceClasses();
	int counter    = 0;
	int i, j;

	// Run through the set and count how many objects that are correctly classified.
	for (i = 0; i < no_classes; i++) {
		Handle<EquivalenceClass> eqclass = set->GetEquivalenceClass(i);
		int no_objects = eqclass->GetNoObjects();
		for (j = 0; j < no_objects; j++) {
			int object_no = eqclass->GetObject(j);
			int entry     = table->GetEntry(object_no, decision_attribute, masked);
		  if (equality && (entry == decision))
				counter++;
			else if (!equality && (entry != decision))
				counter++;
		}
	}

	if (no_correct != NULL)
		*no_correct = counter;

	int no_objects  = table->GetNoObjects(masked);
	int denominator = 0;

	// Run through the table and count how many objects that actually belong (or don't belong)
	// to the set of object with the decision that was attempted approximated.
	for (i = 0; i < no_objects; i++) {
		int entry = table->GetEntry(i, decision_attribute, masked);
		if (equality && (entry == decision))
			denominator++;
		else if (!equality && (entry != decision))
			denominator++;
	}

	if (no_total != NULL)
		*no_total = denominator;

	// Avoid division by zero.
	if (denominator == 0)
		return Undefined::Float();

	// Safe-guard to avoid numerical quirks.
	if (counter == denominator)
		return 1.0;

	return static_cast(float, counter) / denominator;

}

//-------------------------------------------------------------------
// Methods for class Approximation.
//===================================================================

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

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

Approximation::Approximation(const Approximation &in) : AnnotatedStructure(in) {

	decision_ = in.decision_;

	// Copy (i.e. physically duplicate) the equivalence class sets.
	universe_ = dynamic_cast(EquivalenceClasses *, in.universe_->Duplicate());

	// Instantiate eq. class sets.
	lower_    = Creator::EquivalenceClasses();
	upper_    = Creator::EquivalenceClasses();
	boundary_ = Creator::EquivalenceClasses();
	outside_  = Creator::EquivalenceClasses();

	// Set pointers into the universe.
	StaticSetPointers(lower_,    universe_, in.lower_,    in.universe_);
	StaticSetPointers(upper_,    universe_, in.upper_,    in.universe_);
	StaticSetPointers(boundary_, universe_, in.boundary_, in.universe_);
	StaticSetPointers(outside_,  universe_, in.outside_,  in.universe_);

}

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

Approximation::Approximation() {

	decision_ = Undefined::Integer();

	// Instantiate eq. class sets.
	universe_ = Creator::EquivalenceClasses();
	lower_    = Creator::EquivalenceClasses();
	upper_    = Creator::EquivalenceClasses();
	boundary_ = Creator::EquivalenceClasses();
	outside_  = Creator::EquivalenceClasses();

}

//-------------------------------------------------------------------
// Method........: Destructor.
// Author........: Aleksander 豩rn
// Date..........:
// Description...:
// Comments......: The handle mechanism should take care of the
//                 garbage collection.
// Revisions.....:
//===================================================================

Approximation::~Approximation() {
}

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

IMPLEMENTIDMETHODS(Approximation, APPROXIMATION, AnnotatedStructure)

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

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

bool
Approximation::Load(ifstream &stream) {

	// Clear current contents.
	Clear();

	// Load stuff higher up.
	if (!AnnotatedStructure::Load(stream))

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品女同一区二区三区| 一区二区日韩av| 欧美视频在线一区| 国产成人精品免费视频网站| 亚洲高清免费观看| 亚洲男人都懂的| 久久久精品影视| 91精品国产欧美一区二区18 | 欧美成人a在线| 91黄色免费网站| 成人小视频免费观看| 免费日韩伦理电影| 亚洲成人中文在线| 亚洲欧洲无码一区二区三区| 精品裸体舞一区二区三区| 欧美日韩三级视频| aaa国产一区| 国产不卡视频一区| 国产一区激情在线| 蜜臀久久99精品久久久画质超高清 | 中文av一区二区| 精品美女在线观看| 欧美一区二区日韩| 欧美日韩在线直播| 91九色02白丝porn| 91猫先生在线| 99久久婷婷国产综合精品电影| 69精品人人人人| 99精品1区2区| 99精品久久只有精品| 国产成人av一区| 国产成人午夜99999| 国产精品综合二区| 国产不卡视频一区二区三区| 国产精品影视在线观看| 国产一区亚洲一区| 国产一区二区调教| 国产高清无密码一区二区三区| 九色综合国产一区二区三区| 蜜臀av在线播放一区二区三区| 婷婷综合在线观看| 另类小说色综合网站| 青青草91视频| 麻豆精品在线观看| 国模一区二区三区白浆| 国产在线不卡一区| 成人免费视频网站在线观看| 成人免费毛片app| 91香蕉国产在线观看软件| 91小宝寻花一区二区三区| 91在线播放网址| 欧美网站一区二区| 日韩欧美一区二区久久婷婷| 久久蜜桃av一区精品变态类天堂| 久久精品人人做| 亚洲三级在线看| 亚洲国产日韩a在线播放| 日韩高清中文字幕一区| 久久9热精品视频| 国产成人aaaa| 色婷婷av一区二区三区gif| 欧美少妇xxx| 欧美va日韩va| 国产精品久久久久久福利一牛影视| 1区2区3区欧美| 午夜精品久久久久| 久久99久久精品| 不卡的av网站| 在线电影院国产精品| 久久久不卡网国产精品一区| 亚洲欧洲av一区二区三区久久| 亚洲第一激情av| 国产一区二区在线看| 一本一道综合狠狠老| 日韩一级大片在线观看| 中文字幕中文字幕在线一区 | 蜜臀久久久久久久| 国产91富婆露脸刺激对白| 欧洲国产伦久久久久久久| 欧美变态口味重另类| 中文字幕在线不卡一区二区三区| 亚洲成人三级小说| 国产成人综合视频| 欧美精品1区2区| 国产精品欧美久久久久无广告| 视频一区二区欧美| 成人黄页毛片网站| 欧美一区二区观看视频| 中文字幕中文字幕在线一区| 奇米色一区二区三区四区| 99视频热这里只有精品免费| 欧美一区二区精品在线| 亚洲激情成人在线| 国产大片一区二区| 日韩区在线观看| 亚洲夂夂婷婷色拍ww47| 国产成人超碰人人澡人人澡| 91麻豆精品国产91久久久资源速度 | 国产日韩精品一区二区浪潮av | 成人a免费在线看| 日韩精品最新网址| 亚洲成人动漫av| 91丨porny丨首页| 久久久欧美精品sm网站| 日产国产高清一区二区三区| 色婷婷亚洲综合| 日本一区二区三区四区| 久久精品国产秦先生| 欧美亚洲禁片免费| 亚洲啪啪综合av一区二区三区| 韩国av一区二区三区四区 | 亚洲精品在线观看视频| 视频一区二区国产| 欧美日韩另类一区| 亚洲欧美日韩国产综合| 国产91丝袜在线播放| 欧美成人vr18sexvr| 日日嗨av一区二区三区四区| 欧洲国产伦久久久久久久| 一区二区三区在线观看网站| 99精品国产热久久91蜜凸| 中文子幕无线码一区tr| 国产成人亚洲综合a∨婷婷图片| 精品国产一区二区亚洲人成毛片| 五月婷婷综合在线| 3atv一区二区三区| 日韩二区三区四区| 91精品国产一区二区| 奇米精品一区二区三区在线观看一 | 中文在线免费一区三区高中清不卡| 国产一区二区在线视频| 国产亚洲一二三区| 高清日韩电视剧大全免费| 国产欧美日韩在线看| 国产精品99久| 国产欧美日韩久久| 99久久国产综合精品女不卡| 亚洲少妇中出一区| 91福利在线看| 婷婷综合久久一区二区三区| 欧美精品色一区二区三区| 琪琪一区二区三区| 欧美大黄免费观看| 国产麻豆91精品| 国产人妖乱国产精品人妖| 国产成人日日夜夜| 亚洲视频免费观看| 欧美天天综合网| 日韩精品欧美精品| 久久夜色精品国产噜噜av| 成人午夜激情影院| 亚洲狠狠丁香婷婷综合久久久| 色94色欧美sute亚洲线路一ni| 亚洲午夜电影网| 日韩欧美激情四射| 成人午夜精品在线| 亚洲图片欧美视频| 精品三级在线观看| 91香蕉视频在线| 三级欧美韩日大片在线看| 精品1区2区在线观看| 不卡一区中文字幕| 亚洲成人精品影院| 久久众筹精品私拍模特| 91在线免费播放| 肉丝袜脚交视频一区二区| 精品免费国产一区二区三区四区| 成人一区在线看| 亚洲成人你懂的| 欧美经典一区二区三区| 欧美日本一道本在线视频| 国产精品白丝jk黑袜喷水| 亚洲一区日韩精品中文字幕| 日韩欧美国产一区二区三区 | 国产中文字幕精品| 亚洲三级理论片| 91精品国模一区二区三区| 高潮精品一区videoshd| 亚洲午夜电影在线观看| 国产欧美日韩亚州综合| 欧美顶级少妇做爰| eeuss国产一区二区三区| 午夜精品成人在线视频| 欧美国产成人精品| 337p亚洲精品色噜噜狠狠| 99久久精品免费看国产免费软件| 日本在线观看不卡视频| 亚洲欧美日韩小说| 亚洲精品一线二线三线无人区| 欧美影视一区在线| 粉嫩av一区二区三区| 日本成人在线一区| 日韩毛片在线免费观看| 欧美精品一区二区三区视频| 91行情网站电视在线观看高清版| 国产一级精品在线| 日韩国产精品91| 亚洲综合丁香婷婷六月香| 亚洲国产成人私人影院tom | 国产色产综合色产在线视频|