refactor(_mf_class.py): improve code quality and fix potential issues#42
refactor(_mf_class.py): improve code quality and fix potential issues#42DataboyUsen wants to merge 1 commit intosoftmin:mainfrom
Conversation
DataboyUsen
commented
Apr 3, 2026
- Replace random_state handling with proper rng instance initialization
- Remove pandas dependency by using numpy-only operations
- Fix convergence check: apply abs() to obj_diff before comparison
- Porperly move the initialization of model parameters to fit() method
- Fix spelling errors in comments and docstrings
- Replace random_state handling with proper rng instance initialization - Remove pandas dependency by using numpy-only operations - Fix convergence check: apply abs() to obj_diff before comparison - Porperly move the initialization of model parameters to fit() method - Fix spelling errors in comments and docstrings
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
|
Thank you @DataboyUsen Let me just copy paste the suggestions generated by opus 4.6: most of the comments are valid, please check P4 very careful to see if it is correct or not. Thx! 1. BUG: Shared mutable list via
|
| # | Issue | Severity | Lines Affected |
|---|---|---|---|
| 1 | Shared mutable list bug | Critical | 278, 285 |
| 2a | Validation in __init__ |
Medium-High | 202-213 |
| 2b | Default param mutation | Medium-High | 220-221 |
| 2c | Derived self.rng in __init__ |
Medium-High | 231-234 |
| 2d | Pre-init fitted attributes | Medium-High | 235-238 |
| 3 | User/Item update duplication | Medium | 311-442 |
| 4 | obj() X parameter misuse |
Low-Medium | 515-516 |
| 5 | Missing input validation | Low-Medium | fit() top |
| 6 | Missing fitted check | Low | 458 |
| 7 | Minor style issues | Low | Various |
|
Sure, I'll check those potential issues. Thank you so much for the assitance. |