Skip to content

Commit

Permalink
fix: Feedback addressed by Yajing (part 2)
Browse files Browse the repository at this point in the history
  • Loading branch information
yajing03 committed Feb 1, 2025
1 parent 9c5d1d2 commit a0cc78f
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 7 deletions.
15 changes: 14 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,24 @@ This package consists of four functions:
`matrics_calculator` works alongside Python libraries like `scikit-learn` by providing simple implementations of regression metrics. Unlike `scikit-learn`’s full toolkit for modeling and evaluation, this package focuses only on metrics, making it easy to use for quick analysis or custom workflows.

## Installation

To install the package, navigate to the root directory of the project and run:
```bash
$ pip install matrics_calculator
```

### Dependencies
This package requires the following dependencies:
- [numpy](https://numpy.org/)
- [pandas](https://pandas.pydata.org/)
- [scikit-learn](https://scikit-learn.org/)
- [matplotlib](https://matplotlib.org/)
- [vega-datasets](https://github.com/altair-viz/vega_datasets)

These dependencies are installed automatically when you install the package using:
```bash
pip install matrics_calculator
```

## Usage

Here’s how to use the functions in this package:
Expand Down
12 changes: 6 additions & 6 deletions src/matrics_calculator/r2.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ def r2(y_pred, y_true):
Examples
--------
data = {
'math_test': [80, 85, 90, 95],
'science_test': [78, 82, 88, 92],
'final_grade': [84, 87, 91, 94],
'absences': [3, 0, 1, 30]
}
>>> data = {
>>> 'math_test': [80, 85, 90, 95],
>>> 'science_test': [78, 82, 88, 92],
>>> 'final_grade': [84, 87, 91, 94],
>>> 'absences': [3, 0, 1, 30]
>>> }
>>> r2(data['math_test'],data['final_grade'])
0.997
>>> r2(data['math_test'],data['absences'])
Expand Down

0 comments on commit a0cc78f

Please sign in to comment.