-
Notifications
You must be signed in to change notification settings - Fork 0
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
fix: calculation of nb_dimensions for approximated inverse #137
Conversation
saiph/inverse_transform.py
Outdated
@@ -37,7 +38,7 @@ def inverse_transform( | |||
random_gen = np.random.default_rng(model.seed) | |||
|
|||
# Check dimension size regarding N | |||
n_dimensions = len(model.dummy_categorical) + len(model.original_continuous) | |||
n_dimensions = len(model.dummy_categorical) + len(model.original_continuous) - 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
n_dimensions = len(model.dummy_categorical) + len(model.original_continuous) - 1 | |
n_dimensions = len(model.dummy_categorical) + len(model.original_continuous) - nb_variable_categorical |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you create unit test of this fix?
n_dimensions = get_number_of_dimensions_from_categorical_and_continuous( | ||
dummy_categorical=model.dummy_categorical, | ||
original_continuous=model.original_continuous, | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: I was first using model: Model
as the only input, but as it's a @DataClass
, I could not generate a factory for it.
So I went to use that workaround instead
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry if I wasn't clear enough for this point
def get_number_of_dimensions_from_categorical_and_continuous( | ||
*, dummy_categorical: List[Any], original_continuous: List[Any] | ||
) -> int: | ||
return len(dummy_categorical) + len(original_continuous) - 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return len(dummy_categorical) + len(original_continuous) - 1 | |
return len(dummy_categorical) + len(original_continuous) - nb_categorical_variable |
No description provided.