New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

abc-classification

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

abc-classification

A package for ABC classification

  • 0.8
  • PyPI
  • Socket score

Maintainers
1

ABC classification library

ABC classification is an inventory categorisation technique. A typical example of ABC classification is the segmentation of products (entity) based on sales (value). The best-selling products that contribute to up to 70% of the total sales belong to cluster A. The products making up the next 20% of sales are in cluster B, whereas the products representing the last 10% of sales, belong to class C. Hence, the pattern is named after the three clusters (ABC).

Example

Installation

pip install abc-classification

Import

from abc_classification.abc_classifier import ABCClassifier

Let's say we have dataframe

producttotal sold
fade cream27000
powders24000
shadows18000
mascara16000
lipstick6000
concealer5000
sculptors4000

You can create ABCClasifier object, pass your dataframe to it and call classify method.

abc_clf = ABCClassifier(df)
abc_df = abc_clf.classify('product', 'total sold')

This way you'll get new dataframe with classified products.

producttotal soldclass
fade cream27000A
powders24000A
shadows18000A
mascara16000B
lipstick6000B
concealer5000C
sculptors4000C

You also can use brief_abc method to get aggregated information

abc_clf.brief_abc(abc_df)
classtotal sold
A69000
B16000
C15000

You can plot pareto chart.

from abc_classification.abc_visualiser import pareto_chart


pareto_chart(abc_df, 'total_sold', 'product')

Pareto chart

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc