June 2018
Intermediate to advanced
436 pages
10h 33m
English
As I said previously, we need an intermediate conversion to prepare the training set containing feature vectors and labels: features from images, but labels from the business labels.
For this, we have the makeND4jDataSets class (see makeND4jDataSets.java for details). The class creates an ND4J dataset object from the data structure from the alignLables function in the List[(imgID, bizID, labels, pixelVector)] form. First, we prepare the dataset using the makeDataSet() method as follows:
public static DataSet makeDataSet(FeatureAndDataAligner alignedData, int bizClass) { INDArray alignedXData = makeDataSetTE(alignedData); List<Set<Integer>> labels = alignedData.getBusinessLabels(); float[][] matrix2 = labels.stream().map(x ...