• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java Regression类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.jfree.data.statistics.Regression的典型用法代码示例。如果您正苦于以下问题:Java Regression类的具体用法?Java Regression怎么用?Java Regression使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Regression类属于org.jfree.data.statistics包,在下文中一共展示了Regression类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: testOLSRegression1b

import org.jfree.data.statistics.Regression; //导入依赖的package包/类
/**
 * Checks the results of an OLS regression on sample dataset 1 AFTER converting it to
 * an XYSeries.
 */
public void testOLSRegression1b() {

    final double[][] data = createSampleData1();

    final XYSeries series = new XYSeries("Test");
    for (int i = 0; i < 11; i++) {
        series.add(data[i][0], data[i][1]);
    }
    final XYDataset ds = new XYSeriesCollection(series);
    final double[] result2 = Regression.getOLSRegression(ds, 0);

    assertEquals(.25680930, result2[0], 0.0000001);
    assertEquals(0.72792106, result2[1], 0.0000001);

}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:20,代码来源:RegressionTests.java


示例2: testPowerRegression1b

import org.jfree.data.statistics.Regression; //导入依赖的package包/类
/**
 * Checks the results of a power regression on sample dataset 1 AFTER converting it to
 * an XYSeries.
 */
public void testPowerRegression1b() {

    final double[][] data = createSampleData1();

    final XYSeries series = new XYSeries("Test");
    for (int i = 0; i < 11; i++) {
        series.add(data[i][0], data[i][1]);
    }
    final XYDataset ds = new XYSeriesCollection(series);
    final double[] result = Regression.getPowerRegression(ds, 0);

    assertEquals(0.91045813, result[0], 0.0000001);
    assertEquals(0.88918346, result[1], 0.0000001);

}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:20,代码来源:RegressionTests.java


示例3: testOLSRegression2b

import org.jfree.data.statistics.Regression; //导入依赖的package包/类
/**
 * Checks the results of an OLS regression on sample dataset 2 AFTER converting it to
 * an XYSeries.
 */
public void testOLSRegression2b() {

    final double[][] data = createSampleData2();

    final XYSeries series = new XYSeries("Test");
    for (int i = 0; i < 10; i++) {
        series.add(data[i][0], data[i][1]);
    }
    final XYDataset ds = new XYSeriesCollection(series);
    final double[] result = Regression.getOLSRegression(ds, 0);

    assertEquals(53.9729697, result[0], 0.0000001);
    assertEquals(-4.1823030, result[1], 0.0000001);

}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:20,代码来源:RegressionTests.java


示例4: testPowerRegression2b

import org.jfree.data.statistics.Regression; //导入依赖的package包/类
/**
 * Checks the results of a power regression on sample dataset 2 AFTER converting it to
 * an XYSeries.
 */
public void testPowerRegression2b() {

    final double[][] data = createSampleData2();

    final XYSeries series = new XYSeries("Test");
    for (int i = 0; i < 10; i++) {
        series.add(data[i][0], data[i][1]);
    }
    final XYDataset ds = new XYSeriesCollection(series);
    final double[] result = Regression.getPowerRegression(ds, 0);

    assertEquals(106.1241681, result[0], 0.0000001);
    assertEquals(-0.8466615, result[1], 0.0000001);

}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:20,代码来源:RegressionTests.java


示例5: testOLSRegression1b

import org.jfree.data.statistics.Regression; //导入依赖的package包/类
/**
 * Checks the results of an OLS regression on sample dataset 1 AFTER 
 * converting it to an XYSeries.
 */
public void testOLSRegression1b() {

    double[][] data = createSampleData1();

    XYSeries series = new XYSeries("Test");
    for (int i = 0; i < 11; i++) {
        series.add(data[i][0], data[i][1]);
    }
    XYDataset ds = new XYSeriesCollection(series);
    double[] result2 = Regression.getOLSRegression(ds, 0);

    assertEquals(.25680930, result2[0], 0.0000001);
    assertEquals(0.72792106, result2[1], 0.0000001);

}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:20,代码来源:RegressionTests.java


示例6: testPowerRegression1b

import org.jfree.data.statistics.Regression; //导入依赖的package包/类
/**
 * Checks the results of a power regression on sample dataset 1 AFTER 
 * converting it to an XYSeries.
 */
public void testPowerRegression1b() {

    double[][] data = createSampleData1();

    XYSeries series = new XYSeries("Test");
    for (int i = 0; i < 11; i++) {
        series.add(data[i][0], data[i][1]);
    }
    XYDataset ds = new XYSeriesCollection(series);
    double[] result = Regression.getPowerRegression(ds, 0);

    assertEquals(0.91045813, result[0], 0.0000001);
    assertEquals(0.88918346, result[1], 0.0000001);

}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:20,代码来源:RegressionTests.java


示例7: testOLSRegression2b

import org.jfree.data.statistics.Regression; //导入依赖的package包/类
/**
 * Checks the results of an OLS regression on sample dataset 2 AFTER 
 * converting it to an XYSeries.
 */
public void testOLSRegression2b() {

    double[][] data = createSampleData2();

    XYSeries series = new XYSeries("Test");
    for (int i = 0; i < 10; i++) {
        series.add(data[i][0], data[i][1]);
    }
    XYDataset ds = new XYSeriesCollection(series);
    double[] result = Regression.getOLSRegression(ds, 0);

    assertEquals(53.9729697, result[0], 0.0000001);
    assertEquals(-4.1823030, result[1], 0.0000001);

}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:20,代码来源:RegressionTests.java


示例8: testPowerRegression2b

import org.jfree.data.statistics.Regression; //导入依赖的package包/类
/**
 * Checks the results of a power regression on sample dataset 2 AFTER 
 * converting it to an XYSeries.
 */
public void testPowerRegression2b() {

    double[][] data = createSampleData2();

    XYSeries series = new XYSeries("Test");
    for (int i = 0; i < 10; i++) {
        series.add(data[i][0], data[i][1]);
    }
    XYDataset ds = new XYSeriesCollection(series);
    double[] result = Regression.getPowerRegression(ds, 0);

    assertEquals(106.1241681, result[0], 0.0000001);
    assertEquals(-0.8466615, result[1], 0.0000001);

}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:20,代码来源:RegressionTests.java


示例9: testOLSRegression1b

import org.jfree.data.statistics.Regression; //导入依赖的package包/类
/**
 * Checks the results of an OLS regression on sample dataset 1 AFTER
 * converting it to an XYSeries.
 */
public void testOLSRegression1b() {

    double[][] data = createSampleData1();

    XYSeries series = new XYSeries("Test");
    for (int i = 0; i < 11; i++) {
        series.add(data[i][0], data[i][1]);
    }
    XYDataset ds = new XYSeriesCollection(series);
    double[] result2 = Regression.getOLSRegression(ds, 0);

    assertEquals(.25680930, result2[0], 0.0000001);
    assertEquals(0.72792106, result2[1], 0.0000001);

}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:20,代码来源:RegressionTests.java


示例10: testPowerRegression1b

import org.jfree.data.statistics.Regression; //导入依赖的package包/类
/**
 * Checks the results of a power regression on sample dataset 1 AFTER
 * converting it to an XYSeries.
 */
public void testPowerRegression1b() {

    double[][] data = createSampleData1();

    XYSeries series = new XYSeries("Test");
    for (int i = 0; i < 11; i++) {
        series.add(data[i][0], data[i][1]);
    }
    XYDataset ds = new XYSeriesCollection(series);
    double[] result = Regression.getPowerRegression(ds, 0);

    assertEquals(0.91045813, result[0], 0.0000001);
    assertEquals(0.88918346, result[1], 0.0000001);

}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:20,代码来源:RegressionTests.java


示例11: testOLSRegression2b

import org.jfree.data.statistics.Regression; //导入依赖的package包/类
/**
 * Checks the results of an OLS regression on sample dataset 2 AFTER
 * converting it to an XYSeries.
 */
