rasbt / mlxtend

A library of extension and helper modules for Python's data analysis and machine learning libraries.
https://rasbt.github.io/mlxtend/
Other
4.82k stars 853 forks source link

Fixed incorrect test codes. #1026

Closed fatihsen20 closed 1 year ago

fatihsen20 commented 1 year ago

Code of Conduct

Fix.

Description

Test codes with errors (or usage may have changed) have been fixed.

Related issues or pull requests

None

Pull Request Checklist

fatihsen20 commented 1 year ago

Before fixing:

Ekran görüntüsü 2023-04-02 224630

After fixing:

Ekran görüntüsü 2023-04-06 231717

test_fpbase.py

Change the code: dfs = self.df.astype(pd.SparseDtype("int", np.nan)) dfs = self.df.astype(pd.SparseDtype("int", 0)) because the na_value of the "int" variable in the pd.SparseDtype() function must be 0. You can look at the document

Change the compare_dataframes() function: assert_array_equal() function was not working correctly. To fix this error, I replaced it with the compare_dataframes() function I wrote in "test_hmine.py".

Error Codes:

Ekran görüntüsü 2023-04-02 224725 Ekran görüntüsü 2023-04-02 224827

rasbt commented 1 year ago

Thanks so much for the update, the assert_array_equal() function was not working correctly issue was a sneaky one.

codecov[bot] commented 1 year ago

Codecov Report

Patch coverage: 53.84% and project coverage change: -0.02 :warning:

Comparison is base (8ebfd31) 77.28% compared to head (e283a20) 77.27%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #1026 +/- ## ========================================== - Coverage 77.28% 77.27% -0.02% ========================================== Files 200 200 Lines 11314 11307 -7 Branches 1487 1484 -3 ========================================== - Hits 8744 8737 -7 Misses 2351 2351 Partials 219 219 ``` | [Impacted Files](https://codecov.io/gh/rasbt/mlxtend/pull/1026?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Sebastian+Raschka) | Coverage Δ | | |---|---|---| | [mlxtend/frequent\_patterns/tests/test\_fpbase.py](https://codecov.io/gh/rasbt/mlxtend/pull/1026?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Sebastian+Raschka#diff-bWx4dGVuZC9mcmVxdWVudF9wYXR0ZXJucy90ZXN0cy90ZXN0X2ZwYmFzZS5weQ==) | `94.80% <33.33%> (-3.86%)` | :arrow_down: | | [mlxtend/frequent\_patterns/tests/test\_hmine.py](https://codecov.io/gh/rasbt/mlxtend/pull/1026?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Sebastian+Raschka#diff-bWx4dGVuZC9mcmVxdWVudF9wYXR0ZXJucy90ZXN0cy90ZXN0X2htaW5lLnB5) | `100.00% <100.00%> (+11.53%)` | :arrow_up: | Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Sebastian+Raschka). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Sebastian+Raschka)

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.