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

📄 miningmodel.java

📁 一个数据挖掘软件ALPHAMINERR的整个过程的JAVA版源代码
💻 JAVA
📖 第 1 页 / 共 2 页
字号:
/*
 *    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.
 */

 /**
  * Title: XELOPES Data Mining Library
  * Description: The XELOPES library is an open platform-independent and data-source-independent library for Embedded Data Mining.
  * Copyright: Copyright (c) 2002 Prudential Systems Software GmbH
  * Company: ZSoft (www.zsoft.ru), Prudsys (www.prudsys.com)
  * @author Valentine Stepanenko (valentine.stepanenko@zsoft.ru)
  * @version 1.2
  */

package com.prudsys.pdm.Core;

import java.io.Reader;
import java.io.Writer;

import com.prudsys.pdm.Input.MiningInputStream;
import com.prudsys.pdm.Input.MiningVector;
import com.prudsys.pdm.Transform.MiningTransformer;

/**
  * Description of the data produced by a mining function. <p>
  *
  * From CWM Data Mining. <p>
  *
  * Superclasses:
  * <ul>
  *   <li> Class
  * </ul>
  * Attributes:
  * <ul>
  *   <li> <i>function</i>: Names the mining function. The following functions
  *   are predefined: StatisticalAnalysis, FeatureSelection, AssociationRules,
  *   Classification, Clustering, Regression as well as (from PDM extension)
  *   Sequential, CustomerSequential, TimeSeriesPrediction. <br>
  *     - type: String <br>
  *     - multiplicity: exactly one
  *   <li> <i>algorithm</i>: Names the algorithm used to perform the mining function.
  *   The following algorithms are predefined: decisionTree, neuralNetwork, naiveBayes,
  *   selfOrganizingMap, centerBasedClustering, distributionBasedClustering,
  *   associationRules, polynomialRegression, radialBasisFunction,
  *   ruleBasedClassification, principalComponentAnalysis, factorAnalysis,
  *   bivariateAnalysis, descriptiveAnalysis, geneticAlgorithm as well as
  *   (from PDM extension) sequenceAnalysis, sequentialBasketAnalysis,
  *   supportVectorMachine, sparseGrids, nonlinearDecisionTree,
  *   multidimensionalTimeSeries, hierarchicalClustering,
  *   partitioningClustering. <br>
  *     - type: String <br>
  *     - multiplicity: exactly one
  * </ul>
  * References:
  * <ul>
  *   <li> <i>miningSettings</i>: References the mining model's settings. <br>
  *       - class: MiningSettings <br>
  *       - defined by: DerivedFromSettings::settings <br>
  *       - multiplicity: zero or one
  *   <li> <i>inputSpec</i>: References the MiningAttributes. <br>
  *       - class: ApplicationInputSpecification <br>
  *       - defined by: MiningModelOwnsInputSpecification::inputSpec <br>
  *       - multiplicity: one or more
  *   <li> <i>miningTransform</i>: References the inner transformations. <br>
  *       - class: MiningTransformer <br>
  *       - multiplicity: one or more
  * </ul>
  * Constraints:
  * <ul>
  *   <li> Function and algorithm must be equal to function and algorithm of
  *   Mining Settings, respectively.
  * </ul>
  *
  * In addition, functionality from PMML was added.
  *
  * @see com.prudsys.pdm.Input.MiningInputStream
  * @see MiningSettings
  * @see ApplicationInputSpecification
  * @see MiningModelResult
  */
public abstract class MiningModel extends com.prudsys.pdm.Cwm.Core.Class implements PmmlSerializable
{
    // -----------------------------------------------------------------------
    //  Constants of mining functions and algorithms, application names
    // -----------------------------------------------------------------------
    // Functions:
    public static final String STATISTICAL_ANALYSIS_FUNCTION   = "StatisticalAnalysis";
    public static final String FEATURE_SELECTION_FUNCTION      = "FeatureSelection";
    public static final String ASSOCIATION_RULES_FUNCTION      = "AssociationRules";
    public static final String CLASSIFICATION_FUNCTION         = "Classification";
    public static final String CLUSTERING_FUNCTION             = "Clustering";
    public static final String REGRESSION_FUNCTION             = "Regression";

    // Added for XELOPES:
    public static final String SEQUENTIAL_FUNCTION             = "Sequential";
    public static final String CUSTOMER_SEQUENTIAL_FUNCTION    = "CustomerSequential";
    public static final String TIME_SERIES_PREDICTION_FUNCTION = "TimeSeriesPrediction";

    // Algorithms:
    public static final String DECISION_TREE_ALGORITHM                 = "decisionTree";
    public static final String NEURAL_NETWORK_ALGORITHM                = "neuralNetwork";
    public static final String NAIVE_BAYES_ALGORITHM                   = "naiveBayes";
    public static final String SELFORGANIZING_MAP_ALGORITHM            = "selfOrganizingMap";
    public static final String CENTER_BASED_CLUSTERING_ALGORITHM       = "centerBasedClustering";
    public static final String DISTRIBUTION_BASED_CLUSTERIN_ALGORITHM  = "distributionBasedClustering";
    public static final String ASSOCIATION_RULES_ALGORITHM             = "associationRules";
    public static final String POLYNOMIAL_REGRESSION_ALGORITHM         = "polynomialRegression";
    public static final String RADIAL_BASIS_FUNCTION_ALGORITHM         = "radialBasisFunction";
    public static final String RULE_BASED_CLASSIFICATION_ALGORITHM     = "ruleBasedClassification";
    public static final String PRINCIPAL_COMPONENT_ANALYSIS_ALGORITHM  = "principalComponentAnalysis";
    public static final String FACTOR_ANALYSIS_ALGORITHM               = "factorAnalysis";
    public static final String BIVARIATE_ANALYSIS_ALGORITHM            = "bivariateAnalysis";
    public static final String DESCRIPTIVE_ANALYSIS_ALGORITHM          = "descriptiveAnalysis";
    public static final String GENETIC_ALGORITHM_ALGORITHM             = "geneticAlgorithm";

