Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace sklearn euclidean import with custom function #8

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion Concurrent_AP.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
import optparse
import os
import psutil
from sklearn.metrics.pairwise import euclidean_distances
import sys
import tables
from tempfile import NamedTemporaryFile
Expand All @@ -54,6 +53,11 @@

__all__ = []

def euclidean_distances(x, y, squared=False):
if squared:
return np.dot(x,x) - 2 * np.dot(x,y) + np.dot(y, y)
else:
return np.sqrt(np.dot(x,x) - 2 * np.dot(x,y) + np.dot(y, y))

def memory():
"""Determine memory specifications of the machine.
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@

py_modules = ['Concurrent_AP'],
platforms = ('Any',),
install_requires = ['numpy>=1.9.0', 'psutil', 'sklearn', 'setuptools', 'tables'],
install_requires = ['numpy>=1.9.0', 'psutil', 'setuptools', 'tables'],

classifiers = ['Development Status :: 4 - Beta',
'Environment :: Console',
Expand Down