Content-Length: 255161 | pFad | http://github.com/mdsahilak/DecisionTreeClassifier

1B GitHub - mdsahilak/DecisionTreeClassifier: Implementing a Generic Decision Tree Classifier in Swift and comparing it with a python version.
Skip to content

Implementing a Generic Decision Tree Classifier in Swift and comparing it with a python version.

Notifications You must be signed in to change notification settings

mdsahilak/DecisionTreeClassifier

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 

Repository files navigation

A Generic Decision Tree Classifier in Swift

Implementing a Generic Decision Tree Classifier in Swift and testing it on a Dataset of Strings and then on the Iris Dataset(comprising of Double values).

This repo consists of a Python and Swift version of a Decision Tree Classifier. Why ML Algorithms in Swift? Check out Swift For TensorFlow - S4TF and Fast AI embracing swift for ML to know why Swift could be the next big thing in Machine Learning.


  • Converting a Decision Tree in Python to Swift.

  • Now swift is a strongly typed language, whereas python is dynamically typed. So, there are small differences in the algorithm. For example, in swift, I dont use an array that contains both strings and doubles at the same time (actually, you can by using the 'Any' type, but it is not ideal and causes a lot of errors later in the code. I am not aware of another way to do it either, if there is another way apart from using Generics, let me know. Thanks 😃).

  • However, the algorithm is Generic. So even though you cannot have strings and doubles at the same time in the training data, it can either be all strings or all double or YourOwnType(that conforms to the equatable protocol) or Int or Bool etc. and the same algorithm can work on all the Data types, as demonstrated in the playground.

If you would like to see another Classifier Algorithm in Swift, check out - K=1 Nearest Neighbour Algorithm.

About

Implementing a Generic Decision Tree Classifier in Swift and comparing it with a python version.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/mdsahilak/DecisionTreeClassifier

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy