Skip to content

gitter-badger/AdaBoost

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AdaBoost

Adaptive Boost Algorithm

Example

var trainingData = [
	["Coughing", "Male", "Adult", "Discharged"],
	["Coughing", "Female", "Teen", "Discharged"],
	["Headache", "Male", "Child", "Discharged"],
	["Headache", "Male", "Teen", "Discharged"],
	["Hiccups", "Female", "Adult", "Discharged"],
	["Sneezing", "Male", "Teen", "Discharged"],
	["Sneezing", "Female", "Child", "Admitted"],
	["Sneezing", "Male", "Child", "Admitted"],
	["Hiccups", "Female", "Teen", "Admitted"],
	["Coughing", "Female", "Adult", "Admitted"],
	["Coughing", "Male", "Child", "Admitted"]
];

var adaBoost = new AdaBoost(trainingData, "Discharged");

var vote = adaBoost.predict(["Coughing", "Male", "Child"], true);
console.log("The final vote is " + vote);
console.log("The person will most likely be " + (vote > 1 ? "Discharged" : "Admitted"));
console.log("");
// The final vote is -1.7181763612259795
// The person will most likely be Admitted

vote = adaBoost.predict(["Headache", "Female", "Child"]);
console.log("The final vote is " + vote); 
console.log("The person will most likely be " + (vote > 1 ? "Discharged" : "Admitted"));
console.log("");
// The final vote is 1.60653649762956
// The person will most likely be Discharged

vote = adaBoost.predict(["Hiccups", "Female", "Adult"]);
console.log("The final vote is " + vote);
console.log("The person will most likely be " + (vote > 1 ? "Discharged" : "Admitted"));
console.log("");
// The final vote is -0.0843346278612036 true
// The person will most likely be Admitted

vote = adaBoost.predict(["Headache", "", "Child"]);
console.log("The final vote is " + vote);
console.log("The person will most likely be " + (vote > 1 ? "Discharged" : "Admitted"));
console.log("");
// The final vote is 2.3552095483256945 true
// The person will most likely be Discharged

About

Adaptive Boost Algorithm

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%