Skip to content

Commit

Permalink
Updated readme to include price_threshold parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
Franklin Aryee committed Jan 31, 2025
1 parent 1b2c650 commit fb88d52
Showing 1 changed file with 18 additions and 5 deletions.
23 changes: 18 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ $ pip install salesanalyzer_mds
```

## Functions

- `segment_revenue_share`: Segments products into three categories: cheap, medium, expensive, based on price, and calculates their respective share in total revenue.
- `predictSales`: Predicts future sales based on the provided historical data and the target.
- `sales_summary_statistics`: Calculates a variety of summary statistics that provide insights into overall sales performance,
Expand All @@ -36,10 +37,13 @@ import pandas as pd # additional import to handle your sales data
3. Retrieve the insights:

**Summary statistics**

```
sales_summary_statistics(your_sales_data)
```
The `sales_summary_statistics` returns a pandas DataFrame with:

The `sales_summary_statistics()` function returns a pandas DataFrame with:

- 'total_revenue': The total revenue generated by all sales.
- 'unique_customers': The number of unique customers.
- 'average_order_value': The average value of an order (sum of revenue per invoice).
Expand All @@ -48,15 +52,22 @@ The `sales_summary_statistics` returns a pandas DataFrame with:
- 'average_revenue_per_customer': The average revenue generated by each customer.

**Segment revenue share**

```
segment_revenue_share(your_sales_data,
price_col='UnitPrice',
quantity_col='Quantity') # replace column names with your data column names
quantity_col='Quantity',
price_thresholds=None) # replace column names with your data column names
```
The `segment_revenue_share` returns a pandas DataFrame showing the total revenue share for each price segment:
'cheap', 'medium', 'expensive'.

The `segment_revenue_share()` funtion returns a pandas DataFrame showing the total revenue share for each price segment:
'cheap', 'medium', 'expensive'. Custom price thresholds can be set by the user other set automatically.

- Custom price thresholds can be set using the `price_thresholds` parameter.
- If not specified, thresholds are automatically determined based on the data.

**Predict sales**

```
predict_sales(your_sales_data,
new_data, # new sales data to base the predictions on
Expand All @@ -65,12 +76,14 @@ predict_sales(your_sales_data,
target = 'Quantity',
date_feature = 'InvoiceDate')
```
The `predict_sales` returns a DataFrame with prediction values, and a printed out MSE score.

The `predict_sales()` function returns a DataFrame with prediction values, and a printed out MSE score.

## Developer notes:
### Running The Tests

Run the following command in the terminal from the project's root directory to execute the tests:

```bash
pytest tests/
```
Expand Down

0 comments on commit fb88d52

Please sign in to comment.