Coverage for jstark/features/customer_count.py: 100%
12 statements
« prev ^ index » next coverage.py v7.4.3, created at 2024-02-25 20:09 +0000
« prev ^ index » next coverage.py v7.4.3, created at 2024-02-25 20:09 +0000
1"""CustomerCount feature"""
2import pyspark.sql.functions as f
3from pyspark.sql import Column
5from .distinctcount_feature import DistinctCount
8class CustomerCount(DistinctCount):
9 def column_expression(self) -> Column:
10 return f.col("Customer")
12 @property
13 def description_subject(self) -> str:
14 return "Distinct count of Customers"
16 @property
17 def commentary(self) -> str:
18 return (
19 "The number of customers. Typically the dataframe supplied "
20 + "to this feature will have many transactions for many baskets each bought"
21 + " a different customer, this feature allows you to determine how many "
22 + "disinct customerss bought those baskets."
23 )