public class Regression extends Object
Constructor and Description |
---|
Regression() |
Modifier and Type | Method and Description |
---|---|
double[] |
getCoeffs() |
double |
getCorrelation() |
double[] |
getPredictedValues() |
double[] |
getResiduals() |
double |
getRMSE() |
static void |
main(String[] args) |
double[] |
multipleLinearRegression(double[] datay,
double[][] datax,
boolean interceptTerm) |
double[] |
multipleLinearRegression(double[] data,
int rows,
int cols,
boolean interceptTerm) |
void |
multipleLinearRegression(Jama.Matrix datay,
Jama.Matrix dataX,
boolean interceptTerm) |
void |
multipleLinearRegression(String fileName,
boolean interceptTerm) |
void |
multipleLinearRegression(String fileName,
int indVariable,
int[] c,
String[] factors,
boolean interceptTerm,
int rowIni,
int rowEnd)
multipleLinearRegression providing index numbers for the columns in fileName, index 0 correspond to column 1
|
double[] |
multipleLinearRegression(Vector<Double> data,
int rows,
int cols,
boolean interceptTerm) |
double[] |
multipleLinearRegression(Vector<Double> vectory,
Vector<Double> vectorx,
int rows,
int cols,
boolean interceptTerm) |
void |
predictValues(String fileName,
int indVariable,
int[] c,
boolean interceptTerm,
int rowIni,
int rowEnd) |
void |
printCoefficients() |
void |
printCoefficients(int[] indices,
String[] factors) |
void |
setCoeffs(double[] coeffsVal) |
public double[] getCoeffs()
public void setCoeffs(double[] coeffsVal)
public double[] getResiduals()
public double[] getPredictedValues()
public double getCorrelation()
public double getRMSE()
public double[] multipleLinearRegression(double[] data, int rows, int cols, boolean interceptTerm)
data
- dependent and independent variables data={{y1, x11, x12, ... x1k}, {y2, x21, x22, ... x2k}, ... {yn, xn1, xn2,
... xnk}}interceptTerm
- number of the column that will be used as dependent variable → vector y by default the first column is yrows
- number of rowscols
- number of cols including the dependent variablepublic double[] multipleLinearRegression(double[] datay, double[][] datax, boolean interceptTerm)
public double[] multipleLinearRegression(Vector<Double> vectory, Vector<Double> vectorx, int rows, int cols, boolean interceptTerm)
public double[] multipleLinearRegression(Vector<Double> data, int rows, int cols, boolean interceptTerm)
data
- Vector contains dependent variable first and then independent variablesrows
- rowscols
- colsinterceptTerm
- intercept termpublic void multipleLinearRegression(Jama.Matrix datay, Jama.Matrix dataX, boolean interceptTerm)
public void printCoefficients(int[] indices, String[] factors)
public void printCoefficients()
public void multipleLinearRegression(String fileName, boolean interceptTerm)
public void multipleLinearRegression(String fileName, int indVariable, int[] c, String[] factors, boolean interceptTerm, int rowIni, int rowEnd)
fileName
- file nameindVariable
- column number (index) of the independent variablec
- int[] column numbers array (indices) of dependent variablesfactors
- factorsrowIni
- and rowEnd should be given from 0 - maxData-1rowEnd
- row endinterceptTerm
- intercept termpublic void predictValues(String fileName, int indVariable, int[] c, boolean interceptTerm, int rowIni, int rowEnd)
Copyright © 2000–2016 DFKI GmbH. All rights reserved.