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

Fixed ValueError for type of target in MLPClassifier #90

Merged
merged 3 commits into from
Mar 26, 2018
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.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

- Exposed `muffnn.__version__`.
- Fixed bug in `FMClassifier` where it failed for predicting one example.
- Fixed ValueError for type of target in MLPClassifier and FMClassifier (#90).

## [2.1.0] - 2018-02-12

Expand Down
2 changes: 1 addition & 1 deletion muffnn/fm/fm_classifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ def partial_fit(self, X, y, classes=None, monitor=None):
if target_type not in ['binary', 'multiclass']:
# Raise an error, as in
# sklearn.utils.multiclass.check_classification_targets.
raise ValueError("Unknown label type: %r" % y)
raise ValueError("Unknown label type: %s" % target_type)

# Initialize the model if it hasn't been already by a previous call.
if not self._is_fitted:
Expand Down
2 changes: 1 addition & 1 deletion muffnn/mlp/mlp_classifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ def _is_multilabel(self, y):
else:
# Raise an error, as in
# sklearn.utils.multiclass.check_classification_targets.
raise ValueError("Unknown label type: %r" % y)
raise ValueError("Unknown label type: %s" % target_type)

def _fit_targets(self, y, classes=None):
self.multilabel_ = self._is_multilabel(y)
Expand Down