apoc.math.regr
Syntax |
|
||
Description |
Returns the coefficient of determination (R-squared) for the values of propertyY and propertyX in the given label. |
||
Input arguments |
Name |
Type |
Description |
|
|
The label of the nodes to perform the regression on. |
|
|
|
The name of the y property. |
|
|
|
The name of the x property. |
|
Return arguments |
Name |
Type |
Description |
|
|
The coefficient of determination. |
|
|
|
The average of the x values. |
|
|
|
The average of the y values. |
|
|
|
The calculated slope. |
Usage Examples
The examples in this section are based on the following sample graph:
CREATE (:REGR_TEST {x_property: 1 , y_property: 2 })
CREATE (:REGR_TEST {x_property: 2 , y_property: 3 })
CREATE (:REGR_TEST {y_property: 10000 })
CREATE (:REGR_TEST {x_property: 3 , y_property: 6 });
CALL apoc.math.regr('REGR_TEST', 'y_property', 'x_property');
r2 | avgX | avgY | slope |
---|---|---|---|
0.9854227405247813 |
2.0 |
3.6666666666666665 |
1.8571428571428572 |