Skip to content

Commit

Permalink
making some more methods private
Browse files Browse the repository at this point in the history
  • Loading branch information
manishamde committed Mar 23, 2014
1 parent f963ef5 commit 201702f
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1114,7 +1114,7 @@ object DecisionTree extends Serializable with Logging {
/**
* Calculates the classifier accuracy.
*/
def accuracyScore(model: DecisionTreeModel, data: RDD[LabeledPoint],
private def accuracyScore(model: DecisionTreeModel, data: RDD[LabeledPoint],
threshold: Double = 0.5): Double = {
def predictedValue(features: Array[Double]) = {
if (model.predict(features) < threshold) 0.0 else 1.0
Expand All @@ -1130,7 +1130,7 @@ object DecisionTree extends Serializable with Logging {
/**
* Calculates the mean squared error for regression.
*/
def meanSquaredError(tree: DecisionTreeModel, data: RDD[LabeledPoint]): Double = {
private def meanSquaredError(tree: DecisionTreeModel, data: RDD[LabeledPoint]): Double = {
data.map { y =>
val err = tree.predict(y.features) - y.label
err * err
Expand Down

0 comments on commit 201702f

Please sign in to comment.