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

[REVIEW] Added ability to call cuML with numpy arrays and general test cleaning #33

Merged
merged 10 commits into from
Nov 13, 2018

Conversation

dantegd
Copy link
Member

@dantegd dantegd commented Nov 13, 2018

PR adds the ability to call cuML methods using numpy arrays (except for knn for now):

from cuml import TruncatedSVD as cuTSVD
cutsvd = cuTSVD(n_components=1)
X = np.array([[-1, -1], [-2, -1], [-3, -2], [1, 1], [2, 1], [3, 2]],
                     dtype=np.float32)
X_t = cutsvd.fit_transform(X)

Also major cleaning of the python tests and expanded coverage. Upcoming PR will clean and improve kmeans, and overall improve coverage.

Also solves bugs dbscan and other methods.

python/cuML/kmeans/kmeans_wrapper.pyx Outdated Show resolved Hide resolved
python/cuML/kmeans/kmeans_wrapper.pyx Outdated Show resolved Hide resolved
python/cuML/kmeans/kmeans_wrapper.pyx Outdated Show resolved Hide resolved
python/cuML/kmeans/kmeans_wrapper.pyx Outdated Show resolved Hide resolved
@@ -185,7 +179,7 @@ class PCA:
def _get_column_ptr(self, obj):
return self._get_ctype_ptr(obj._column._data.to_gpu_array())

def fit(self, X, _transform=True):
def fit(self, X, _transform=False):
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be nice to return self in fit to comply with sklearn like api

@oyilmaz-nvidia
Copy link
Contributor

@dantegd Just tested and it worked for me. Great work! Quick question. Can we add these numpy examples in the jupyter notebooks? I think people will like to see these code examples. Maybe Jiwei can help on this. Any thoughts?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants