本文整理汇总了Java中com.rapidminer.datatable.DataTable.add方法的典型用法代码示例。如果您正苦于以下问题:Java DataTable.add方法的具体用法?Java DataTable.add怎么用?Java DataTable.add使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.rapidminer.datatable.DataTable
的用法示例。
在下文中一共展示了DataTable.add方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getPlotter
import com.rapidminer.datatable.DataTable; //导入方法依赖的package包/类
private Plotter getPlotter(Object renderable) {
SVDModel model = (SVDModel) renderable;
double[] cumulativeVariance = new double[model.getNumberOfComponents()];
for (int i = 0; i < cumulativeVariance.length; i++) {
cumulativeVariance[i] = model.getCumulativeSingularValue(i);
}
DataTable dataTable = new SimpleDataTable("Cumulative Proportion of Singular Values", new String[] {
"Singular Value Vectors", "Cumulative Proportion of Singular Values" });
dataTable.add(new SimpleDataTableRow(new double[] { 0.0d, 0.0d }));
for (int i = 0; i < cumulativeVariance.length; i++) {
dataTable.add(new SimpleDataTableRow(new double[] { i + 1, cumulativeVariance[i] }));
}
PlotterConfigurationModel settings = new PlotterConfigurationModel(
PlotterConfigurationModel.WEIGHT_PLOTTER_SELECTION, dataTable);
settings.setPlotter(PlotterConfigurationModel.LINES_PLOT);
Plotter plotter = settings.getPlotter();
settings.setAxis(0, 0);
settings.enablePlotColumn(1);
return plotter;
}
示例2: getPlotter
import com.rapidminer.datatable.DataTable; //导入方法依赖的package包/类
private Plotter getPlotter(Object renderable) {
AbstractEigenvectorModel model = (AbstractEigenvectorModel) renderable;
double[] cumulativeVariance = model.getCumulativeVariance();
DataTable dataTable = new SimpleDataTable("Cumulative Proportion of Variance", new String[] {
"Principal Components", "Cumulative Proportion of Variance" });
dataTable.add(new SimpleDataTableRow(new double[] { 0.0d, 0.0d }));
for (int i = 0; i < cumulativeVariance.length; i++) {
dataTable.add(new SimpleDataTableRow(new double[] { i + 1, cumulativeVariance[i] }));
}
PlotterConfigurationModel settings = new PlotterConfigurationModel(
PlotterConfigurationModel.WEIGHT_PLOTTER_SELECTION, dataTable);
settings.setPlotter(PlotterConfigurationModel.LINES_PLOT);
Plotter plotter = settings.getPlotter();
settings.setAxis(0, 0);
settings.enablePlotColumn(1);
return plotter;
}
示例3: createDataTable
import com.rapidminer.datatable.DataTable; //导入方法依赖的package包/类
public DataTable createDataTable() {
DataTable dataTable = new SimpleDataTable("Attribute Weights", new String[] { "attribute", "weight" });
for (Map.Entry<String, AttributeWeight> entry : weightMap.entrySet()) {
String attName = entry.getKey();
AttributeWeight attWeight = entry.getValue();
double index = dataTable.mapString(0, attName);
double weightValue = attWeight.getWeight();
double[] data = new double[] { index, weightValue };
dataTable.add(new SimpleDataTableRow(data, attName));
}
return dataTable;
}
示例4: createDataTable
import com.rapidminer.datatable.DataTable; //导入方法依赖的package包/类
private DataTable createDataTable(ROCData data, boolean showSlope, boolean showThresholds) {
DataTable dataTable = new SimpleDataTable("ROC Plot", new String[] { "FP/N", "TP/P", "Slope", "Threshold" });
Iterator<ROCPoint> i = data.iterator();
int pointCounter = 0;
int eachPoint = Math.max(1, (int) Math.round((double) data.getNumberOfPoints() / (double) MAX_ROC_POINTS));
while (i.hasNext()) {
ROCPoint point = i.next();
if ((pointCounter == 0) || ((pointCounter % eachPoint) == 0) || (!i.hasNext())) { // draw
// only
// MAX_ROC_POINTS
// points
double fpRate = point.getFalsePositives() / data.getTotalNegatives();
double tpRate = point.getTruePositives() / data.getTotalPositives();
double threshold = point.getConfidence();
dataTable.add(new SimpleDataTableRow(new double[] {
fpRate, // x
tpRate, // y1
data.getBestIsometricsTPValue()
+ (fpRate * slope * (data.getTotalNegatives() / data.getTotalPositives())), // y2:
// slope
threshold // y3: threshold or confidence
}));
}
pointCounter++;
}
return dataTable;
}
示例5: createLiftChartPlot
import com.rapidminer.datatable.DataTable; //导入方法依赖的package包/类
/** Creates a dialog containing a plotter for a given list of ROC data points. */
public void createLiftChartPlot(List<double[]> data) {
// create data table
DataTable dataTable = new SimpleDataTable("Lift Chart", new String[] { "Fraction", "Lift" });
Iterator i = data.iterator();
int pointCounter = 0;
int eachPoint = Math.max(1, (int) Math.round((double) data.size() / (double) MAX_LIFT_POINTS));
while (i.hasNext()) {
double[] point = (double[]) i.next();
if ((pointCounter == 0) || ((pointCounter % eachPoint) == 0) || (!i.hasNext())) {
double fraction = point[0];
double lift = point[1];
if (Double.isNaN(lift)) {
lift = this.maxLift;
}
dataTable.add(new SimpleDataTableRow(new double[] { fraction, lift }));
}
pointCounter++;
}
// create plotter
SimplePlotterDialog plotter = new SimplePlotterDialog(dataTable);
plotter.setXAxis(0);
plotter.plotColumn(1, true);
// plotter.setDrawRange(0.0d, 1.0d, 0.0d, 1.0d);
plotter.setVisible(true);
}
示例6: createHistogramPlotter
import com.rapidminer.datatable.DataTable; //导入方法依赖的package包/类
private Plotter createHistogramPlotter(SimilarityMeasureObject sim, ExampleSet exampleSet) {
DistanceMeasure measure = sim.getDistanceMeasure();
DataTable dataTable = new SimpleDataTable("Histogram", new String[] { "Histogram" });
double sampleRatio = Math.min(1.0d, 500.0d / exampleSet.size());
Random random = new Random();
int i = 0;
for (Example example : exampleSet) {
int j = 0;
for (Example comExample : exampleSet) {
if (j != i && random.nextDouble() < sampleRatio) {
double simValue;
if (measure.isDistance()) {
simValue = measure.calculateDistance(example, comExample);
} else {
simValue = measure.calculateSimilarity(example, comExample);
}
dataTable.add(new SimpleDataTableRow(new double[] { simValue }));
}
j++;
}
i++;
}
PlotterConfigurationModel settings = new PlotterConfigurationModel(PlotterConfigurationModel.HISTOGRAM_PLOT,
dataTable);
settings.enablePlotColumn(0);
settings.setParameterAsInt(HistogramChart.PARAMETER_NUMBER_OF_BINS, 100);
return settings.getPlotter();
}