public void testOLSRegression2b() {

    double[][] data = createSampleData2();

    XYSeries series = new XYSeries("Test");
    for (int i = 0; i < 10; i++) {
        series.add(data[i][0], data[i][1]);
    }
    XYDataset ds = new XYSeriesCollection(series);
    double[] result = Regression.getOLSRegression(ds, 0);

    assertEquals(53.9729697, result[0], 0.0000001);
    assertEquals(-4.1823030, result[1], 0.0000001);

}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:20,代码来源:RegressionTests.java


示例12: testPowerRegression2b

import org.jfree.data.statistics.Regression; //导入依赖的package包/类
/**
 * Checks the results of a power regression on sample dataset 2 AFTER
 * converting it to an XYSeries.
 */
public void testPowerRegression2b() {

    double[][] data = createSampleData2();

    XYSeries series = new XYSeries("Test");
    for (int i = 0; i < 10; i++) {
        series.add(data[i][0], data[i][1]);
    }
    XYDataset ds = new XYSeriesCollection(series);
    double[] result = Regression.getPowerRegression(ds, 0);

    assertEquals(106.1241681, result[0], 0.0000001);
    assertEquals(-0.8466615, result[1], 0.0000001);

}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:20,代码来源:RegressionTests.java


示例13: drawRegression

import org.jfree.data.statistics.Regression; //导入依赖的package包/类
/** Handles drawing of the regression line */
private void drawRegression(XYDataset scatterPlotData, XYPlot xyplot) {
	// compute regression function
	double regressionParams[] = Regression.getOLSRegression(
			scatterPlotData, 0);
	Function2D regression = new LineFunction2D(regressionParams[0],
			regressionParams[1]);

	// sample function values
	double lowerBound = xyplot.getDomainAxis().getLowerBound();
	double upperBound = xyplot.getDomainAxis().getUpperBound();
	XYDataset regressionDataset = DatasetUtilities.sampleFunction2D(
			regression, lowerBound, upperBound,
			REGRESSION_LINE_SAMPLE_COUNT, "Fitted Regression Line");
	xyplot.setDataset(1, regressionDataset);

	// render regression line into plot
	XYLineAndShapeRenderer renderer = new XYLineAndShapeRenderer(true,
			false);
	xyplot.setRenderer(1, renderer);
	renderer.setSeriesPaint(0, REGRESSION_LINE_COLOR);
}
 
开发者ID:vimaier,项目名称:conqat,代码行数:23,代码来源:ScatterPlotCreator.java


示例14: computeRegressionData

import org.jfree.data.statistics.Regression; //导入依赖的package包/类
private XYIntervalSeries computeRegressionData(double xStart, double xEnd) {
    if (scatterpointsDataset.getItemCount(0) > 1) {
        final double[] coefficients = Regression.getOLSRegression(scatterpointsDataset, 0);
        final Function2D curve = new LineFunction2D(coefficients[0], coefficients[1]);
        final XYSeries regressionData = DatasetUtilities.sampleFunction2DToSeries(curve, xStart, xEnd, 100, "regression line");
        final XYIntervalSeries xyIntervalRegression = new XYIntervalSeries(regressionData.getKey());
        for (int i = 0; i < regressionData.getItemCount(); i++) {
            XYDataItem item = regressionData.getDataItem(i);
            final double x = item.getXValue();
            final double y = item.getYValue();
            xyIntervalRegression.add(x, x, x, y, y, y);
        }
        return xyIntervalRegression;
    } else {
        Dialogs.showInformation("Unable to compute regression line.\n" +
                                        "At least 2 values are needed to compute regression coefficients.");
        return null;
    }
}
 
开发者ID:senbox-org,项目名称:snap-desktop,代码行数:20,代码来源:ScatterPlotPanel.java


示例15: plotRel2dChartData

import org.jfree.data.statistics.Regression; //导入依赖的package包/类
protected boolean plotRel2dChartData(String xAxisName, ArrayList<Double> xarr, String yAxisName, ArrayList<Double> yarr) {
    clear2dChartData();
    if (setXYSeries(runData, xarr, yarr)) {
        double[] ols = Regression.getOLSRegression(chartPanel.getChart().getXYPlot().getDataset(1), 0);
        Function2D curve = new LineFunction2D(ols[0], ols[1]);
        trendData.clear();
        trendData.add(runData.getMinX(), curve.getValue(runData.getMinX()));
        trendData.add(runData.getMaxX(), curve.getValue(runData.getMaxX()));
        double paddingX = runData.getMaxX() * 0.05;
        double paddingY = runData.getMaxY() * 0.05;
        XYPlot plot = chartPanel.getChart().getXYPlot();
        plot.getDomainAxis(0).setRange(runData.getMinX() - paddingX, runData.getMaxX() + paddingX);
        plot.getRangeAxis(0).setRange(runData.getMinY() - paddingY, runData.getMaxY() + paddingY);
        plot.getDomainAxis(0).setLabel(xAxisName);
        plot.getRangeAxis(0).setLabel(yAxisName);
        plot.getRenderer(0).setSeriesVisible(0, true);
        return true;
    }
    return false;
}
 
开发者ID:vimsh,项目名称:mafscaling,代码行数:21,代码来源:ACompCalc.java


示例16: testOLSRegression1a

import org.jfree.data.statistics.Regression; //导入依赖的package包/类
/**
 * Checks the results of an OLS regression on sample dataset 1.
 */
public void testOLSRegression1a() {

    final double[][] data = createSampleData1();
    final double[] result1 = Regression.getOLSRegression(data);
    assertEquals(.25680930, result1[0], 0.0000001);
    assertEquals(0.72792106, result1[1], 0.0000001);

}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:12,代码来源:RegressionTests.java


示例17: testPowerRegression1a

import org.jfree.data.statistics.Regression; //导入依赖的package包/类
/**
 * Checks the results of a power regression on sample dataset 1.
 */
public void testPowerRegression1a() {

    final double[][] data = createSampleData1();
    final double[] result = Regression.getPowerRegression(data);
    assertEquals(0.91045813, result[0], 0.0000001);
    assertEquals(0.88918346, result[1], 0.0000001);

}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:12,代码来源:RegressionTests.java


示例18: testOLSRegression2a

import org.jfree.data.statistics.Regression; //导入依赖的package包/类
/**
 * Checks the results of an OLS regression on sample dataset 2.
 */
public void testOLSRegression2a() {

    final double[][] data = createSampleData2();
    final double[] result = Regression.getOLSRegression(data);
    assertEquals(53.9729697, result[0], 0.0000001);
    assertEquals(-4.1823030, result[1], 0.0000001);

}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:12,代码来源:RegressionTests.java


示例19: testPowerRegression2a

import org.jfree.data.statistics.Regression; //导入依赖的package包/类
/**
 * Checks the results of a power regression on sample dataset 2.
 */
public void testPowerRegression2a() {

    final double[][] data = createSampleData2();
    final double[] result = Regression.getPowerRegression(data);
    assertEquals(106.1241681, result[0], 0.0000001);
    assertEquals(-0.8466615, result[1], 0.0000001);

}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:12,代码来源:RegressionTests.java


示例20: testOLSRegression1a

import org.jfree.data.statistics.Regression; //导入依赖的package包/类
/**
 * Checks the results of an OLS regression on sample dataset 1.
 */
public void testOLSRegression1a() {

    double[][] data = createSampleData1();
    double[] result1 = Regression.getOLSRegression(data);
    assertEquals(.25680930, result1[0], 0.0000001);
    assertEquals(0.72792106, result1[1], 0.0000001);

}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:12,代码来源:RegressionTests.java



注:本文中的org.jfree.data.statistics.Regression类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java PlaylistListResponse类代码示例发布时间:2022-05-23
下一篇:
Java HeaderRow类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap