本文整理汇总了C#中RealFeatures.set_preprocessed方法的典型用法代码示例。如果您正苦于以下问题:C# RealFeatures.set_preprocessed方法的具体用法?C# RealFeatures.set_preprocessed怎么用?C# RealFeatures.set_preprocessed使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RealFeatures
的用法示例。
在下文中一共展示了RealFeatures.set_preprocessed方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Main
static void Main(string[] argv)
{
modshogun.init_shogun_with_defaults();
int num = 1000;
double dist = 1.0;
double width = 2.1;
double C = 1.0;
DoubleMatrix offs =ones(2, num).mmul(dist);
DoubleMatrix x = randn(2, num).sub(offs);
DoubleMatrix y = randn(2, num).add(offs);
DoubleMatrix traindata_real = concatHorizontally(x, y);
DoubleMatrix o = ones(1,num);
DoubleMatrix trainlab = concatHorizontally(o.neg(), o);
DoubleMatrix testlab = concatHorizontally(o.neg(), o);
RealFeatures feats = new RealFeatures(traindata_real);
GaussianKernel kernel = new GaussianKernel(feats, feats, width);
Labels labels = new Labels(trainlab);
GMNPSVM svm = new GMNPSVM(C, kernel, labels);
feats.add_preprocessor(new NormOne());
feats.add_preprocessor(new LogPlusOne());
feats.set_preprocessed(1);
svm.train(feats);
SerializableAsciiFile fstream = new SerializableAsciiFile("blaah.asc", 'w');
//svm.save_serializable(fstream);
modshogun.exit_shogun();
}