support int type

This commit is contained in:
tqchen
2014-03-12 17:58:14 -07:00
parent 8f9efa2725
commit fcf06a7164
3 changed files with 23 additions and 5 deletions

View File

@@ -17,7 +17,9 @@ namespace xgboost{
public:
enum Type{
kIndicator = 0,
kQuantitive = 1
kQuantitive = 1,
kInteger = 2,
kFloat = 3
};
public:
/*! \brief load feature map from text format */
@@ -54,6 +56,8 @@ namespace xgboost{
inline static Type GetType( const char *tname ){
if( !strcmp( "i", tname ) ) return kIndicator;
if( !strcmp( "q", tname ) ) return kQuantitive;
if( !strcmp( "int", tname ) ) return kInteger;
if( !strcmp( "float", tname ) ) return kFloat;
utils::Error("unknown feature type, use i for indicator and q for quantity");
return kIndicator;
}