| 一、功能模块
1.命令行处理器:提供简单的命令接口 2.数据探索器:数据源,数据预处理,数据浏览的集成环境 3.挖掘&统计:常用的数据挖掘模型,统计模型实验 4.知识流管理:提供多模型处理序列,像工作流 5.数据浏览器:WEKA专用数据格式Arff数据的浏览与处理 6.日志:系统运行日志

二、WEKA Explorer[探索器] (1)数据预处理: 加载数据:数据源选择-文本文件,平面文件,数据库连接,实验数据生成器 数据特性:关系,记录数,属性数 特征处理:属性选择,属性名,类型,丢失值处理 过滤处理:过滤器选择 (2)分类 选择分类模型 测试选项:是否交叉测试等 类属性 训练分类器 分类输出显示 结果处理 (3)聚类 选择聚类模型 聚类模式 选择属性 聚类学习 (4)关联 选择关联规则,算法,过滤器,配置信息等 关联学习 (5)特征选择 搜索评估 选项 提取处理 (6)数据可视化 散点矩阵 二维散点图
三、系统运行方式简要分析[以Explorer中集成的LIBSVM模型为例] 1.系统初始运行: 类GUIChooser继承JFrame,生成系统初始界面,同时加载如下模块: protected SimpleCLI m_SimpleCLI; protected JFrame m_ExplorerFrame; protected JFrame m_ExperimenterFrame; protected JFrame m_KnowledgeFlowFrame; protected static LogWindow m_LogWindow = new LogWindow();
2.Explorer运行: 通过上面接口ExplorerFrame调用Explorer模块 m_ExplorerFrame.getContentPane().add(new Explorer(), BorderLayout.CENTER); 类Explorer继承JPanel 在Explorer中定义相关处理模块: protected PreprocessPanel m_PreprocessPanel = new PreprocessPanel(); protected ClassifierPanel m_ClassifierPanel = new ClassifierPanel(); protected ClustererPanel m_ClustererPanel = new ClustererPanel(); protected AssociationsPanel m_AssociationPanel = new AssociationsPanel(); protected AttributeSelectionPanel m_AttributeSelectionPanel =new AttributeSelectionPanel(); protected MatrixPanel m_VisualizePanel =new MatrixPanel();
3.选择分类模型 类ClassifierPanel继承JPanel 几个主要的模型相关处理类 //配置分类器 protected GenericObjectEditor m_ClassifierEditor =new GenericObjectEditor(); //分类器属性 protected PropertyPanel m_CEPanel = new PropertyPanel(m_ClassifierEditor); //分类输出 protected JTextArea m_OutText = new JTextArea(20, 40); //分类结果浏览 protected ResultHistoryPanel m_History = new ResultHistoryPanel(m_OutText);
从GenericObjectEditor的选择中获得所选择的分类器实例 m_ClassifierEditor.setClassType(Classifier.class); m_ClassifierEditor.setValue(new weka.classifiers.rules.ZeroR()); m_ClassifierEditor.addPropertyChangeListener(new PropertyChangeListener() { public void propertyChange(PropertyChangeEvent e) { repaint(); } Classifier classifier = (Classifier) m_ClassifierEditor.getValue(); 类ClassifierPanel中的startClassifier方法 protected Instances m_Instances=inst; inst.setClassIndex(classIndex); 建立分类器实例 classifier.buildClassifier(inst);
4.进入分类核心类Classifier(为所有分类器的基类) public abstract class Classifier implements Cloneable, Serializable, OptionHandler, CapabilitiesHandler {} 建立分类器 public abstract void buildClassifier(Instances data) throws Exception; 对所给实例进行分类 public double classifyInstance(Instance instance) throws Exception 预测类标号 public double[] distributionForInstance(Instance instance) throws Exception
5.具体分类器实现,以LIBSVM为例(所有的分类器实例都继承自Classifier) public class LibSVM extends Classifier 主要的几个方法: setOptions-设置分类模型选项 getParameters-获得参数 对所给实例进行分类 public double classifyInstance(Instance instance) throws Exception 对基类中抽象函数实现 public void buildClassifier(Instances insts) throws Exception 再就是模型的一些具体处理函数: SVMType-支持向量机类型设置 Weights-权重设置 调用相关对象的方法,由于是集成了LIBSVM,只需要把libsvm.jar加入CLASSPATH,就能用java.lang.reflect.Method.invokeMethod方法调用libsvm 中的方法 protected Object invokeMethod(Object o, String name, Class[] paramClasses, Object[] paramValues)
|