Package com.polytechnik.utils
Class DataReadObservationVectorXF
java.lang.Object
com.polytechnik.utils.DataReadObservationVectorXF
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) class
static class
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal List
<ObservationVectorXF> (package private) static final double
Regularization parameter.(package private) static final double
Regularization parameter.static final String
Fields separator. -
Constructor Summary
ConstructorsConstructorDescriptionDataReadObservationVectorXF
(List<ObservationVectorXF> data, List<String> xHeader) -
Method Summary
Modifier and TypeMethodDescription(package private) XXMatrs
addConstantToBasis
(int n, int ngoodx, double[] fmatrnorm, double[] basisfun, double[] fXaverage) Add attribute x=const to basis.(package private) String
createAttributeTextualRepresentation
(double[] psiorigbasis, int[] indexes, double[] norm, double[] xorig_average) For unit tests.(package private) XXMatrs
Covariance matrix (without normalizing to total weight).Remove duplicated data from x attributes.Remove duplicated data from x attributes, similar togetDataRegularized_EV
but a regular Gaussian elimination with pivoting is used instead of the eigenproblem.(package private) XXMatrs
getFun1Fun2Averaged
(Function<ObservationVectorXF, double[]> observationToFun1, Function<ObservationVectorXF, double[]> observationToFun2) Calculate <observationToFun1(o)[j]|observationToFun2(o)[k]> and <observationToFun1(o)[j]|f|observationToFun2(o)[k]> averages.static DataReadObservationVectorXF
getObservations
(String filename, int columns_number, int[] indcol_x, int indcol_f, int indcol_weight, int indcol_label) Read observations sequence from a file.For unit tests.getReplacedData
(Function<ObservationVectorXF, ObservationVectorXF> replacement, Function<List<String>, List<String>> getheader) Create a dataset with observations replaced.(package private) XXMatrs
getXXandXfX
(Function<double[], double[]> convertxFromOriginalToX) (package private) XXMatrs
getXXandXfX
(Function<double[], double[]> convertxFromOriginalToX, ToDoubleFunction<double[]> getFactorToDivide) For unit test.void
-
Field Details
-
data
-
xHeader
-
datastat
-
reg_eps_rel
static final double reg_eps_relRegularization parameter.- See Also:
-
reg_eps_abs
static final double reg_eps_absRegularization parameter.- See Also:
-
SEPARATOR
-
-
Constructor Details
-
DataReadObservationVectorXF
-
-
Method Details
-
printData
public void printData() -
getReplacedData
public DataReadObservationVectorXF getReplacedData(Function<ObservationVectorXF, ObservationVectorXF> replacement, Function<List<String>, List<String>> getheader) Create a dataset with observations replaced. -
addConstantToBasis
XXMatrs addConstantToBasis(int n, int ngoodx, double[] fmatrnorm, double[] basisfun, double[] fXaverage) Add attribute x=const to basis. -
createAttributeTextualRepresentation
String createAttributeTextualRepresentation(double[] psiorigbasis, int[] indexes, double[] norm, double[] xorig_average) -
getDataRegularized_EV
Remove duplicated data from x attributes. -
getDataRegularized_LIN
Remove duplicated data from x attributes, similar togetDataRegularized_EV
but a regular Gaussian elimination with pivoting is used instead of the eigenproblem. Similar togetGramSchmidtOrthogonalized
with pivoting. -
getCovarianceMatrix
XXMatrs getCovarianceMatrix()Covariance matrix (without normalizing to total weight). -
getFun1Fun2Averaged
XXMatrs getFun1Fun2Averaged(Function<ObservationVectorXF, double[]> observationToFun1, Function<ObservationVectorXF, double[]> observationToFun2) Calculate <observationToFun1(o)[j]|observationToFun2(o)[k]> and <observationToFun1(o)[j]|f|observationToFun2(o)[k]> averages. This is a more general version thangetXXandXfX
that works only with symmetric matrices.- Parameters:
observationToFun1
- a function to obtain first arg to average.observationToFun2
- a function to obtain second arg to average.- Returns:
- Two matrices matrix[j][k] of Fun1.length rows and Fun2.length columns of product averages with and without f.
-
getXXandXfX
-
getXXandXfX
XXMatrs getXXandXfX(Function<double[], double[]> convertxFromOriginalToX, ToDoubleFunction<double[]> getFactorToDivide) For unit test. -
getRadonNikodymSpectralModel_WithoutRegularization
For unit tests. Use with a big care. The method 1) may be unstable for redundant data 2) if there is no const among x_k linear combinations the result is incorrect. -
getAttribsProductsMultiIndexed_WithoutRegularization
For unit tests. Use with a big care. The method 1) may be unstabele for redundant data 2) if there is no const among x_k linear combinations the result is incorrect. -
getObservations
public static DataReadObservationVectorXF getObservations(String filename, int columns_number, int[] indcol_x, int indcol_f, int indcol_weight, int indcol_label) throws IOException Read observations sequence from a file. The lines starting with "|" are considered as comments. If the first line starts with "|#", then it considered as attributes names.- Throws:
IOException
-