Skip to content

Class method should be public instead of protected if it is used directly in coding #10191

@genliu777

Description

@genliu777

run the example in http://scikit-learn.org/stable/auto_examples/neighbors/plot_lof.html#sphx-glr-auto-examples-neighbors-plot-lof-py.

although it works, the code Z = clf._decision_function(np.c_[xx.ravel(), yy.ravel()]) shows "Access ot a protected member _decision_function of a class...". something i think it is strange.

even not like c++ in objected-oriented program, i think in python if a class method accessed directly in program, it should be declared public instead of protected.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions