lambda rank added

This commit is contained in:
kalenhaha
2014-04-10 22:09:19 +08:00
parent a10f594644
commit c8b2f46b89
18 changed files with 1792 additions and 76 deletions

View File

@@ -10,8 +10,8 @@
namespace xgboost{
namespace base{
/*! \brief data matrix for regression,classification,rank content */
struct DMatrix{
/*! \brief data matrix for regression, classification, rank content */
struct DMatrix{
public:
/*! \brief maximum feature dimension */
unsigned num_feature;
@@ -74,7 +74,7 @@ namespace xgboost{
}
inline void LoadGroup(const char* fgroup, bool silent = false){
//if exists group data load it in
//if exists group data load it in
FILE *file_group = fopen64(fgroup, "r");
if (file_group != NULL){
@@ -117,6 +117,7 @@ namespace xgboost{
LoadGroupBinary(fgroup,silent);
return true;
}
/*!
* \brief save to binary file
* \param fname name of binary data
@@ -139,7 +140,7 @@ namespace xgboost{
}
inline void SaveGroupBinary(const char* fgroup, bool silent = false){
//save group data
//save group data
if (group_index.size() > 0){
utils::FileStream file_group(utils::FopenCheck(fgroup, "wb"));
int group_index_size = group_index.size();
@@ -151,7 +152,7 @@ namespace xgboost{
}
inline void LoadGroupBinary(const char* fgroup, bool silent = false){
//if group data exists load it in
//if group data exists load it in
FILE *file_group = fopen64(fgroup, "r");
if (file_group != NULL){
int group_index_size = 0;
@@ -168,8 +169,8 @@ namespace xgboost{
}else{
if(!silent){printf("The binary file of group info not exists");}
}
}
}
/*!
* \brief cache load data given a file name, if filename ends with .buffer, direct load binary
* otherwise the function will first check if fname + '.buffer' exists,
@@ -207,9 +208,6 @@ namespace xgboost{
}
}
};
}
};