Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
qzhao19 committed Jul 22, 2023
1 parent f8214c1 commit 7995684
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
18 changes: 18 additions & 0 deletions example.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import numpy as np
from kdtree import KDTree
from sklearn import datasets

def test(data):
num_samples, _ = data.shape

ratio = 0.85
X_train = data[:int(ratio*num_samples), :]
X_test = data[int(ratio*num_samples):, :]

kd_tree = KDTree(X_train)
kd_tree.build_tree()

nn = kd_tree.query(X_test, 4)

if __name__ == "__main__":
test(datasets)
24 changes: 24 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import os
import sys
from setuptools import setup

setup(name ="kdtree",
version = "1.0.0",
description = "Python library for optimization descent algorithms",
long_description = open("README.md").read(),
url = "https://github.com/qzhao19/kdtree",
author = 'Qi ZHAO',
author_email = '[email protected]',
license = "MIT",
packages = ['kdtree'],
install_requires = ["numpy>=1.19.5"],
classifiers=[
"Intended Audience :: Science/Research",
"Topic :: Scientific/Engineering :: Mathematics :: Machine Learning Algorithms",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.6",
'Operating System :: Unix',
],
keywords='kdtree',
)

0 comments on commit 7995684

Please sign in to comment.