Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mahalanobis.fit unexpectedly raises error when no categorical variables are present #905

Open
sfo opened this issue Oct 30, 2024 · 0 comments

Comments

@sfo
Copy link

sfo commented Oct 30, 2024

The following implementation for the fit-method's parameter validation raises an exception when there is no cat_vars parameter given in the object's constructor:

if self.cat_vars is None:
raise TypeError('No categorical variables specified in the "cat_vars" argument.')

However, the documentation says (emphasize mine):

cat_vars: dictionary with as keys the categorical columns and as values the number of categories per categorical variable. Only needed if categorical variables are present.

Even in the docstring of the function itself it states:

If categorical variables are present, then transform those to numerical values.
This step is not necessary in the absence of categorical variables.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant