All Downloads are FREE. Search and download functionalities are using the official Maven repository.

weka.datagenerators.clusterers.SubspaceClusterDefinition Maven / Gradle / Ivy

Go to download

The Waikato Environment for Knowledge Analysis (WEKA), a machine learning workbench. This version represents the developer version, the "bleeding edge" of development, you could say. New functionality gets added to this version.

There is a newer version: 3.9.6
Show newest version
/*
 *   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 3 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, see .
 */

/*
 * SubspaceClusterDefinition.java
 * Copyright (C) 2005-2012 University of Waikato, Hamilton, New Zealand
 *
 */

package weka.datagenerators.clusterers;

import java.util.Enumeration;
import java.util.Random;
import java.util.StringTokenizer;
import java.util.Vector;

import weka.core.Option;
import weka.core.Range;
import weka.core.RevisionUtils;
import weka.core.SelectedTag;
import weka.core.Utils;
import weka.datagenerators.ClusterDefinition;
import weka.datagenerators.ClusterGenerator;

/**
 *  A single cluster for the SubspaceCluster
 * datagenerator
 * 

* * * Valid options are: *

* *

 * -A <range>
 *  Generates randomly distributed instances in the cluster.
 * 
* *
 * -U <range>
 *  Generates uniformly distributed instances in the cluster.
 * 
* *
 * -G <range>
 *  Generates gaussian distributed instances in the cluster.
 * 
* *
 * -D <num>,<num>
 *  The attribute min/max (-A and -U) or mean/stddev (-G) for
 *  the cluster.
 * 
* *
 * -N <num>..<num>
 *  The range of number of instances per cluster (default 1..50).
 * 
* *
 * -I
 *  Uses integer instead of continuous values (default continuous).
 * 
* * * * @author Gabi Schmidberger ([email protected]) * @author FracPete (fracpete at waikato dot ac dot nz) * @version $Revision: 12478 $ * @see SubspaceCluster */ public class SubspaceClusterDefinition extends ClusterDefinition { /** for serialization */ static final long serialVersionUID = 3135678125044007231L; /** cluster type */ protected int m_clustertype; /** cluster subtypes */ protected int m_clustersubtype; /** number of attributes the cluster is defined for */ protected int m_numClusterAttributes; /** number of instances for this cluster */ protected int m_numInstances; /** minimal number of instances for this cluster */ protected int m_MinInstNum; /** maximal number of instances for this cluster */ protected int m_MaxInstNum; /** range of atttributes */ protected Range m_AttrIndexRange; /** attributes of this cluster */ protected boolean[] m_attributes; /** global indices of the attributes of the cluster */ protected int[] m_attrIndices; /** min or mean */ protected double[] m_valueA; /** max or stddev */ protected double[] m_valueB; /** * initializes the cluster, without a parent cluster (necessary for GOE) */ public SubspaceClusterDefinition() { super(); } /** * initializes the cluster with default values * * @param parent the datagenerator this cluster belongs to */ public SubspaceClusterDefinition(ClusterGenerator parent) { super(parent); } /** * sets the default values * * @throws Exception if setting of defaults fails */ @Override protected void setDefaults() throws Exception { setClusterType(defaultClusterType()); setClusterSubType(defaultClusterSubType()); setMinInstNum(defaultMinInstNum()); setMaxInstNum(defaultMaxInstNum()); setAttrIndexRange(defaultAttrIndexRange()); m_numClusterAttributes = 1; setValuesList(defaultValuesList()); } /** * Returns a string describing this data generator. * * @return a description of the data generator suitable for displaying in the * explorer/experimenter gui */ @Override public String globalInfo() { return "A single cluster for the SubspaceCluster datagenerator"; } /** * Returns an enumeration describing the available options. * * @return an enumeration of all the available options */ @Override public Enumeration




© 2015 - 2024 Weber Informatics LLC | Privacy Policy