Modified BoxCalculator.getNumberOfDimensions to use .first()

Modified BoxCalculator.getNumberOfDimensions to use .first() instead of .take(1)(0).  This resolves an issue we were having when trying to train a DBSCAN model within a Java application.