cloud-fan commented on a change in pull request #34882:
URL: https://github.com/apache/spark/pull/34882#discussion_r815953323
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/aggregate/linearRegression.scala
##########
@@ -105,3 +106,100 @@ case class RegrAvgY(left: Expression, right: Expression)
newLeft: Expression, newRight: Expression): RegrAvgY =
this.copy(left = newLeft, right = newRight)
}
+
+abstract class Regression
+ extends DeclarativeAggregate with ImplicitCastInputTypes with
BinaryLike[Expression] {
+
+ override def nullable: Boolean = true
+ override def dataType: DataType = DoubleType
+ override def inputTypes: Seq[AbstractDataType] = Seq(DoubleType, DoubleType)
+
+ protected val count = AttributeReference("count", DoubleType)()
+ protected val meanX = AttributeReference("meanX", DoubleType)()
+ protected val meanY = AttributeReference("meanY", DoubleType)()
+ protected val c2 = AttributeReference("c2", DoubleType)()
+ protected val m2X = AttributeReference("m2X", DoubleType)()
Review comment:
can you refer to some doc/wiki about the algorithm? otherwise it's hard
to understand `c2` and `m2x`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]