As I said, we need an intermediate conversion and pre-process to get the training set to contain feature vectors as well as labels. The conversion is pretty straightforward: we need the feature vector and the business labels.
For this, we have the makeND4jDataSets class (see makeND4jDataSets.scala for details). The class creates a ND4j dataset object from the data structure from the alignLables function in the form of List[(imgID, bizID, labels, pixelVector)]. First, we prepare the dataset using the makeDataSet() method:
def makeDataSet(alignedData: featureAndDataAligner, bizClass: Int): DataSet = { val alignedXData = alignedData.getImgVectors.toNDArray val alignedLabs = alignedData.getBusinessLabels.map(x =>