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


Java ResultService类代码示例

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


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

示例1: prepareRun

import com.rapidminer.tools.ResultService; //导入依赖的package包/类
/**
 * This method initializes the process, the operators, and the services and must be invoked at
 * the beginning of run. It also resets all apply counts.
 */
private final void prepareRun(final int logVerbosity) throws OperatorException {
	initLogging(logVerbosity);

	setProcessState(PROCESS_STATE_RUNNING);
	getLogger().fine("Initialising process setup.");

	RandomGenerator.init(this);
	ResultService.init(this);

	clearDataTables();
	clearReportStreams();
	clearMacros();
	clearStorage();
	if (getExecutionMode() != ExecutionMode.ONLY_DIRTY) {
		getRootOperator().clear(Port.CLEAR_DATA);
	}
	AttributeFactory.resetNameCounters();

	getLogger().fine("Process initialised.");

	// add process start macro value here already to have it available for root parameters
	// can be overwritten if it is passed to the run() method via the macro map
	getMacroHandler().addMacro(MacroHandler.PROCESS_START,
			MacroHandler.DATE_FORMAT.get().format(new Date(System.currentTimeMillis())));
}
 
开发者ID:rapidminer,项目名称:rapidminer-studio,代码行数:30,代码来源:Process.java

示例2: prepareRun

import com.rapidminer.tools.ResultService; //导入依赖的package包/类
/**
 * This method initializes the process, the operators, and the services and must be invoked at the beginning of run.
 * It also resets all apply counts.
 */
private final void prepareRun(int logVerbosity) throws OperatorException {
	initLogging(logVerbosity);

	setProcessState(PROCESS_STATE_RUNNING);
	getLogger().fine("Initialising process setup.");

	RandomGenerator.init(this);
	ResultService.init(this);

	// checkProcess(null);
	clearDataTables();
	clearReportStreams();
	clearMacros();
	clearStorage();
	if (getExecutionMode() != ExecutionMode.ONLY_DIRTY) {
		getRootOperator().clear(Port.CLEAR_DATA);
	}
	AttributeFactory.resetNameCounters();

	getLogger().fine("Process initialised.");
}
 
开发者ID:rapidminer,项目名称:rapidminer-5,代码行数:26,代码来源:Process.java

示例3: tearDown

import com.rapidminer.tools.ResultService; //导入依赖的package包/类
/** This method is invoked after a process has finished. */
private void tearDown() {
	try {
		rootOperator.processFinished();
	} catch (OperatorException e) {
		getLogger().log(Level.WARNING, "Problem during finishing the process: " + e.getMessage(), e);
	}

	// clean up
	// clearMacros();
	clearReportStreams();
	clearStorage();
	clearUnknownParameters();
	ResultService.close();
}
 
开发者ID:rapidminer,项目名称:rapidminer-studio,代码行数:16,代码来源:Process.java

示例4: doWork

import com.rapidminer.tools.ResultService; //导入依赖的package包/类
/**
 * Use the ResultService to write the results of all input ResultObjects into the result file.
 */
@Override
public void doWork() throws OperatorException {
	IOObject[] input = portExtender.getData(IOObject.class).toArray(new IOObject[0]);
	File file = getParameterAsFile(PARAMETER_RESULT_FILE, true);
	if (file != null) {
		try (FileOutputStream fos = new FileOutputStream(file, !firstRun);
				OutputStreamWriter osw = new OutputStreamWriter(fos, Encoding.getEncoding(this));
				PrintWriter out = new PrintWriter(osw)) {
			firstRun = false;
			ResultService.logResult("Results of ResultWriter '" + getName() + "' [" + getApplyCount() + "]: ", out);
			for (int i = 0; i < input.length; i++) {
				if (input[i] instanceof ResultObject) {
					ResultService.logResult((ResultObject) input[i], out);
				}
			}
		} catch (FileNotFoundException e) {
			throw new UserError(this, 301, file);
		} catch (IOException ioe) {
			throw new UserError(this, 321, file, ioe);
		}
	} else {
		ResultService.logResult("Results of ResultWriter '" + getName() + "' [" + getApplyCount() + "]: ");
		for (int i = 0; i < input.length; i++) {
			if (input[i] instanceof ResultObject) {
				ResultService.logResult((ResultObject) input[i]);
			}
		}
	}
	portExtender.passDataThrough();
}
 
开发者ID:rapidminer,项目名称:rapidminer-studio,代码行数:34,代码来源:ResultWriter.java

示例5: tearDown

import com.rapidminer.tools.ResultService; //导入依赖的package包/类
/** This method is invoked after a process has finished. */
private void tearDown() {
	try {
		rootOperator.processFinished();
	} catch (OperatorException e) {
		getLogger().log(Level.WARNING, "Problem during finishing the process: " + e.getMessage(), e);
	}

	// clean up
	//clearMacros();
	clearReportStreams();
	clearStorage();
	clearUnknownParameters();
	ResultService.close();
}
 
开发者ID:rapidminer,项目名称:rapidminer-5,代码行数:16,代码来源:Process.java

示例6: doWork

import com.rapidminer.tools.ResultService; //导入依赖的package包/类
/**
 * Use the ResultService to write the results of all input ResultObjects
 * into the result file.
 */
@Override
public void doWork() throws OperatorException {		
	IOObject[] input = portExtender.getData(IOObject.class).toArray(new IOObject[0]);
	File file = getParameterAsFile(PARAMETER_RESULT_FILE, true);
	if (file != null) {
		PrintWriter out = null;
		try {
			out = new PrintWriter(new OutputStreamWriter(new FileOutputStream(file, !firstRun), Encoding.getEncoding(this)));
			firstRun = false;
		} catch (IOException e) {
			throw new UserError(this, 301, file);
		}
		if (out != null) {
			ResultService.logResult("Results of ResultWriter '" + getName() + "' [" + getApplyCount() + "]: ", out);
			for (int i = 0; i < input.length; i++) {
				if (input[i] instanceof ResultObject)
					ResultService.logResult((ResultObject) input[i], out);
			}
			out.close();
		}
	} else {
		ResultService.logResult("Results of ResultWriter '" + getName() + "' [" + getApplyCount() + "]: ");
		for (int i = 0; i < input.length; i++) {
			if (input[i] instanceof ResultObject)
				ResultService.logResult((ResultObject) input[i]);
		}
	}
	portExtender.passDataThrough();
}
 
开发者ID:rapidminer,项目名称:rapidminer-5,代码行数:34,代码来源:ResultWriter.java


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