    // Added for XELOPES:
    public static final String SEQUENCE_ANALYSIS_ALGORITHM             = "sequenceAnalysis";
    public static final String SEQUENTIAL_BASKET_ANALYSIS_ALGORITHM    = "sequentialBasketAnalysis";
    public static final String SUPPORT_VECTOR_MACHINE_ALGORITHM        = "supportVectorMachine";
    public static final String SPARSE_GRIDS_ALGORITHM                  = "sparseGrids";
    public static final String NONLINEAR_DECICION_TREE_ALGORITHM       = "nonlinearDecisionTree";
    public static final String MULTIDIMENSIONAL_TIME_SERIES_ALGORITHM  = "multidimensionalTimeSeries";
    public static final String HIERARCHICAL_CLUSTERING_ALGORITHM       = "hierarchicalClustering";
    public static final String PARTITIONING_CLUSTERING_ALGORITHM       = "partitioningClustering";

    // Application names (in PMML models):
    public static final String APPLICATION_PRUDSYS_XELOPES             = "Xelopes";
    public static final String APPLICATION_PRUDSYS_DISCOVERER          = "prudsys DISCOVERER";
    public static final String APPLICATION_PRUDSYS_BASKET_ANALYZER     = "prudsys BASKET ANALYZER";
    public static final String APPLICATION_PRUDSYS_MERKUR_MINER        = "prudsys MERKUR MINER PLUS";
    public static final String APPLICATION_PRUDSYS_PREMINER            = "prudsys PREMINER";
    public static final String APPLICATION_IBM_INTELLIGENT_MINER       = "IBM Intelligent Miner";
    public static final String APPLICATION_SPSS_CLEMENTINE             = "Clementine";
    public static final String APPLICATION_SAS_ENTERPRISE_MINER        = "Enterprise Miner";

    // -----------------------------------------------------------------------
    //  Variables declarations
    // -----------------------------------------------------------------------
    /**
     * Names the mining function. The following functions are predefined:
     * StatisticalAnalysis, FeatureSelection, AssociationRules, Classification,
     * Clustering, Regression, Sequential, CustomerSequential,
     * TimeSeriesPrediction
     */
    protected String function = "";

    /**
     * Names the algorithm used to perform the mining function. The following
     * algorithms are predefined: decisionTree, neuralNetwork, naiveBayes,
     * selfOrganizingMap, centerBasedClustering, distributionBasedClustering,
     * associationRules, polynomialRegression, radialBasisFunction,
     * ruleBasedClassification, principalComponentAnalysis, factorAnalysis,
     * bivariateAnalysis, descriptiveAnalysis, geneticAlgorithm, sequenceAnalysis,
     * sequentialBasketAnalysis, supportVectorMachine, sparseGrids,
     * nonlinearDecisionTree, multidimensionalTimeSeries, hierarchicalClustering,
     * partitioningClustering
     */
    protected String algorithm = "";

    /** Names the application. */
    protected String applicationName = APPLICATION_PRUDSYS_XELOPES;

    /** Holds the version of the application. */
    protected String applicationVersion = "1.2.1";

    /** Mining settings of model generation. */
    protected MiningSettings miningSettings = null;

    /** Application input specification of the model. */
    protected ApplicationInputSpecification inputSpec = null;

    /** Inner transformation object of the model. */
    protected MiningTransformer miningTransform = null;

    /** Result of applying the model to some data. Currently not used. */
    protected MiningModelResult miningResult[] = null;

    /** PMML file name of the model (if exist). */
    protected String fileName = null;

    // -----------------------------------------------------------------------
    //  Constructor
    // -----------------------------------------------------------------------
    /**
     * Empty constructor.
     */
    public MiningModel()
    {
    }

    // -----------------------------------------------------------------------
    //  Getter and setter methods
    // -----------------------------------------------------------------------
    /**
     * Returns function which has created the model.
     *
     * @return function which has created the model
     */
    public String getFunction()
    {
        return function;
    }

    /**
     * Sets function which as created the model
     *
     * @param function function which has created the model
     */
    public void setFunction(String function)
    {
        this.function = function;
    }

    /**
     * Returns algorithm which has created the model.
     *
     * @return algorithm which has created the model
     */
    public String getAlgorithm()
    {
        return algorithm;
    }

    /**
     * Sets algorithm which has created the model.
     *
     * @param algorithm algorithm which has created the model
     */
    public void setAlgorithm(String algorithm)
    {
        this.algorithm = algorithm;
    }

    /**
     * Returns the application name (default: "Xelopes").
     *
     * @return application name
     */

⌨️ 快捷键说明

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