UBC-MDS / sktidy

Broom but for sklearn, to tidy up the messy fit results for Linear Regression and KMeans.
https://sktidy.readthedocs.io/en/latest
MIT License
0 stars 2 forks source link

Helper functions? #30

Closed JacobMcFarlane closed 3 years ago

JacobMcFarlane commented 3 years ago

Our functions reuse a bit of code (see the block and a couple other places)

# raise error when model is not fitted yet
check_is_fitted(model)

# raise error when X is not a pandas dataframe object
 if not isinstance(X, pd.core.frame.DataFrame):
      raise TypeError("Input X should be of type 'pandas.core.frame.DataFrame'.")

We might want to consider adding helper functions to not repeat this each function (time permitting)

anodaini commented 3 years ago

Interesting idea. I find that these lines are clear in what they do and I am afraid not using them in this way may add unnecessary complexity. We can discuss this in our meeting next week. Thanks, Jacob!