📄 naivescaler.cpp
字号:
//-------------------------------------------------------------------// Author........: Aleksander 豩rn/Knut Magne Risvik// Date..........:// Description...:// Revisions.....://===================================================================#include <stdafx.h> // Precompiled headers.#include <copyright.h>#include <kernel/algorithms/naivescaler.h>#include <kernel/structures/decisiontable.h>#include <kernel/basic/vector.h>#include <kernel/basic/algorithm.h>#include <kernel/basic/message.h>#include <kernel/system/fstream.h>//-------------------------------------------------------------------// Methods for class NaiveScaler.//===================================================================//-------------------------------------------------------------------// Constructors/destructor.//===================================================================NaiveScaler::NaiveScaler() {}NaiveScaler::~NaiveScaler() {}//-------------------------------------------------------------------// Methods inherited from Identifier.//===================================================================IMPLEMENTIDMETHODS(NaiveScaler, NAIVESCALER, OrthogonalScaler)//-------------------------------------------------------------------// Methods inherited from OrthogonalScaler.//===================================================================//-------------------------------------------------------------------// Method........: FindCuts// Author........: Aleksander 豩rn// Date..........:// Description...:// Comments......:// Revisions.....://===================================================================boolNaiveScaler::FindCuts(const DecisionTable &table, int attribute_no, bool masked, Cuts &cuts) const { return FindCuts(table, attribute_no, masked, cuts, NULL, NULL);}//-------------------------------------------------------------------// New virtual methods.//===================================================================//-------------------------------------------------------------------// Method........: SkipCut// Author........: Aleksander 豩rn// Date..........:// Description...: Returns true if a cut between objects (i, i + 1)// should be skipped.//// Can be overloaded to cater for more advanced// handling than a straight-forward approach.// Comments......:// Revisions.....://===================================================================boolNaiveScaler::SkipCut(const Vector(OVPair) &/*objects*/, int /*i*/, const Vector(int) &/*decisions_l*/, const Vector(int) &/*cardinalities_l*/, const Vector(int) &/*decisions_r*/, const Vector(int) &/*cardinalities_r*/) const { return false;}//-------------------------------------------------------------------// Method........: FindCuts// Author........: Aleksander 豩rn// Date..........:// Description...: Scans the objects (sorted by attribute value) from// left to right in a single pass, and adds a cut// between values for which the (generalized) decision// for the objects to the immediate left and right of// the cut differ.//// Comments......: The straight-forward naive approach may generate// very many cuts, perhaps too many. In some cases it may// be desirable to introduce inconsistencies.//// Revisions.....: A
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -