Skip to content

Commit

Permalink
fix : pycm_param --> params
Browse files Browse the repository at this point in the history
  • Loading branch information
sepandhaghighi committed Oct 8, 2024
1 parent 8ad3ee2 commit 188cb5e
Show file tree
Hide file tree
Showing 14 changed files with 23 additions and 22 deletions.
20 changes: 10 additions & 10 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,17 @@ Please consider the following :
## Class statistic

1. Add new functions to `pycm_class_func.py`
2. Update `CLASS_PARAMS` dictionary in `pycm_param.py`
2. Update `CLASS_PARAMS` dictionary in `params.py`
3. Update `class_statistics` function in `pycm_class_func.py`
- Call statistic function and store result in `result` dictionary
4. Update `PARAMS_DESCRIPTION` dictionary in `pycm_param.py` by a short description
- If you don't want capitalization, update `CAPITALIZE_FILTER` list in `pycm_param.py` (*Optional*)
4. Update `PARAMS_DESCRIPTION` dictionary in `params.py` by a short description
- If you don't want capitalization, update `CAPITALIZE_FILTER` list in `params.py` (*Optional*)
5. Update `References` section in `Document.ipynb` (`IEEE` format)
6. Add description to `Class Statistics` section in `Document.ipynb`
- Cite reference
- Update table of contents
- Use `LaTeX` for formula
7. Update `PARAMS_LINK` dictionary in `pycm_param.py` by document tag (without `#`)
7. Update `PARAMS_LINK` dictionary in `params.py` by document tag (without `#`)
8. Add tests to `overall_test.py` and `function_test.py` in `TEST` folder
- If you have any verified test add them to `verified_test.py`
9. Run `autopep8.bat`/`autopep8.sh` (*Optional*, need to install latest version of `autopep8` package)
Expand All @@ -47,7 +47,7 @@ Please consider the following :
## Overall statistic

1. Add new functions to `pycm_overall_func.py`
2. Update `OVERALL_PARAMS` dictionary in `pycm_param.py`
2. Update `OVERALL_PARAMS` dictionary in `params.py`
3. Update `overall_statistics` function in `pycm_class_func.py`
- Call statistic function and store result in a variable
- Add this variable to output
Expand All @@ -56,7 +56,7 @@ Please consider the following :
- Cite reference
- Update table of contents
- Use `LaTeX` for formula
6. Update `PARAMS_LINK` dictionary in `pycm_param.py` by document tag (without `#`)
6. Update `PARAMS_LINK` dictionary in `params.py` by document tag (without `#`)
7. Add tests to `overall_test.py` and `function_test.py` in `TEST` folder
- If you have any verified test add them to `verified_test.py`
8. Run `autopep8.bat`/`autopep8.sh` (*Optional*, need to install latest version of `autopep8` package)
Expand All @@ -65,17 +65,17 @@ Please consider the following :
## Interpretation

1. Add new interpretation table as a function to `pycm_interpret.py`
2. Add a score dictionary to `pycm_param.py`
2. Add a score dictionary to `params.py`
- Example : ```PLRI_SCORE = {"Good": 4, "Fair": 3, "Poor": 2, "Negligible": 1, "None": "None"}```
3. Add a color dictionary to `BENCHMARK_COLOR` in `pycm_param.py`
3. Add a color dictionary to `BENCHMARK_COLOR` in `params.py`
- Example :
```"PLRI": {"Negligible": "Red","Poor": "Orange","Fair": "Yellow","Good": "Green","None": "White"}```
4. If interpretation table is for a class statistic:
- Step 2-7 [class statistic](#class-statistic)
- Update `CLASS_BENCHMARK_SCORE_DICT` in `pycm_param.py`
- Update `CLASS_BENCHMARK_SCORE_DICT` in `params.py`
5. If interpretation table is for a overall statistic:
- Step 2-6 [overall statistic](#overall-statistic)
- Update `OVERALL_BENCHMARK_SCORE_DICT` in `pycm_param.py`
- Update `OVERALL_BENCHMARK_SCORE_DICT` in `params.py`
6. Add tests to `compare_test.py`, `overall_test.py` and `function_test.py` in `TEST` folder
- If you have any verified test add them to `verified_test.py`
7. Run `autopep8.bat`/`autopep8.sh` (*Optional*, need to install latest version of `autopep8` package)
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- `pycm_util.py` renamed to `utils.py`
- `pycm_test.py` renamed to `basic_test.py`
- `pycm_profile.py` renamed to `profile.py`
- `pycm_param.py` renamed to `params.py`
## [4.0] - 2023-06-07
### Added
- `pycmMultiLabelError` class
Expand Down
2 changes: 1 addition & 1 deletion Otherfiles/RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
2. `README.md`
3. `Otherfiles/version_check.py`
4. `Otherfiles/meta.yaml`
5. `pycm/pycm_param.py`
5. `pycm/params.py`
6. `Document/Document.ipynb`
3. Update `CHANGELOG.md`
1. Add a new header under `Unreleased` section (Example: `## [0.1] - 2022-08-17`)
Expand Down
2 changes: 1 addition & 1 deletion Otherfiles/version_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
os.path.join("Document", "Example1_files", "cm2.html"): HTML_ITEMS,
os.path.join("Document", "Example1_files", "cm3.html"): HTML_ITEMS,
os.path.join("Otherfiles", "test.html"): HTML_ITEMS,
os.path.join("pycm", "pycm_param.py"): PARAMS_ITEMS,
os.path.join("pycm", "params.py"): PARAMS_ITEMS,
os.path.join(".github", "ISSUE_TEMPLATE", "bug_report.yml"): ISSUE_TEMPLATE_ITEMS,
}

Expand Down
2 changes: 1 addition & 1 deletion Test/overall_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -1272,7 +1272,7 @@
True
>>> cm.imbalance
True
>>> from pycm.pycm_param import IMBALANCED_RECOMMEND, MULTICLASS_RECOMMEND, BINARY_RECOMMEND
>>> from pycm.params import IMBALANCED_RECOMMEND, MULTICLASS_RECOMMEND, BINARY_RECOMMEND
>>> set(cm.recommended_list) == set(IMBALANCED_RECOMMEND)
True
>>> cm = ConfusionMatrix(matrix={1: {1: 60, 2: 9, 3: 1, 4: 0, 5: 0, 6: 0}, 2: {1: 23, 2: 48, 3: 0, 4: 2, 5: 2, 6: 1}, 3: {1: 11, 2: 5, 3: 1, 4: 0, 5: 0, 6: 0}, 4: {1: 0, 2: 2, 3: 0, 4: 7, 5: 1, 6: 3}, 5: {1: 2, 2: 1, 3: 0, 4: 0, 5: 4, 6: 2}, 6: {1: 1, 2: 2, 3: 0, 4: 2, 5: 1, 6: 23}}) # Verified Case
Expand Down
2 changes: 1 addition & 1 deletion pycm/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
"""PyCM modules."""
from .pycm_param import PYCM_VERSION, OVERALL_BENCHMARK_LIST, CLASS_BENCHMARK_LIST
from .params import PYCM_VERSION, OVERALL_BENCHMARK_LIST, CLASS_BENCHMARK_LIST
from .pycm_error import *
from .pycm_output import pycm_help, online_help
from .pycm_distance import DistanceType
Expand Down
2 changes: 1 addition & 1 deletion pycm/pycm_class_func.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import math
from .utils import normal_quantile
from .pycm_interpret import *
from .pycm_param import CLASS_PARAMS
from .params import CLASS_PARAMS


def sensitivity_index_calc(TPR, FPR):
Expand Down
2 changes: 1 addition & 1 deletion pycm/pycm_compare.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from .pycm_error import pycmCompareError
from .pycm_output import *
from .utils import *
from .pycm_param import *
from .params import *
from .pycm_obj import ConfusionMatrix
import os
import numpy
Expand Down
2 changes: 1 addition & 1 deletion pycm/pycm_curve.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from __future__ import division
from .pycm_error import pycmCurveError, pycmPlotError
from .utils import threshold_func, thresholds_calc, isfloat
from .pycm_param import *
from .params import *
from .pycm_obj import ConfusionMatrix
from warnings import warn
import numpy
Expand Down
2 changes: 1 addition & 1 deletion pycm/pycm_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from .pycm_error import pycmVectorError, pycmMatrixError
from .pycm_overall_func import overall_statistics
from .utils import *
from .pycm_param import *
from .params import *
import json
import types
import numpy
Expand Down
2 changes: 1 addition & 1 deletion pycm/pycm_multilabel_cm.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"""MultiLabelCM module."""
from __future__ import division
from .pycm_error import pycmVectorError, pycmMultiLabelError
from .pycm_param import *
from .params import *
from .pycm_obj import ConfusionMatrix
import numpy

Expand Down
2 changes: 1 addition & 1 deletion pycm/pycm_obj.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from .pycm_distance import DistanceType, DISTANCE_MAPPER
from .pycm_output import *
from .utils import *
from .pycm_param import *
from .params import *
from .pycm_ci import __CI_overall_handler__, __CI_class_handler__
import os
import json
Expand Down
2 changes: 1 addition & 1 deletion pycm/pycm_output.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"""Outputs functions."""
from __future__ import division
from functools import partial
from .pycm_param import *
from .params import *
from .utils import rounder, sort_char_num
import webbrowser

Expand Down
2 changes: 1 addition & 1 deletion pycm/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import math
import numpy
import re
from .pycm_param import *
from .params import *
from .pycm_error import pycmMatrixError
from warnings import warn
from functools import wraps
Expand Down

0 comments on commit 188cb5e

Please sign in to comment.