⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 regressionoperatorresult.java

📁 一个数据挖掘软件ALPHAMINERR的整个过程的JAVA版源代码
💻 JAVA
字号:
/*
 *    This program is free software; you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation; either version 2 of the License, or
 *    (at your option) any later version.
 *
 *    This program is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with this program; if not, write to the Free Software
 *    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */

/*
 * Created on 2005-1-19
 *
 * TODO To change the template for this generated file go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
package eti.bi.alphaminer.patch.standard.operation.result;


import com.prudsys.pdm.Core.MiningAttribute;
import com.prudsys.pdm.Core.MiningException;

import eti.bi.alphaminer.core.handler.ICaseHandler;
import eti.bi.alphaminer.operation.operator.INodeInfo;
import eti.bi.alphaminer.operation.result.OperatorResult;
import eti.bi.alphaminer.operation.result.view.PmmlView;
import eti.bi.alphaminer.patch.standard.operation.operator.RegressionOperator;
import eti.bi.alphaminer.patch.standard.operation.result.view.LogisticDataView;
import eti.bi.alphaminer.patch.standard.operation.result.view.LogisticTableView;
import eti.bi.alphaminer.vo.IBIData;
import eti.bi.alphaminer.vo.IBIModel;
import eti.bi.alphaminer.vo.IBIObject;
import eti.bi.common.Locale.Resource;
import eti.bi.exception.SysException;

/**
 * Create the result JPanle for the Logistic Regression Operator.
 * It contains the Table View, PMML View and Data View.
 *
 * @author TWang On Jan 25, 2005.
 *
 */ 
public class RegressionOperatorResult extends OperatorResult {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private RegressionOperator m_RegressionOperator;  
	private String m_ModelPMMLPath; 
	private MiningAttribute[] m_Attributes;    

	/**
	 * Create the Regression Operator Result Panel
	 * @param a_CaseID
	 * @param a_NodeID
	 * @param a_Name
	 * 
	 * @throws Exception
	 */
	public RegressionOperatorResult(String a_CaseID, String a_NodeID,
			String a_Name,INodeInfo a_NodeInfo, ICaseHandler a_CaseHandler) throws Exception {
		super(a_Name + Resource.srcStr("Result"), a_CaseID, a_NodeID,a_NodeInfo, a_CaseHandler);
	}

	@Override
	protected void init() throws Exception {
		
	}
	
	/**
	 * @throws MiningException
	 */
	protected void getContent() throws MiningException {
		m_RegressionOperator = (RegressionOperator) m_Operator;
		IBIObject aBIObject = m_RegressionOperator.getOutputBIObject();
		if (aBIObject == null || aBIObject.getBIModel() == null
				|| aBIObject.getBIData() == null) {
			return;
		}
		IBIModel aBIModel = aBIObject.getBIModel();
		IBIData aBIData = aBIObject.getBIData(); 
    	
   		m_Attributes = aBIData.getMetaData().getAttributesArray(); 
   		try {
			// to create pmml view
   			m_Operator.writeTempModelFile();
			m_ModelPMMLPath = aBIModel.getTempBIModelPath();
		} catch (SysException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
	
	/**
	 * Create Views.
	 * @throws Exception
	 */
	protected void createResult() throws Exception { 
		
 		LogisticTableView tableView = new LogisticTableView(m_RegressionOperator); 	
		PmmlView pmmlView = new PmmlView(m_ModelPMMLPath, this);
		LogisticDataView dataView = new LogisticDataView(m_RegressionOperator, m_Attributes);
		addView(tableView);
		
		try {
			pmmlView.preparePmml();
			pmmlView.showPmml();
			addView(pmmlView);
		} catch (SysException e) {
			e.printStackTrace();
			m_SystemMessageHandler.appendMessage(e.getMessage());
		}
 				
		addView(pmmlView);	
		addView(dataView);
	  
	  	this.setClosable(true);	  	
 		this.setMaximizable(true);
 		this.setResizable(true);		
 		this.setSize(700, 400); 
	} 
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -