-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Some suggested changes to style #88
Conversation
@@ -155,7 +155,7 @@ class LSAQueryEngine( | |||
val newMat = new BDenseMatrix[Double](mat.rows, mat.cols) | |||
for (r <- 0 until mat.rows) { | |||
val length = math.sqrt((0 until mat.cols).map(c => mat(r, c) * mat(r, c)).sum) | |||
(0 until mat.cols).map(c => newMat.update(r, c, mat(r, c) / length)) | |||
(0 until mat.cols).foreach(c => newMat.update(r, c, mat(r, c) / length)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CC @sryza -- think this might happen to work but should be foreach. Giving a heads up in case it needs to be reflected in text too.
@@ -50,7 +50,7 @@ object RunGeoTime extends Serializable { | |||
} | |||
val hoursUDF = udf(hours) | |||
|
|||
taxiGood.groupBy(hoursUDF('pickupTime, 'dropoffTime)).count().show() | |||
taxiGood.groupBy(hoursUDF($"pickupTime", $"dropoffTime")).count().show() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jwills Spark SQL has (at least) 3 ways to refer to columns. I had used $"..."
syntax elsewhere instead of '...
. I think it's the same. Is it OK to use $
? CCing you in case it needs a text change to go along with it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Totally fine, and thanks for the heads up!
@@ -106,6 +104,6 @@ object KernelDensity { | |||
x: Double): Double = { | |||
val x0 = x - mean | |||
val x1 = x0 / standardDeviation | |||
FastMath.exp(-0.5 * x1 * x1 - logStandardDeviationPlusHalfLog2Pi) | |||
math.exp(-0.5 * x1 * x1 - logStandardDeviationPlusHalfLog2Pi) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(DIdn't seem like a good reason to use FastMath in just a few places here FWIW)
@srowen these seem reasonable to me. Feel free to merge. |
No description provided.