📄 costinformation.h
字号:
//-------------------------------------------------------------------
// Author........: Aleksander 豩rn
// Date..........:
// Description...:
// Revisions.....:
//===================================================================
#ifndef __COSTINFORMATION_H__
#define __COSTINFORMATION_H__
#include <copyright.h>
#include <kernel/basic/vector.h>
//-------------------------------------------------------------------
// Class prototypes.
//===================================================================
class DecisionTable;
class ifstream;
class Reduct;
class String;
//-------------------------------------------------------------------
// Class.........: CostInformation
// Author........: Aleksander 豩rn
// Date..........:
// Description...: Helper class that keeps information about
// attribute costs.
//
// Comments......: To do: Add support for shared costs.
// Revisions.....:
//===================================================================
class CostInformation {
protected:
//- Member variables..............................................
Vector(float) costs_;
protected:
//- Constructors...................................................
CostInformation(const CostInformation &in);
public:
//- Constructor and destructor....................................
CostInformation();
virtual ~CostInformation();
//- Local methods.................................................
virtual bool Load(ifstream &stream, const DecisionTable &table, float defaultcost);
virtual bool Load(const String &filename, const DecisionTable &table, float defaultcost);
const Vector(float) &GetCosts() const {return costs_;}
virtual float GetCost(int attribute) const;
virtual float GetCost(const Vector(int) &attributes) const;
virtual float GetCost(const Reduct &attributes) const;
};
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -