本文整理汇总了C++中CDataset::misc_ptr方法的典型用法代码示例。如果您正苦于以下问题:C++ CDataset::misc_ptr方法的具体用法?C++ CDataset::misc_ptr怎么用?C++ CDataset::misc_ptr使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CDataset
的用法示例。
在下文中一共展示了CDataset::misc_ptr方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
std::auto_ptr<CDistribution> gbm_setup
(
const CDataset& data,
const std::string& family,
int cTrees,
int cDepth,
int cMinObsInNode,
int cNumClasses,
double dShrinkage,
double dBagFraction,
int cTrain,
int cFeatures,
int& cGroups
)
{
std::auto_ptr<CDistribution> pDist;
cGroups = -1;
// set the distribution
if (family == "gamma") {
pDist.reset(new CGamma());
}
else if (family == "tweedie") {
pDist.reset(new CTweedie(data.misc_ptr()[0]));
}
else if (family == "bernoulli")
{
pDist.reset(new CBernoulli());
}
else if (family == "gaussian")
{
pDist.reset(new CGaussian());
}
else if (family == "poisson")
{
pDist.reset(new CPoisson());
}
else if (family == "adaboost")
{
pDist.reset(new CAdaBoost());
}
else if (family == "coxph")
{
pDist.reset(new CCoxPH());
}
else if (family == "laplace")
{
pDist.reset(new CLaplace());
}
else if (family == "quantile")
{
pDist.reset(new CQuantile(data.misc_ptr()[0]));
}
else if (family == "tdist")
{
pDist.reset(new CTDist(data.misc_ptr()[0]));
}
else if (family == "multinomial")
{
pDist.reset(new CMultinomial(cNumClasses, data.nrow()));
}
else if (family == "huberized")
{
pDist.reset(new CHuberized());
}
else if (family == "pairwise_conc")
{
pDist.reset(new CPairwise("conc"));
}
else if (family == "pairwise_ndcg")
{
pDist.reset(new CPairwise("ndcg"));
}
else if (family == "pairwise_map")
{
pDist.reset(new CPairwise("map"));
}
else if (family == "pairwise_mrr")
{
pDist.reset(new CPairwise("mrr"));
}
else
{
throw GBM::invalid_argument();
}
if (0==family.compare(0, 8, "pairwise"))
{
cGroups = num_groups(data.misc_ptr(), cTrain);
}
return pDist;
}