Skip to content

Commit

Permalink
In DecisionTree: Changed from using procedural syntax for functions r…
Browse files Browse the repository at this point in the history
…eturning Unit to explicitly writing Unit return type.
  • Loading branch information
jkbradley committed Jul 31, 2014
1 parent 376dca2 commit 6eed482
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -606,7 +606,7 @@ object DecisionTree extends Serializable with Logging {
agg: Array[Double],
nodeIndex: Int,
label: Double,
featureIndex: Int) = {
featureIndex: Int): Unit = {
// Find the bin index for this feature.
val arrShift = 1 + numFeatures * nodeIndex
val arrIndex = arrShift + featureIndex
Expand All @@ -624,7 +624,7 @@ object DecisionTree extends Serializable with Logging {
arr: Array[Double],
label: Double,
agg: Array[Double],
rightChildShift: Int) = {
rightChildShift: Int): Unit = {
// Find the bin index for this feature.
val arrIndex = 1 + numFeatures * nodeIndex + featureIndex
val featureValue = arr(arrIndex).toInt
Expand Down Expand Up @@ -659,7 +659,7 @@ object DecisionTree extends Serializable with Logging {
* @return Array[Double] storing aggregate calculation of size
* 2 * numSplits * numFeatures * numNodes for classification
*/
def orderedClassificationBinSeqOp(arr: Array[Double], agg: Array[Double]) = {
def orderedClassificationBinSeqOp(arr: Array[Double], agg: Array[Double]): Unit = {
// Iterate over all nodes.
var nodeIndex = 0
while (nodeIndex < numNodes) {
Expand Down Expand Up @@ -691,7 +691,7 @@ object DecisionTree extends Serializable with Logging {
* @return Array[Double] storing aggregate calculation of size
* 2 * numClasses * numSplits * numFeatures * numNodes for classification
*/
def unorderedClassificationBinSeqOp(arr: Array[Double], agg: Array[Double]) = {
def unorderedClassificationBinSeqOp(arr: Array[Double], agg: Array[Double]): Unit = {
// Iterate over all nodes.
var nodeIndex = 0
while (nodeIndex < numNodes) {
Expand Down Expand Up @@ -736,7 +736,7 @@ object DecisionTree extends Serializable with Logging {
* @return Array[Double] storing aggregate calculation of size
* 3 * numSplits * numFeatures * numNodes for regression
*/
def regressionBinSeqOp(arr: Array[Double], agg: Array[Double]) = {
def regressionBinSeqOp(arr: Array[Double], agg: Array[Double]): Unit = {
// Iterate over all nodes.
var nodeIndex = 0
while (nodeIndex < numNodes) {
Expand Down

0 comments on commit 6eed482

Please sign in to comment.