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

📄 sparsegridssettings.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.
 */

/**
 * 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 Michael Thess
 * @version 1.1
 */
package com.prudsys.pdm.Models.Regression.SparseGrids;

import com.prudsys.pdm.Core.MiningModel;
import com.prudsys.pdm.Core.MiningSettings;
import com.prudsys.pdm.Models.Regression.RegressionSettings;

/**
  * Parameters for computing sparse grid models. <p>
  *
  * From PDM CWM extension. <p>
  *
  * Superclasses:
  * <ul>
  *   <li> RegressionSettings
  * </ul>
  * Attributes:
  * <ul>
  *   <li> <i>sgType</i>: Defines the type of SG. The following types
  *   are predefined: TensorProductBasisType, SimplicialBasisType. <br>
  *     - type: Integer <br>
  *     - multiplicity: exactly one
  *   <li> <i>basisDegree</i>: Defines the polynomial degree of the
  *   sparse grid basis functions: <br>
  *     - type: Integer <br>
  *     - multiplicity: exactly one
  *   <li> <i>waveletBasis</i>: Is basis wavelet or simple
  *   hierarchical basis (non-orthogonal, e.g. Yserantant)? <br>
  *     - type: Boolean <br>
  *     - multiplicity: exactly one
  *   <li> <i>coarseGrid</i>: Go down to coarsest level 0?
  *   Otherwise the common coarse-grid level 1 is used. <br>
  *     - type: Boolean <br>
  *     - multiplicity: exactly one
  *   <li> <i>level</i>: Level for uniform mesh refinement. <br>
  *     - type: Integer <br>
  *     - multiplicity: exactly one
  *   <li> <i>attributeLevels</i>: Array of levels for all attributes
  *   if anisotropic mesh refinement is used. <br>
  *     - type: Integer[] <br>
  *     - multilplicity: exactly one
  *   <li> <i>C</i>: Regularization parameter. <br>
  *     - type: float <br>
  *     - multilplicity: exactly one
  * </ul>
  *
  * @see MiningSettings
  * @see RegressionSettings
  */
public class SparseGridsSettings extends RegressionSettings
{
  // -----------------------------------------------------------------------
  //  Constants defining SG basis types
  // -----------------------------------------------------------------------
  /** Tensor product basis type. */
  public static final int SG_TENSOR_PRODUCT_BASIS_TYPE = 0;

  /** Simplicial basis type. */
  public static final int SG_SIMPLICIAL_BASIS_TYPE = 1;

  // -----------------------------------------------------------------------
  //  Variables declarations
  // -----------------------------------------------------------------------
  /** Defines the type of SG (tensor product, simplicial). */
  private int sgType = SG_TENSOR_PRODUCT_BASIS_TYPE;

  /** Defines the polynomial degree of SG basis functions. */
  private int basisDegree = 1;

  /** Is wavelet basis orthogonal? Otherwise, it is just biorthogonal. */
  private boolean waveletBasis = false;

  /** Include coarse level 0 into calculations? */
  private boolean coarseGrid = false;

  /** Discretization level. */
  private int level = 1;

  /** Array of discretization levels if anisotropic grid is used. */
  private int[] attributeLevels;

  /** Regularization parameter. */
  private double lambda = 1.0;

  // -----------------------------------------------------------------------
  //  Constructor
  // -----------------------------------------------------------------------
  /**
   * Empty constructor.
   */
  public SparseGridsSettings()
  {
      setFunction( MiningModel.REGRESSION_FUNCTION );
      setAlgorithm( MiningModel.SPARSE_GRIDS_ALGORITHM );
  }

  // -----------------------------------------------------------------------
  //  Getter and setter methods
  // -----------------------------------------------------------------------
  // model parameters:
  public void setSgType(int sgType)
  {
    this.sgType = sgType;
  }

  public int getSgType()
  {
    return sgType;
  }

  public void setBasisDegree(int basisDegree)
  {
    this.basisDegree = basisDegree;
  }

  public int getBasisDegree()
  {
    return basisDegree;
  }

  public void setWaveletBasis(boolean waveletBasis)
  {
    this.waveletBasis = waveletBasis;
  }

  public boolean isWaveletBasis()
  {
    return waveletBasis;
  }

  public void setCoarseGrid(boolean coarseGrid)
  {
    this.coarseGrid = coarseGrid;
  }
  public boolean isCoarseGrid()
  {
    return coarseGrid;
  }

  public void setLevel(int level)
  {
    this.level = level;
  }

  public int getLevel()
  {
    return level;
  }

  public void setAttributeLevels(int[] attributeLevels)
  {
    this.attributeLevels = attributeLevels;
  }

  public int[] getAttributeLevels()
  {
    return attributeLevels;
  }

  // algorithm parameters:
  public void setLambda(double lambda) {
    this.lambda = lambda;
  }

  public double getLambda() {
    return lambda;
    }

    // -----------------------------------------------------------------------
    //  Export methods
    // -----------------------------------------------------------------------
    /**
     * Returns settings as string.
     *
     * @return settings as string
     */
    public String toString()
    {
        return "Sparse grid machine\n" +
        "Target attribute=\"" + target + "\"";
    }

    /**
     * Returns settings as HTML string.
     *
     * @return settings as HTML string
     */
    public String toHtmlString()
    {
        String description = "Model:&nbsp;Sparse Grids<br>" +
        "<a href=http://this?Target>Target attribute&nbsp;=&nbsp;<font color=red><b>" + target + "</b></color></a>";
        return description;
    }

}

⌨️ 快捷键说明

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