本文整理汇总了C++中ME_Model::get_features方法的典型用法代码示例。如果您正苦于以下问题:C++ ME_Model::get_features方法的具体用法?C++ ME_Model::get_features怎么用?C++ ME_Model::get_features使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ME_Model
的用法示例。
在下文中一共展示了ME_Model::get_features方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setprecision
// Export weights
vector< vector<string> > export_weights() {
list< pair< pair<string, string>, double > > fl;
model.get_features(fl);
vector<string> value1;
vector<string> value2;
vector<string> value3;
for (list< pair< pair<string, string>, double> >::const_iterator i = fl.begin(); i != fl.end(); i++) {
stringstream write_weights1;
write_weights1 << setprecision(3) << setw(10) << i->second;
string weights1 = write_weights1.str();
value1.push_back(weights1);
stringstream write_weights2;
write_weights2 << left << setw(10) << i->first.first.c_str();
string weights2 = write_weights2.str();
value2.push_back(weights2);
stringstream write_weights3;
write_weights3 << i->first.second.c_str();
string weights3 = write_weights3.str();
value3.push_back(weights3);
}
vector< vector<string> > results;
results.push_back(value1);
results.push_back(value2);
results.push_back(value3);
return results;
}
示例2: print_weights
// Print weights
void print_weights() {
list< pair< pair<string, string>, double > > fl;
model.get_features(fl);
for (list< pair< pair<string, string>, double> >::const_iterator i = fl.begin(); i != fl.end(); i++) {
Rprintf("%10.3f %-10s %s\n", i->second, i->first.first.c_str(), i->first.second.c_str());
}
}