Skip to content

Commit

Permalink
FIX Remove dead code and added return statement to fit
Browse files Browse the repository at this point in the history
  • Loading branch information
dantegd committed Nov 13, 2018
1 parent 27f6a24 commit e28ab6d
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 11 deletions.
1 change: 1 addition & 0 deletions python/cuML/dbscan/dbscan_wrapper.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ class DBSCAN:
<int> self.min_samples,
<int*> labels_ptr)
del(X_m)
return self

def fit_predict(self, X):
"""
Expand Down
11 changes: 0 additions & 11 deletions python/cuML/kmeans/kmeans_wrapper.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,6 @@ class KMeans:
"""

self.gdf_datatype = np.dtype(X[X.columns[0]]._column.dtype)
self.n_rows = len(X)
self.n_cols = len(X._cols)

cdef uintptr_t input_ptr
if (isinstance(X, cudf.DataFrame)):
Expand Down Expand Up @@ -235,8 +233,6 @@ class KMeans:
"""
self.gdf_datatype = np.dtype(X[X.columns[0]]._column.dtype)
self.n_rows = len(X)
self.n_cols = len(X._cols)

cdef uintptr_t input_ptr
if (isinstance(X, cudf.DataFrame)):
Expand Down Expand Up @@ -319,9 +315,6 @@ class KMeans:
"""

self.n_rows = len(X)
self.n_cols = len(X._cols)

cdef uintptr_t input_ptr
if (isinstance(X, cudf.DataFrame)):
self.gdf_datatype = np.dtype(X[X.columns[0]]._column.dtype)
Expand Down Expand Up @@ -349,10 +342,6 @@ class KMeans:

cdef uintptr_t preds_ptr = self._get_ctype_ptr(preds_data)

ary = np.array([1.0, 1.5, 3.5, 2.5], dtype=np.float32)
dary = cuda.to_device(ary)
cdef uintptr_t ptr2 = dary.device_ctypes_pointer.value

if self.gdf_datatype.type == np.float32:
c_kmeans.kmeans_transform(
<int> self.verbose, # verbose
Expand Down
2 changes: 2 additions & 0 deletions python/cuML/pca/pca_wrapper.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,8 @@ class PCA:
if (isinstance(X, cudf.DataFrame)):
del(X_m)

return self

def fit_transform(self, X):
"""
Fit the model with X and apply the dimensionality reduction on X.
Expand Down
1 change: 1 addition & 0 deletions python/cuML/tsvd/tsvd_wrapper.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,7 @@ class TruncatedSVD:
self.singular_values_ptr = singular_vals_ptr

del(X_m)
return self

def fit_transform(self, X):
"""
Expand Down

0 comments on commit e28ab6d

Please sign in to comment.