Skip to content

Commit

Permalink
Merge pull request #2 from rapidsai/branch-0.9
Browse files Browse the repository at this point in the history
Merge cuML
  • Loading branch information
danielhanchen authored Jul 30, 2019
2 parents 66bf1ea + 61da395 commit c8c25ed
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 1 deletion.
2 changes: 1 addition & 1 deletion BUILD.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ $ ./test/prims --gtest_list_tests # ML Primitive function tests

4. Build and install `libcumlcomms` (C++/CUDA library enabling multi-node multi-GPU communications), starting from the repository root folder:
```bash
$ cd cpp/comms
$ cd cpp/comms/std
$ mkdir build && cd build
$ cmake ..

Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
- PR #832: Stateless Decision Tree and Random Forest API
- PR #857: Small modifications to comms for utilizing IB w/ Dask
- PR #851: Random forest Stateless API wrappers
- PR #895: Pretty prints arguments!

## Bug Fixes

Expand All @@ -34,6 +35,7 @@
- PR #849: PCA no attribute trans_input_ transform bug fix
- PR #869: Removing incorrect information from KNN Docs
- PR #885: libclang installation fix for GPUCI
- PR #896: Fix typo in comms build instructions

# cuML 0.8.0 (27 June 2019)

Expand Down
22 changes: 22 additions & 0 deletions python/cuml/common/base.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

import cuml.common.handle
import cuml.common.cuda
import inspect


class Base:
Expand Down Expand Up @@ -80,6 +81,27 @@ class Base:
self.handle = cuml.common.handle.Handle() if handle is None else handle
self.verbose = verbose

def __repr__(self):
"""
Pretty prints the arguments of a class using Sklearn standard :)
"""
cdef list signature = inspect.getfullargspec(self.__init__).args
if signature[0] == 'self':
del signature[0]
cdef dict state = self.__dict__
cdef str string = self.__class__.__name__ + '('
cdef str key
for key in signature:
if key not in state:
continue
if type(state[key]) is str:
string += "{}='{}', ".format(key, state[key])
else:
if hasattr(state[key], "__str__"):
string += "{}={}, ".format(key, state[key])
string = string.rstrip(', ')
return string + ')'

def get_param_names(self):
"""
Returns a list of hyperparameter names owned by this class. It is
Expand Down

0 comments on commit c8c25ed

Please sign in to comment.