Created
October 18, 2018 19:18
-
-
Save icexelloss/67f952bea3f4da8be789665d1f67932c to your computer and use it in GitHub Desktop.
FlintCase6
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pyspark.ml.regression import LinearRegression | |
from pyspark.ml.feature import VectorAssembler | |
assembler = VectorAssembler( | |
inputCols=["previous_day_return", "previous_day_decayed_return"], | |
outputCol="features") | |
output = assembler.transform(sp500_decayed_return).select('return', 'features').toDF('label', 'features') | |
lr = LinearRegression(maxIter=10, regParam=0.3, elasticNetParam=0.8) | |
model = lr.fit(output) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment