Skip to content

Instantly share code, notes, and snippets.

@rickyhai11
Created April 25, 2018 12:15
Show Gist options
  • Save rickyhai11/627d0da8bc93615785382b249618f43b to your computer and use it in GitHub Desktop.
Save rickyhai11/627d0da8bc93615785382b249618f43b to your computer and use it in GitHub Desktop.
main class
object SparkLSTM {
def main(args: Array[String])= {
if (args.length == 2) {
val filePath = args(0) //"/Users/kym1992/STUDY/NEU/CSYE7200/Dataset/nyse/prices-split-adjusted.csv"
val symbolName = args(1)
BasicConfigurator.configure()
val prepared = StockPricePredictionLSTM.prepare(filePath, symbolName, 0.90)
val result = StockPricePredictionLSTM.predictPriceOneAhead(prepared._1, prepared._2, prepared._3, prepared._4, prepared._5)
println("predicts, actual")
(result.predicts, result.actuals).zipped.foreach((x, y) => println(x + ", " + y))
saveAsCsv(result, symbolName)
result.predicts.foreach(r => println(r))
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment