What is ABC Classification?
ABC classification is an inventory categorization method based on the Pareto Principle (80/20 rule). It divides products into three categories based on their contribution to total sales revenue:Category A
Top 70% of revenueHigh-value items requiring close monitoring and tight inventory control
Category B
Next 20% of revenue (70-90%)Moderate-value items with standard control procedures
Category C
Bottom 10% of revenue (90-100%)Low-value items with minimal control requirements
Implementation Algorithm
The ABC classification is implemented inanalisis.py using the following algorithm:
Step-by-Step Process
Calculate Cumulative Percentage
For each product, calculate the cumulative percentage of total sales revenue
Source Code
Here’s the actual implementation fromanalisis.py:
Thresholds and Parameters
Products contributing to the top 70% of cumulative revenueThese are your most valuable items — typically 10-20% of total SKUs
Products contributing between 70% and 90% of cumulative revenueModerate-value items — typically 20-30% of total SKUs
Products contributing to the final 10% of cumulative revenueLow-value items — typically 50-70% of total SKUs
Business Logic
Why ABC Classification Matters
Inventory Optimization
Inventory Optimization
Focus resources on high-value items (Category A) that drive the majority of revenue, while minimizing effort on low-value items (Category C)
Stock Control Policies
Stock Control Policies
- Category A: Daily monitoring, precise forecasting, small safety stock
- Category B: Weekly monitoring, moderate safety stock
- Category C: Monthly monitoring, higher safety stock acceptable
Purchasing Decisions
Purchasing Decisions
Prioritize replenishment orders for Category A items to prevent stockouts of high-revenue products
Use Cases
Example 1: Identifying Critical Products
Example 2: Resource Allocation
Real Code Example
Here’s how the classification is used in the main pipeline (main.py:17):
Output Columns
Theclasificacion_abc() function adds two new columns to the DataFrame:
Cumulative percentage of total sales (0.0 to 1.0)Example: 0.45 means this product and all higher-selling products account for 45% of total revenue
Assigned category: “A”, “B”, or “C”Based on cumulative percentage thresholds
Performance Considerations
- Time Complexity: O(n log n) due to sorting
- Space Complexity: O(n) for cumulative sum calculation
- Suitable for datasets with up to 100,000+ SKUs