📄 attribute.h
字号:
/************************************************************************/
/* AUTHOR: Leiming Hong */
/* INST.: South China Univ. of Tech. */
/* Date: 2005-10-26 */
/* FUNC: Attribute used for parsering the mining vecotr */
/************************************************************************/
#ifndef _ATTRIBUTE_
#define _ATTRIBUTE_
#include <string>
#include <map>
using namespace std;
class Attribute
{
public:
//: enum of the mining attribute type
enum _At
{
nominal,
numeric
};
public:
//: default for numeric type, name=""
Attribute();
Attribute(const string& name,_At type = _At::numeric);
Attribute(const Attribute& attr);
~Attribute();
public:
//: tests if nominal type
bool is_nominal() const;
//: tests if numeric type
bool is_numeric() const;
//: gets the type of the attribute
_At type() const;
//: gets the distinct nominal count
int nominal_count() const;
//: maps a nominal string to an integer
int nominal_value(const string& nom);
//: adds a nominal string to the map
void add_nominal(const string& nom);
//: gets the mining attribute's name
string get_name() const;
//: sets the mining attribute's name
void set_name(const string& name);
protected:
//: mining attribute name
string _name;
//: mining attribute type
_At _type;
//: nominal value maping(name values)
map<string,int>* _nvs;
};
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -