DistrictDataLabs / yellowbrick

Visual analysis and diagnostic tools to facilitate machine learning model selection.
http://www.scikit-yb.org/
Apache License 2.0
4.3k stars 559 forks source link

Fixes #1160 Create random_state property to keep random_state in sync with PCA Transformer #1173

Closed lwgray closed 3 years ago

lwgray commented 3 years ago

This PR fixes #1160 which reported a bug that caused a problem to occur when users ran pca decomposition. Some time pca_decomposition finishes with an exception (AttributeError: 'PCA' object has no attribute 'random_state').

I changed in accordance to @bbengfort conversation with submitter of issue #1160:

  1. set self.random_state = random_state within the init
  2. created property for random_state that sets the pca transformers random_state param

This PR also fixes #1167 which reported a bug that caused a problem to occur when users run rocauc. An AttributeError would state that the model object has no attribute 'binary'

I changed:

  1. set self.binary = binary
lwgray commented 3 years ago

@bbengfort did you want me to fix that #1167 bug in this same PR?

bbengfort commented 3 years ago

@lwgray that would be great - it's just one additional line and they're related so I think it make sense to do it in the same PR.

lwgray commented 3 years ago

@bbengfort I made those changes...can I get a review? Thanks!