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

📄 rsesclassifier.h

📁 粗慥集成算法集合 ,并有详细的文档资料和测试数据处
💻 H
字号:
//-------------------------------------------------------------------
// Author........: Aleksander 豩rn
// Date..........: 960619
// Description...:
// Revisions.....:
//===================================================================

#ifndef __RSESCLASSIFIER_H__
#define __RSESCLASSIFIER_H__

#include <copyright.h>

#include <kernel/algorithms/rulebasedclassifier.h>

//-------------------------------------------------------------------
// Class prototypes.
//===================================================================

class TDecGenerator;
class RSESRules;
class RSESReducts;
class RSESDecisionTable;

//-------------------------------------------------------------------
// Class.........: RSESClassifier
// Author........: Aleksander 豩rn
// Date..........:
// Description...: Wrapper around RSES library code for generating
//                 a classification for a single object.
// Revisions.....:
//===================================================================

class RSESClassifier : public RuleBasedClassifier {
public:

	//- Enumerated types...............................................
	enum Voting    {VOTING_TUNED, VOTING_MAJORITY};
	enum Filtering {FILTERING_SUPPORT, FILTERING_STABILITY};

	//- Textual representations........................................
	static String                  GetString(Voting voting);
	static String                  GetString(Filtering filtering);

private:

	//- From the RSES library..........................................
	TDecGenerator                 *classifier_;           // The embedded classifier algorithm.

	//- Parameters.....................................................
	Voting                         voting_;               // Voting strategy.
	Filtering                      filtering_;            // Filtering strategy.
	float                          min_support_;          // Filtering support threshold (cf. RSES technical doc.)
	double                         min_stability_;        // Filtering stability threshold (cf. RSES technical doc.)
	String                         filename_;             // Location of distance matrix for decision attr.

	//- Redundant stuff (mutable)......................................
	bool                           has_read_file_;        // Has the distance matrix file been read?
	Handle<RSESDecisionTable>      table_train_;          // The classifying rules' originating (training) table.
	Handle<RSESDecisionTable>      table_test_;           // Conversion structure, to avoid having to allocate a new one each time.

public:

  //- Constructors/destructor........................................
  RSESClassifier();
  virtual ~RSESClassifier();

  //- Methods inherited from Identifier..............................
	DECLAREIDMETHODS()

  //- Methods inherited from Algorithm...............................
	virtual String                 GetParameters() const;
	virtual bool                   SetParameter(const String &keyword, const String &value);
  virtual bool                   IsApplicable(const Structure &structure, bool warn = true) const;
  virtual Structure             *Apply(Structure &structure) const;

  //- Methods inherited from Classifier..............................
	virtual bool                   Reset();
	virtual bool                   SetRules(const Rules *rules);

  //- Parameter management...........................................
	Voting                         GetVotingStrategy() const {return voting_;}
	bool                           SetVotingStrategy(Voting voting) {voting_ = voting; return true;}

	Filtering                      GetFilteringStrategy() const {return filtering_;}
	bool                           SetFilteringStrategy(Filtering filtering) {filtering_ = filtering; return true;}

	float                          GetSupportThreshold() const {return min_support_;}
	bool                           SetSupportThreshold(float min_support) {min_support_ = min_support; return true;}

	double                         GetStabilityThreshold() const {return min_stability_;}
	bool                           SetStabilityThreshold(double min_stability) {min_stability_ = min_stability; return true;}

	const String                  &GetFilename() const {return filename_;}
	bool                           SetFilename(const String &filename) {filename_ = filename; has_read_file_ = false; return true;}

};

#endif

⌨️ 快捷键说明

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