21 using namespace KKMLL;
28 number_of_rounds (-1),
40 int _number_of_rounds,
41 int _number_of_trials,
47 out_limit (_out_limit),
48 number_of_rounds (_number_of_rounds),
49 number_of_trials (_number_of_trials),
50 random_seed (_random_seed),
120 parameterUsed =
false;
143 cmdStr <<
"-InLimit " << in_limit <<
" " 144 <<
"-OutLimit " << out_limit;
146 if (number_of_rounds > 0)
147 cmdStr <<
" -R " << number_of_rounds;
149 cmdStr <<
" -T " << number_of_trials;
152 cmdStr <<
" -S " << random_seed;
154 cmdStr <<
" -UseCache " << (useCache ?
"Yes" :
"No");
174 XmlElementInt32::WriteXML (in_limit,
"in_limit", o);
175 XmlElementInt32::WriteXML (number_of_rounds,
"number_of_rounds", o);
176 XmlElementInt32::WriteXML (number_of_trials,
"number_of_trials", o);
177 XmlElementInt64::WriteXML (random_seed,
"random_seed", o);
196 while (t && (!cancelFlag))
205 in_limit =
dynamic_cast<XmlElementInt32Ptr> (e)->Value ();
208 number_of_rounds =
dynamic_cast<XmlElementInt32Ptr> (e)->Value ();
211 number_of_trials =
dynamic_cast<XmlElementInt32Ptr> (e)->Value ();
214 random_seed =
dynamic_cast<XmlElementInt64Ptr> (e)->Value ();
221 log.Level (-1) << endl
222 <<
"ModelParamUsfCasCor::ReadXM ***ERROR*** Unexpected Element: " << e->NameTag ()->ToString () << endl
232 bool validFormat =
false;
KKStr(kkint32 size)
Creates a KKStr object that pre-allocates space for 'size' characters.
XmlTag(const KKStr &_name, TagTypes _tagType)
bool EqualIgnoreCase(const char *s2) const
void WriteXMLFields(std::ostream &o) const
XmlElementBool * XmlElementBoolPtr
virtual ~ModelParamUsfCasCor()
static void WriteXML(const bool b, const KKStr &varName, std::ostream &o)
XmlElement * XmlElementPtr
void AddAtribute(const KKStr &attributeName, const KKStr &attributeValue)
XmlTokenPtr ReadXMLModelParamToken(XmlTokenPtr t)
Will process any tokens that belong to 'ModelParam' and return NULL ones that are not will be passed ...
XmlTag const * XmlTagConstPtr
Manages the reading and writing of objects in a simple XML format. For a class to be supported by Xml...
This class encapsulates are the information necessary to build a UsfCasCor class. ...
static KKStr Concat(const std::vector< std::string > &values)
Concatenates the list of 'std::string' strings.
ModelParamUsfCasCor(int _in_limit, int _out_limit, int _number_of_rounds, int _number_of_trials, kkint64 _random_seed, bool _useCache)
virtual const KKStr & VarName() const
virtual ModelParamUsfCasCorPtr Duplicate() const
virtual void ReadXML(XmlStream &s, XmlTagConstPtr tag, VolConstBool &cancelFlag, RunLog &log)
virtual KKStr ToCmdLineStr() const
Creates a Command Line String that represents these parameters.
ModelParamUsfCasCor * ModelParamUsfCasCorPtr
void WriteXML(std::ostream &o)
Used for logging messages.
void EncodeProblem(const struct svm_paramater ¶m, struct svm_problem &prob_in, struct svm_problem &prob_out)
virtual void WriteXML(const KKStr &varName, ostream &o) const
virtual TokenTypes TokenType()=0
virtual XmlTokenPtr GetNextToken(VolConstBool &cancelFlag, RunLog &log)
bool ToBool() const
Returns the bool equivalent of the string, ex 'Yes' = true, 'No' = false, 'True' = true...
Abstract Base class for Machine Learning parameters.
#define XmlFactoryMacro(NameOfClass)
volatile const bool VolConstBool