本文整理汇总了C++中ioHandler::writeDataSeparator方法的典型用法代码示例。如果您正苦于以下问题:C++ ioHandler::writeDataSeparator方法的具体用法?C++ ioHandler::writeDataSeparator怎么用?C++ ioHandler::writeDataSeparator使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ioHandler
的用法示例。
在下文中一共展示了ioHandler::writeDataSeparator方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: write
/*
* write the classifier in the given ioHandler
*/
bool svm::write(ioHandler& handler,const bool complete) const {
bool b=true;
if (complete) {
b=handler.writeBegin();
}
b = b && supervisedInstanceClassifier::write(handler,false);
if (b) {
b=b && lti::write(handler, "nClasses",nClasses);
b=b && lti::write(handler, "alpha",alpha);
b=b && lti::write(handler, "vectors",*trainData);
b=b && lti::write(handler, "idMap",idMap);
b=b && lti::write(handler, "rIdMap",rIdMap);
b=b && lti::write(handler, "srcIds",srcIds);
b=b && lti::write(handler, "bias", bias);
b=b && lti::write(handler, "nKernels", kernels.size());
b=b && handler.writeBegin();
b=b && lti::write(handler, "kernels");
b=b && handler.writeDataSeparator();
className cn;
std::string kname;
// always write the complete kernel vector, so we do not need
// to remember which training methods has been used.
for (unsigned int i=0; i<kernels.size(); i++) {
if (kernels[i] != 0) {
cn.get(kernels[i],kname);
lti::write(handler,"name",kname);
b=b && kernels[i]->write(handler);
} else {
lti::write(handler,"name","unknown");
}
}
b=b && handler.writeEnd();
b=b && lti::write(handler, "offset", offset);
b=b && lti::write(handler, "scale", scale);
}
if (complete) {
b=handler.writeEnd();
}
return b;
}