Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Feedback addressed by Yajing (part 2) #68

Merged
merged 1 commit into from
Feb 1, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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