I have an INDArray of data which is the return value of x as follows:
private static INDArray createDataSet(String path)throws Exception {
List<String> lines = IOUtils.readLines(new FileInputStream(path), StandardCharsets.UTF_8);
double[] position = new double[lines.size()];
double[] year = new double[lines.size()];
double[] month = new double[lines.size()];
double[] day = new double[lines.size()];
double[] close = new double[lines.size()];
int linecount = 0;
Iterator<String> it = lines.iterator();
while(it.hasNext()) {
String line = it.next();
String[] parts = line.split(",");
position[linecount] = linecount;
year[linecount] = Double.valueOf(parts[0]);
month[linecount] = Double.valueOf(parts[1]);
day[linecount] = Double.valueOf(parts[2]);
close[linecount] = Double.valueOf(parts[5]);
linecount++;
}//endloop
double[][] arr2D = new double[][] {position, year, month, day, close};
INDArray x = Nd4j.createFromArray(arr2D);
return x;
}
I'm trying to copy the csvplotter example and perform a linear regression with a single in/out network.
How would I load line the arrays row(0) as feature and array row(4) as label?
A little more info:
System.out.println(ds.rank());
long[] l = ds.shape();
System.out.println(l[0] + " , " + l[1] + " - " + l.length);
System.out.println(ds.length());
Results in:
2,
5, 1260 -2
6300
Here is my problem just to be clear:
for (int i = 0; i < nEpochs; i++) {
net.fit(d);
}
Results in a variety of errors depending on how I try to add data