?? ruleevaluator.cpp
字號:
//-------------------------------------------------------------------
// Author........: Aleksander 豩rn
// Date..........:
// Description...:
// Revisions.....:
//===================================================================
#include <stdafx.h> // Precompiled headers.
#include <copyright.h>
#include <kernel/algorithms/ruleevaluator.h>
#include <kernel/structures/decisiontable.h>
#include <kernel/structures/rule.h>
#include <kernel/system/math.h>
//-------------------------------------------------------------------
// Methods for class RuleEvaluator.
//===================================================================
//-------------------------------------------------------------------
// Method........: Constructors/destructor
// Author........: Aleksander 豩rn
// Date..........:
// Description...:
// Comments......:
// Revisions.....:
//===================================================================
RuleEvaluator::RuleEvaluator() {
}
RuleEvaluator::RuleEvaluator(const DecisionTable &table) {
bool masked = true;
// Get stuff for computing coverage.
if (!table.GetValueSet(decisions_, cardinalities_, table.GetDecisionAttribute(masked), masked)) {
decisions_.erase(decisions_.begin(), decisions_.end());
cardinalities_.erase(cardinalities_.begin(), cardinalities_.end());
Message::Error("Call to DecisionTable::GetValueSet failed.");
}
// Get |U|.
table_cardinality_ = table.GetNoObjects(masked);
}
RuleEvaluator::~RuleEvaluator() {
}
//-------------------------------------------------------------------
// Method........: GetAccuracy
// Author........: Aleksander 豩rn
// Date..........:
// Description...:
// Comments......:
// Revisions.....:
//===================================================================
float
RuleEvaluator::GetAccuracy(const Rule &rule, int i) const {
return rule.GetAccuracy(i);
}
//-------------------------------------------------------------------
// Method........: GetCoverage
// Author........: Aleksander 豩rn
// Date..........:
// Description...:
// Comments......:
// Revisions.....:
//===================================================================
float
RuleEvaluator::GetCoverage(const Rule &rule, int i) const {
return rule.GetCoverage(i, decisions_, cardinalities_);
}
//-------------------------------------------------------------------
// Method........: GetContingencyTable
// Author........: Thomas 舋otnes
// Date..........: 981029
// Description...: Computes the elements of the contingency table for a
// given rule and a given RHS position.
//
// Comments......: Values for a rule R = alpha -> beta[i] are:
//
// a = support(alpha, beta)
// b = support(alpha, not beta)
// c = support(not alpha, beta)
// d = support(not alpha, not beta)
//
// B = support(beta) = a + c
// A = support(alpha) = a + b
// K = a + b + c + d
//
// | beta | not beta |
// ------------------------------------
// alpha | a | b | A
// not alpha | c | d | K - A
// ------------------------------------
// | B | K - B | K
//
// Revisions.....: A
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -