Skip to content

BUG: truncated docstring in fill_counts() leaves function undocumented #4986

@onkar717

Description

@onkar717

Issue Description

The function fill_counts() in shap/plots/_utils.py has an incomplete docstring
that was cut off mid-sentence:

def fill_counts(partition_tree):
    """This updates the"""

The sentence is never finished, so the function has effectively no documentation.
The function fills the fourth column of the partition tree matrix with the total
leaf count for each internal cluster node this should be stated in the docstring.

Minimal Reproducible Example

import shap.plots._utils as u
help(u.fill_counts)

# Output:
# fill_counts(partition_tree)
#     This updates the
#
# (truncated — reader has no idea what is being updated or why)

Traceback

No exception. This is a documentation quality issue.

Expected Behavior

help(u.fill_counts) should display a complete description of what the function
does e.g. "This fills the fourth column of the partition tree matrix with the
leaf count for each cluster."

Bug report checklist

  • I have checked that this issue has not already been reported.
  • I have confirmed this bug exists on the latest release of shap.
  • I have confirmed this bug exists on the master branch of shap.
  • I'd be interested in making a PR to fix this bug

Installed Versions

import shap; shap.show_versions()

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIndicates an unexpected problem or unintended behaviour

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions