当前位置: 首页>>代码示例>>Java>>正文


Java KernelPolynomial类代码示例

本文整理汇总了Java中com.rapidminer.operator.learner.functions.kernel.jmysvm.kernel.KernelPolynomial的典型用法代码示例。如果您正苦于以下问题:Java KernelPolynomial类的具体用法?Java KernelPolynomial怎么用?Java KernelPolynomial使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


KernelPolynomial类属于com.rapidminer.operator.learner.functions.kernel.jmysvm.kernel包,在下文中一共展示了KernelPolynomial类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createKernel

import com.rapidminer.operator.learner.functions.kernel.jmysvm.kernel.KernelPolynomial; //导入依赖的package包/类
/**
 * Creates a new kernel of the given type. The kernel type has to be one out of KERNEL_DOT,
 * KERNEL_RADIAL, KERNEL_POLYNOMIAL, KERNEL_NEURAL, KERNEL_EPANECHNIKOV,
 * KERNEL_GAUSSIAN_COMBINATION, or KERNEL_MULTIQUADRIC.
 */
public static Kernel createKernel(int kernelType) {
	switch (kernelType) {
		case KERNEL_DOT:
			return new KernelDot();
		case KERNEL_RADIAL:
			return new KernelRadial();
		case KERNEL_POLYNOMIAL:
			return new KernelPolynomial();
		case KERNEL_NEURAL:
			return new KernelNeural();
		case KERNEL_ANOVA:
			return new KernelAnova();
		case KERNEL_EPANECHNIKOV:
			return new KernelEpanechnikov();
		case KERNEL_GAUSSIAN_COMBINATION:
			return new KernelGaussianCombination();
		case KERNEL_MULTIQUADRIC:
			return new KernelMultiquadric();
		default:
			return new KernelDot();
	}
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:28,代码来源:AbstractMySVMLearner.java

示例2: createKernel

import com.rapidminer.operator.learner.functions.kernel.jmysvm.kernel.KernelPolynomial; //导入依赖的package包/类
/**
 * Creates a new kernel of the given type. The kernel type has to be one out
 * of KERNEL_DOT, KERNEL_RADIAL, KERNEL_POLYNOMIAL, KERNEL_NEURAL, 
 * KERNEL_EPANECHNIKOV, KERNEL_GAUSSIAN_COMBINATION, or KERNEL_MULTIQUADRIC.
 */
public static Kernel createKernel(int kernelType) {
	switch (kernelType) {
	case KERNEL_DOT:
		return new KernelDot();
	case KERNEL_RADIAL:
		return new KernelRadial();
	case KERNEL_POLYNOMIAL:
		return new KernelPolynomial();
	case KERNEL_NEURAL:
		return new KernelNeural();
	case KERNEL_ANOVA:
		return new KernelAnova();
	case KERNEL_EPANECHNIKOV:
		return new KernelEpanechnikov();
	case KERNEL_GAUSSIAN_COMBINATION:
		return new KernelGaussianCombination();
	case KERNEL_MULTIQUADRIC:
		return new KernelMultiquadric();
	default:
		return new KernelDot();
	}
}
 
开发者ID:rapidminer,项目名称:rapidminer-5,代码行数:28,代码来源:AbstractMySVMLearner.java

示例3: createKernel

import com.rapidminer.operator.learner.functions.kernel.jmysvm.kernel.KernelPolynomial; //导入依赖的package包/类
/**
 * Creates a new kernel of the given type. The kernel type has to be one out of KERNEL_DOT,
 * KERNEL_RADIAL, KERNEL_POLYNOMIAL, or KERNEL_NEURAL.
 */
public static Kernel createKernel(int kernelType) {
	switch (kernelType) {
		case KERNEL_RADIAL:
			return new KernelRadial();
		case KERNEL_POLYNOMIAL:
			return new KernelPolynomial();
		case KERNEL_NEURAL:
			return new KernelNeural();
		default:
			return new KernelDot();
	}
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:17,代码来源:SVClustering.java

示例4: createKernel

import com.rapidminer.operator.learner.functions.kernel.jmysvm.kernel.KernelPolynomial; //导入依赖的package包/类
/**
 * Creates a new kernel of the given type. The kernel type has to be one out of KERNEL_DOT, KERNEL_RADIAL, KERNEL_POLYNOMIAL, or KERNEL_NEURAL.
 */
public static Kernel createKernel(int kernelType) {
	switch (kernelType) {
	case KERNEL_RADIAL:
		return new KernelRadial();
	case KERNEL_POLYNOMIAL:
		return new KernelPolynomial();
	case KERNEL_NEURAL:
		return new KernelNeural();
	default:
		return new KernelDot();
	}
}
 
开发者ID:rapidminer,项目名称:rapidminer-5,代码行数:16,代码来源:SVClustering.java

示例5: learn

import com.rapidminer.operator.learner.functions.kernel.jmysvm.kernel.KernelPolynomial; //导入依赖的package包/类
@Override
public Model learn(ExampleSet exampleSet) throws OperatorException {
	Attribute label = exampleSet.getAttributes().getLabel();
	if (label.isNominal() && label.getMapping().size() != 2) {
		throw new UserError(this, 114, getName(), label.getName());
	}

	// check if example set contains missing values, if so fail because
	// this operator produces garbage with them
	Tools.onlyNonMissingValues(exampleSet, getOperatorClassName(), this, Attributes.LABEL_NAME);

	this.svmExamples = new com.rapidminer.operator.learner.functions.kernel.jmysvm.examples.SVMExamples(exampleSet,
			label, getParameterAsBoolean(PARAMETER_SCALE));

	// kernel
	int cacheSize = getParameterAsInt(PARAMETER_KERNEL_CACHE);
	int kernelType = getParameterAsInt(PARAMETER_KERNEL_TYPE);
	kernel = createKernel(kernelType);
	if (kernelType == KERNEL_RADIAL) {
		((KernelRadial) kernel).setGamma(getParameterAsDouble(PARAMETER_KERNEL_GAMMA));
	} else if (kernelType == KERNEL_POLYNOMIAL) {
		((KernelPolynomial) kernel).setDegree(getParameterAsDouble(PARAMETER_KERNEL_DEGREE));
	} else if (kernelType == KERNEL_NEURAL) {
		((KernelNeural) kernel).setParameters(getParameterAsDouble(PARAMETER_KERNEL_A),
				getParameterAsDouble(PARAMETER_KERNEL_B));
	} else if (kernelType == KERNEL_ANOVA) {
		((KernelAnova) kernel).setParameters(getParameterAsDouble(PARAMETER_KERNEL_GAMMA),
				getParameterAsDouble(PARAMETER_KERNEL_DEGREE));
	} else if (kernelType == KERNEL_EPANECHNIKOV) {
		((KernelEpanechnikov) kernel).setParameters(getParameterAsDouble(PARAMETER_KERNEL_SIGMA1),
				getParameterAsDouble(PARAMETER_KERNEL_DEGREE));
	} else if (kernelType == KERNEL_GAUSSIAN_COMBINATION) {
		((KernelGaussianCombination) kernel).setParameters(getParameterAsDouble(PARAMETER_KERNEL_SIGMA1),
				getParameterAsDouble(PARAMETER_KERNEL_SIGMA2), getParameterAsDouble(PARAMETER_KERNEL_SIGMA3));
	} else if (kernelType == KERNEL_MULTIQUADRIC) {
		((KernelMultiquadric) kernel).setParameters(getParameterAsDouble(PARAMETER_KERNEL_SIGMA1),
				getParameterAsDouble(PARAMETER_KERNEL_SHIFT));
	}
	kernel.init(svmExamples, cacheSize);

	// SVM
	svm = createSVM(label, kernel, svmExamples, exampleSet);
	svm.init(kernel, svmExamples);
	svm.train();

	return createSVMModel(exampleSet, svmExamples, kernel, kernelType);
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:48,代码来源:AbstractMySVMLearner.java

示例6: learn

import com.rapidminer.operator.learner.functions.kernel.jmysvm.kernel.KernelPolynomial; //导入依赖的package包/类
public Model learn(ExampleSet exampleSet) throws OperatorException {
	Attribute label = exampleSet.getAttributes().getLabel();
	if ((label.isNominal()) && (label.getMapping().size() != 2)) {
		throw new UserError(this, 114, getName(), label.getName());
	}
	this.svmExamples = new com.rapidminer.operator.learner.functions.kernel.jmysvm.examples.SVMExamples(exampleSet, label, getParameterAsBoolean(PARAMETER_SCALE));

	// kernel
	int cacheSize = getParameterAsInt(PARAMETER_KERNEL_CACHE);
	int kernelType = getParameterAsInt(PARAMETER_KERNEL_TYPE);
	kernel = createKernel(kernelType);
	if (kernelType == KERNEL_RADIAL)
		((KernelRadial) kernel).setGamma(getParameterAsDouble(PARAMETER_KERNEL_GAMMA));
	else if (kernelType == KERNEL_POLYNOMIAL)
		((KernelPolynomial) kernel).setDegree(getParameterAsDouble(PARAMETER_KERNEL_DEGREE));
	else if (kernelType == KERNEL_NEURAL)
		((KernelNeural) kernel).setParameters(
				getParameterAsDouble(PARAMETER_KERNEL_A), 
				getParameterAsDouble(PARAMETER_KERNEL_B));
	else if (kernelType == KERNEL_ANOVA)
		((KernelAnova) kernel).setParameters(
				getParameterAsDouble(PARAMETER_KERNEL_GAMMA), 
				getParameterAsDouble(PARAMETER_KERNEL_DEGREE));
	else if (kernelType == KERNEL_EPANECHNIKOV)
		((KernelEpanechnikov) kernel).setParameters(
				getParameterAsDouble(PARAMETER_KERNEL_SIGMA1), 
				getParameterAsDouble(PARAMETER_KERNEL_DEGREE));
	else if (kernelType == KERNEL_GAUSSIAN_COMBINATION)
		((KernelGaussianCombination) kernel).setParameters(
				getParameterAsDouble(PARAMETER_KERNEL_SIGMA1), 
				getParameterAsDouble(PARAMETER_KERNEL_SIGMA2),
				getParameterAsDouble(PARAMETER_KERNEL_SIGMA3));
	else if (kernelType == KERNEL_MULTIQUADRIC)
		((KernelMultiquadric) kernel).setParameters(
				getParameterAsDouble(PARAMETER_KERNEL_SIGMA1), 
				getParameterAsDouble(PARAMETER_KERNEL_SHIFT));
	kernel.init(svmExamples, cacheSize);

	// SVM
	svm = createSVM(label, kernel, svmExamples, exampleSet);
	svm.init(kernel, svmExamples);
	svm.train();

	return createSVMModel(exampleSet, svmExamples, kernel, kernelType);
}
 
开发者ID:rapidminer,项目名称:rapidminer-5,代码行数:46,代码来源:AbstractMySVMLearner.java


注:本文中的com.rapidminer.operator.learner.functions.kernel.jmysvm.kernel.KernelPolynomial类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。