Skip to content

16.4.3 Exercises: error raised with MLPClassifier predict method #14

@dereckdamphouse

Description

@dereckdamphouse

Seems like mlp._predict may be deprecated(?), as the following error is raised when running 16.4.3 (scikit-learn v0.24.2):

AttributeError Traceback (most recent call last)
in
----> 1 mlp._predict(x)[0]

AttributeError: 'MLPClassifier' object has no attribute '_predict'

From scikit-learn, seems like the method to use is predict_proba(x).

So, mlp.predict_proba(x)[0] seems to work correctly.

scikit-learn source

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions