Skip to content

Swift implementation of KDTree based KNeighborsRegressor

License

Notifications You must be signed in to change notification settings

mkirby42/KNeighbors

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

KNeighbors

KDTree based KNeighborsRegressor. Inspired by scikit-learn.

Example

let features = [[2.0, 3.0, 1.0], [5.0, 4.0, 2.0], [9.0, 6.0, 3.0], [4.0, 7.0, 4.0], [8.0, 1.0, 5.0], [7.0, 2.0, 6.0]]
let targets = [4.0, 3.0, 2.0, 1.0, 5.0, 6.0]
let input = [9.0, 2.0, 3.0]
let model = KNeighborsRegressor<Double>()
model.fit(xRows: features, y: targets)
let predictions = model.predict(xRows: [input])

About

Swift implementation of KDTree based KNeighborsRegressor

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages