Skip to content

Commit

Permalink
Return Python string from dump_as_json() of RF (#3130)
Browse files Browse the repository at this point in the history
* Return Python string from dump_as_json() of RF

* Add changelog
  • Loading branch information
hcho3 authored Nov 11, 2020
1 parent 4a7b879 commit d9a73a7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
- PR #3086: Reverting FIL Notebook Testing
- PR #3114: Fixed a typo in SVC's predict_proba AttributeError
- PR #3119: Fix memset args for benchmark
- PR #3130: Return Python string from `dump_as_json()` of RF

# cuML 0.16.0 (Date TBD)

Expand Down
4 changes: 2 additions & 2 deletions python/cuml/ensemble/randomforestclassifier.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -933,5 +933,5 @@ class RandomForestClassifier(BaseRandomForestModel, ClassifierMixin):
<RandomForestMetaData[double, int]*><uintptr_t> self.rf_forest64

if self.dtype == np.float64:
return dump_rf_as_json(rf_forest64)
return dump_rf_as_json(rf_forest)
return dump_rf_as_json(rf_forest64).decode('utf-8')
return dump_rf_as_json(rf_forest).decode('utf-8')
4 changes: 2 additions & 2 deletions python/cuml/ensemble/randomforestregressor.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -739,5 +739,5 @@ class RandomForestRegressor(BaseRandomForestModel, RegressorMixin):
<RandomForestMetaData[double, double]*><uintptr_t> self.rf_forest64

if self.dtype == np.float64:
return dump_rf_as_json(rf_forest64)
return dump_rf_as_json(rf_forest)
return dump_rf_as_json(rf_forest64).decode('utf-8')
return dump_rf_as_json(rf_forest).decode('utf-8')

0 comments on commit d9a73a7

Please sign in to comment.