Skip to content

Commit

Permalink
corrected vif function loop off by one mistake (oops)
Browse files Browse the repository at this point in the history
  • Loading branch information
mamonu committed Oct 31, 2020
1 parent eee715f commit 6a54b16
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion splink/diagnostics.py
Expand Up @@ -62,7 +62,7 @@ def vif_gammas(inputdata, sparksession, sampleratio=1.0):

# round robin computation of r_squared and vif from the available vars
train_t = inputdata.rdd.map(
lambda x: [Vectors.dense(x[2:i] + x[i + 1 :]), x[i]]
lambda x: [Vectors.dense(x[1:i] + x[i + 1 :]), x[i]]
).toDF(["features", "label"])

lr = LinearRegression(featuresCol="features", labelCol="label")
Expand Down

0 comments on commit 6a54b16

Please sign in to comment.