line generation.
TODO: train, test and predict in java