本文整理汇总了Java中de.erichseifert.gral.data.statistics.Statistics.get方法的典型用法代码示例。如果您正苦于以下问题:Java Statistics.get方法的具体用法?Java Statistics.get怎么用?Java Statistics.get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类de.erichseifert.gral.data.statistics.Statistics
的用法示例。
在下文中一共展示了Statistics.get方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: MedianFilter
import de.erichseifert.gral.data.statistics.Statistics; //导入方法依赖的package包/类
public MedianFilter(Iterable<T> data, int windowSize) {
filtered = new LinkedList<>();
windowIterator = new WindowIterator<>(data.iterator(), windowSize);
while (windowIterator.hasNext()) {
List<T> window = windowIterator.next();
Statistics windowStatistics = new Statistics(window);
double median = windowStatistics.get(Statistics.MEDIAN);
filtered.add(median);
}
}
示例2: createRasterData
import de.erichseifert.gral.data.statistics.Statistics; //导入方法依赖的package包/类
/**
* Takes a matrix of values and creates a new data source that stores the
* values in (x, y, value) format.
* @param data Original data source with values in each cell.
* @return New data source with (x, y, value) columns
*/
@SuppressWarnings("unchecked")
public static DataSource createRasterData(DataSource data) {
if (data == null) {
throw new NullPointerException("Cannot convert null data source.");
}
DataTable coordsValueData =
new DataTable(Double.class, Double.class, Double.class);
// Generate pixel data with (x, y, value)
Statistics stats = data.getStatistics();
double min = stats.get(Statistics.MIN);
double max = stats.get(Statistics.MAX);
double range = max - min;
int i = 0;
for (Comparable<?> cell : data) {
int x = i%data.getColumnCount();
int y = -i/data.getColumnCount();
double v = Double.NaN;
if (cell instanceof Number) {
Number numericCell = (Number) cell;
v = (numericCell.doubleValue() - min) / range;
}
coordsValueData.add((double) x, (double) y, v);
i++;
}
return coordsValueData;
}
示例3: getStatistics
import de.erichseifert.gral.data.statistics.Statistics; //导入方法依赖的package包/类
/**
* Returns the specified statistical information for this data.
* @param key Requested Statistical information.
* @return Calculated value.
*/
public double getStatistics(String key) {
Statistics statistics = new Statistics(this);
return statistics.get(key);
}