June 2018
Intermediate to advanced
436 pages
10h 33m
English
As stated earlier, we will utilize historical stock data for training our LSTM network. The dataset has one minute OHLC data from 506 different securities for the period of January 2016 to December 2016. Let's take a look at the data we'll be using:
//DataPreview.javaSparkSession spark = SparkSession.builder().master("local").appName("StockPricePredictor").getOrCreate();spark.conf().set("spark.sql.crossJoin.enabled", "true");//enables cross joining across Spark DataFrames// load data from csv fileString filename = "data/prices-split-adjusted.csv"; Dataset<Row> data = spark.read().option("inferSchema", false).option("header", true) .format("csv").load(filename) .withColumn("openPrice", functions.col ...