Skip to content
Open
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
7 changes: 4 additions & 3 deletions yellowbrick/regressor/influence.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ def fit(self, X, y):

# Compute Cook's distance
residuals_studentized = residuals / np.sqrt(mse) / np.sqrt(1 - leverage)
self.distance_ = residuals_studentized ** 2 / X.shape[1]
self.distance_ = residuals_studentized**2 / X.shape[1]
self.distance_ *= leverage / (1 - leverage)

# Compute the p-values of Cook's Distance
Expand All @@ -180,8 +180,9 @@ def draw(self):
"""
# Draw a stem plot with the influence for each instance
_, _, baseline = self.ax.stem(
self.distance_, linefmt=self.linefmt, markerfmt=self.markerfmt,
use_line_collection=True
self.distance_,
linefmt=self.linefmt,
markerfmt=self.markerfmt,
)

# No padding on either side of the instance index
Expand Down
Loading