Class VariableNumber
java.lang.Object
jwat.VariableNumber
- All Implemented Interfaces:
JWATConstants
- Direct Known Subclasses:
VariableDate, VariableString
Description: This class represents a single variable which contains numerical
values. It provides statistics information and variable transofrmations and
sampling operations
- Author:
- Brambilla Davide Matr 667986, Fumagalli Claudio 667971 Created: 1-ago-2006 Modified: 27-dec-2006
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final shortprotected VariableMappingstatic final shortprotected Stringstatic final shortprotected intprotected Observation[]protected Observation[]static final shortstatic final shortFields inherited from interface JWATConstants
BUTTONSIZE, DATE, defaultFormat, EXAMPLE_PATH, FITTING_EXPO_PANEL, FITTING_INPUT_PANEL, FITTING_PARETO_PANEL, FUZZYK, HTML_FONT_SMALL, HTML_FONT_TIT_END_NO_CAPO, INPUT_MSG_ABORT, INPUT_MSG_ABORT_WRONG_FORMAT, INPUT_MSG_FAIL, KMEANS, LOG_FILE_NAME, NUMERIC, STRING, TRAFFIC_EPOCH_PANEL, TRAFFIC_GRAPH_PANEL, TRAFFIC_GRAPHARRIVAL_PANEL, TRAFFIC_INPUT_PANEL, TRAFFIC_TEXTUAL_PANEL, WORKLOAD_BIVARIATE_PANEL, WORKLOAD_CLUSTERING_PANEL, WORKLOAD_INFOCLUSTERING_PANEL, WORKLOAD_INPUT_PANEL -
Constructor Summary
ConstructorsConstructorDescriptionVariableNumber(Observation[] valObs, String vName, int pos, short type, VariableMapping varMapping) Constructor, creates new numerical variable. -
Method Summary
Modifier and TypeMethodDescriptionintapplySampling(FilterOnVariable filter) Applies filter to variablevoiddoClusteringTrasformation(int index) voiddoTransformation(int index) Perform one of the transformationsdoubleintgetEndInt(int j) intgetIndex()Returns variable's indexintgetIndex(double value) NOT USED INCORRECT Returns the range arrayintgetIndexMax(double value) intgetIndexMin(double value) int[]doublegetIntRange(int min, int max) Returns the range between interval positionsdoublegetIntRangeG(int min, int max) Returns the range between interval positionsdoublegetIntValue(int Index) Returns the value relative to the pos index of the range arraydoublegetIntValueG(int Index) Returns the value relative to the pos index of the range arraygetName()Return variable's nameintReturns the next index if there is an observation to plot that matches the restrictions set with setRangeQuantiliintintintgetObsID(int Index) doublegetQuantile(int ind) Returns element corresponding to the ind quantileintgetStartInt(int j) static String[]Returns names of transformationsReturns the trasf str.shortgetType()Returns variable's typeReturns object holding current univariate variable statisticsdoublegetValue(int Index) Returns Index-th value of the variabledoublegetValue(int Index, int var) Returns the index-th value of the var-th variable of the observaionbooleanvoidvoidsetRangeIntervallo(int min, int max, double minv, double maxv, int n) Setting to search for points within a range for the plotintSize()Returns number of observationsvoidbooleanUndo last transformation applied to variable if existsvoidvoidupdateOnSampling(int size) Sync variable respect with another variable sampling
-
Field Details
-
LOGARITHMIC
public static final short LOGARITHMIC- See Also:
-
MINMAX
public static final short MINMAX- See Also:
-
STDEV
public static final short STDEV- See Also:
-
SAMPLING
public static final short SAMPLING- See Also:
-
NONE
public static final short NONE- See Also:
-
obsValue
-
originalValue
-
name
-
nVar
protected int nVar -
mapping
-
-
Constructor Details
-
VariableNumber
public VariableNumber(Observation[] valObs, String vName, int pos, short type, VariableMapping varMapping) Constructor, creates new numerical variable.- Parameters:
valObs- list of observations already sorted by this variablevName- variable's namepos- variable's positione in observationvarMapping- mapping object (null)
-
-
Method Details
-
getMapping
-
getValue
Returns Index-th value of the variable- Parameters:
Index- index of variable's value desired- Returns:
- value of Index-th value
- Throws:
ArrayIndexOutOfBoundsException- throws if Index is < 0 or > numbero of observations
-
getValue
Returns the index-th value of the var-th variable of the observaion- Parameters:
Index- index of variable's value desiredvar- variable index- Returns:
- index-th value of the var-th variable
- Throws:
ArrayIndexOutOfBoundsException- throws if Index is < 0 or > numbero of observations or var < 0 or > number of variables ( elements of observation )
-
getUniStats
Returns object holding current univariate variable statistics- Returns:
univariateStatistics
-
getQuantile
public double getQuantile(int ind) Returns element corresponding to the ind quantile- Parameters:
ind- quantile- Returns:
- element corresponding to the ind quantile
-
Size
public int Size()Returns number of observations- Returns:
- number of observations
-
getIndex
public int getIndex()Returns variable's index- Returns:
- variable's index
-
getName
-
getType
public short getType()Returns variable's type- Returns:
- variable's type
-
doTransformation
Perform one of the transformations- Parameters:
index- transformation to apply- Throws:
TrasformException- throws if it is not possible to apply transformation
-
undoLastTrasf
public boolean undoLastTrasf()Undo last transformation applied to variable if exists -
getTrasfName
Returns names of transformations- Returns:
- Array of transformation's names
-
getTrasfStr
-
getDimInt
public double getDimInt() -
getNumeroObsPerInt
public int getNumeroObsPerInt() -
getStartInt
public int getStartInt(int j) -
getEndInt
public int getEndInt(int j) -
getIntValue
public double getIntValue(int Index) Returns the value relative to the pos index of the range array- Parameters:
Index- Range array index- Returns:
- Return of the real value at a limit of the range
-
getIntValueG
public double getIntValueG(int Index) Returns the value relative to the pos index of the range array- Parameters:
Index- Range array index- Returns:
- Return of the real value at a limit of the range
-
setRangeIntervallo
public void setRangeIntervallo(int min, int max, double minv, double maxv, int n) Setting to search for points within a range for the plot- Parameters:
min- Range lower bound as range array indexmax- Range upper bound as range array indexminv- Lower bound as the value of the companion variable of the scatter plotmaxv- Upper limit as the value of the companion variable of the scatter plotn- Position of the companion variable in the scatter plot in the observations
-
getNextInt
-
getIntRange
public double getIntRange(int min, int max) Returns the range between interval positions- Parameters:
min- minimum position of the rangemax- maximum position of the interval- Returns:
- range between the two intervals
-
getIntRangeG
public double getIntRangeG(int min, int max) Returns the range between interval positions- Parameters:
min- minimum position of the rangemax- maximum position of the interval- Returns:
- range between the two intervals
-
getIndex
public int getIndex(double value) NOT USED INCORRECT Returns the range array- Returns:
- vector containing the positions of the variables that delimit the intervals
-
getIndexMin
public int getIndexMin(double value) -
getIndexMax
public int getIndexMax(double value) -
getInterval1000
public int[] getInterval1000() -
applySampling
Applies filter to variable- Parameters:
filter-- Returns:
-
updateOnSampling
public void updateOnSampling(int size) Sync variable respect with another variable sampling- Parameters:
size-
-
undoSampling
public void undoSampling() -
resetSampling
public void resetSampling() -
isSampled
public boolean isSampled() -
getCurObs
-
getObsID
public int getObsID(int Index) -
getNumOfTransf
public int getNumOfTransf() -
doClusteringTrasformation
public void doClusteringTrasformation(int index) -
undoClueringTrasformation
public void undoClueringTrasformation()
-