Java Reference
In-Depth Information
41.
mNumericalMedianSlider.setModel(
42.
new DefaultBoundedRangeModel((int)(lMedianPercent * 100),
43.
1, 0, 100));
44. }
Lines 2 and 3 update the TableModel used to display the quantile
information and will be detailed later. The code shows that a lot of
statistical information can be obtained for numerical attributes. We
highlight the difference between the mean and median values by
showing them on sliders scaled with the minimum and maximum
values of the attribute. The standard deviation can also be compared
to the interquantile range. The update of the quantile information is
done with the following code extracted from the class QuantileModel,
which extends the AbstractTableModel class.
1.
public Object getValueAt(int iRowIndex, int iColumnIndex) {
if (mSelectedNumericalStatistics null
2.
|| mSelectedNumericalStatistics.getQuantileLimits() null) {
3.
4.
return null;
5.
}
double lQuantileLimit
6.
7.
mSelectedNumericalStatistics.getQuantileLimits()[iRowIndex];
8.
switch (iColumnIndex) {
9.
case 0:
10.
return new Double(
11.
lQuantileLimit);
12.
case 1:
13.
return new Double(
14.
mSelectedNumericalStatistics.getQuantile(
15.
lQuantileLimit));
16.
}
17.
return null;
18.
}
Note that the DME determines the number of quantiles and pro-
vides the associated quantile limits.
Since most numerical attributes are also continuous, we use the
following code to extract continuous statistics from the class Continu-
ousStatisticsModel, which extends the AbstractTableModel class.
1.
public Object getValueAt(int iRowIndex, int iColumnIndex) {
if (mSelectedContinuousStatistics null) {
2.
3.
return null;
4.
}
 
Search WWH ::




Custom Search