8000 Why does _fit_and_score use print() instead of logging? · Issue #6487 · scikit-learn/scikit-learn · GitHub
[go: up one dir, main page]

Skip to content
Why does _fit_and_score use print() instead of logging? #6487
Closed
@FragLegs

Description

@FragLegs

Forgive me if this has been discussed already, but why does sklearn.cross_validation._fit_and_score use a verbosity parameter and the print function, rather than using python's logging module? As someone who is building a library that uses sklearn, it means that I have to expose that verbosity parameter in my code, rather than letting the user set the logging level (or even hide the logging from that module).

For instance in lines 1434-1440 of sklearn/cross_validation.py

    if verbose > 1:
        if parameters is None:
            msg = "no parameters to be set"
        else:
            msg = '%s' % (', '.join('%s=%s' % (k, v)
                          for k, v in parameters.items()))
        print("[CV] %s %s" % (msg, (64 - len(msg)) * '.'))

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

      0