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

[FIX] Fix inconsistency on predictor name #52

Merged
merged 2 commits into from
Mar 5, 2021
Merged
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
1 change: 1 addition & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ Version 0.1.*
.. |Fix| replace:: :raw-html:`<span class="badge badge-danger">Fix</span>` :raw-latex:`{\small\sc [Fix]}`
.. |API| replace:: :raw-html:`<span class="badge badge-warning">API Change</span>` :raw-latex:`{\small\sc [API Change]}`

- |Fix| fix inconsistency on predictor name (`#52 <https://github.com/LAMDA-NJU/Deep-Forest/pull/52>`__) @xuyxu
- |Feature| add official support for ManyLinux-aarch64 (`#47 <https://github.com/LAMDA-NJU/Deep-Forest/pull/47>`__) @xuyxu
- |Fix| fix accepted types of target for :obj:`CascadeForestRegressor` (`#44 <https://github.com/LAMDA-NJU/Deep-Forest/pull/44>`__) @xuyxu
- |Feature| add multi-output support for :obj:`CascadeForestRegressor` (`#40 <https://github.com/LAMDA-NJU/Deep-Forest/pull/40>`__) @Alex-Medium
Expand Down
10 changes: 5 additions & 5 deletions deepforest/cascade.py
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,7 @@ def __init__(

# Predictor
self.use_predictor = use_predictor
self.predictor_name = predictor
self.predictor = predictor

def __len__(self):
return self.n_layers_
Expand Down Expand Up @@ -915,7 +915,7 @@ def fit(self, X, y, sample_weight=None):
if self.use_predictor:
if is_classifier(self):
self.predictor_ = _build_classifier_predictor(
self.predictor_name,
self.predictor,
self.criterion,
self.n_trees,
self.n_outputs_,
Expand All @@ -927,7 +927,7 @@ def fit(self, X, y, sample_weight=None):
)
else:
self.predictor_ = _build_regressor_predictor(
self.predictor_name,
self.predictor,
self.criterion,
self.n_trees,
self.n_outputs_,
Expand Down Expand Up @@ -955,7 +955,7 @@ def fit(self, X, y, sample_weight=None):

if self.verbose > 0:
msg = "{} Fitting the concatenated predictor: {}"
print(msg.format(_utils.ctime(), self.predictor_name))
print(msg.format(_utils.ctime(), self.predictor))

tic = time.time()
self.predictor_.fit(
Expand Down Expand Up @@ -1092,7 +1092,7 @@ def save(self, dirname="model"):
d["is_classifier"] = is_classifier(self)

if self.use_predictor:
d["predictor_name"] = self.predictor_name
d["predictor"] = self.predictor

# Save label encoder if labels are encoded.
if hasattr(self, "labels_are_encoded"):
Expand Down