Conversation
- Reuse normalized dual indices across fit/likelihood/gradient/SEs to avoid double sparse conversion; support cached indices in _prepare_data. - Accept sparse/index dual inputs with stronger validation (binary, upper triangle) and document sparse flattening order (s*J+t); remove redundant diagonal check. - Add predict_proba and per-observation log-likelihood helpers; expose log_likelihood wrapper; extend simulate_data with rng/dtype controls. - Expand tests for validation edge cases, sparse equivalence, helpers, and reproducibility. - Keep dual gradient comments aligned with the vectorized implementation; all tests pass.
… parameter transformation, introduce a dedicated data validation and index preparation method, and update examples to reflect these changes and the `compute_standard_errors` signature.
…rm_params`, `calculate_utilities`, and `neg_log_likelihood`.
- Drop compatibility wrappers for transform_params/calculate_utilities/neg_log_likelihood and update examples/tests to use internal APIs with cached indices. - Document sparse dual flattening order (s*J+t), keep validation tight, remove redundant diagonal check. - Fix lint nits in examples (unused vars, bare except) and keep benchmark timing using internal nll/grad. - Refresh README API list to match current public surface; tests now pass with new signatures.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Testing improvements:
tests/test_model.pyto verify that non-binary entries iny_singleandy_dualraiseValueError, and that dual choices on the diagonal are properly rejected. This strengthens input validation and ensures correct model behavior. [1] [2]Simulation and reproducibility enhancements:
multe/simulate.pyto support explicit random number generator (rng) and data type (dtype) arguments insimulate_data, improving reproducibility and flexibility. Also added type hints and clarified docstrings for better developer experience. [1] [2] [3] [4] [5]Code formatting and readability:
examples/basic_example.py,examples/benchmark.py,examples/csv_example.py, andexamples/simple_fit_example.pyfor improved readability and consistency, including multi-line formatting and standardized string quotes. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15]Documentation and citation:
README.mdwith BibTeX entry, providing clear instructions for users on how to cite the package in academic work.Pre-commit configuration:
.pre-commit-config.yamlfile to enable automated code quality checks and formatting using pre-commit hooks, supporting consistent code style and reducing manual errors.