Skip to content

Commit

Permalink
Make method 'findBest' private
Browse files Browse the repository at this point in the history
  • Loading branch information
Darius Morawiec committed Oct 31, 2017
1 parent defe0f6 commit e2740fd
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@
" this.indices = indices;\n",
" this.classes = classes;\n",
"\n",
" this.findMax = function(nums) {\n",
" var findMax = function(nums) {\n",
" var index = 0;\n",
" for (var i = 0; i < nums.length; i++) {\n",
" index = nums[i] > nums[index] ? i : index;\n",
Expand All @@ -121,7 +121,7 @@
" return this.predict(features, this.rChilds[node]);\n",
" }\n",
" }\n",
" return this.findMax(this.classes[node]);\n",
" return findMax(this.classes[node]);\n",
" };\n",
"\n",
"};\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
this.indices = indices;
this.classes = classes;
this.findMax = function(nums) {
var findMax = function(nums) {
var index = 0;
for (var i = 0; i < nums.length; i++) {
index = nums[i] > nums[index] ? i : index;
Expand All @@ -42,7 +42,7 @@
return this.predict(features, this.rChilds[node]);
}
}
return this.findMax(this.classes[node]);
return findMax(this.classes[node]);
};
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
"text": [
"var DecisionTreeClassifier = function() {\n",
"\n",
" this.findMax = function(nums) {\n",
" var findMax = function(nums) {\n",
" var index = 0;\n",
" for (var i = 0; i < nums.length; i++) {\n",
" index = nums[i] > nums[index] ? i : index;\n",
Expand Down Expand Up @@ -161,7 +161,7 @@
" }\n",
" }\n",
" \n",
" return this.findMax(classes);\n",
" return findMax(classes);\n",
" };\n",
"\n",
"};\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"""
var DecisionTreeClassifier = function() {
this.findMax = function(nums) {
var findMax = function(nums) {
var index = 0;
for (var i = 0; i < nums.length; i++) {
index = nums[i] > nums[index] ? i : index;
Expand Down Expand Up @@ -82,7 +82,7 @@
}
}
return this.findMax(classes);
return findMax(classes);
};
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
var {class_name} = function() {{

this.findMax = function(nums) {{
var findMax = function(nums) {{
var index = 0;
for (var i = 0; i < nums.length; i++) {{
index = nums[i] > nums[index] ? i : index;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ var {class_name} = function(lChilds, rChilds, thresholds, indices, classes) {{
this.indices = indices;
this.classes = classes;

this.findMax = function(nums) {{
var findMax = function(nums) {{
var index = 0;
for (var i = 0; i < nums.length; i++) {{
index = nums[i] > nums[index] ? i : index;
Expand All @@ -23,7 +23,7 @@ var {class_name} = function(lChilds, rChilds, thresholds, indices, classes) {{
return this.{method_name}(features, this.rChilds[node]);
}}
}}
return this.findMax(this.classes[node]);
return findMax(this.classes[node]);
}};

}};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ this.{method_name} = function(features) {{
var classes = new Array({n_classes});
{branches}

return this.findMax(classes);
return findMax(classes);
}};

0 comments on commit e2740fd

Please sign in to comment.