Coverage for jstark/features/basket_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"""BasketCount feature"""
2import pyspark.sql.functions as f
3from pyspark.sql import Column
5from .distinctcount_feature import DistinctCount
8class BasketCount(DistinctCount):
9 def column_expression(self) -> Column:
10 return f.col("Basket")
12 @property
13 def description_subject(self) -> str:
14 return "Distinct count of Baskets"
16 @property
17 def commentary(self) -> str:
18 return (
19 "The number of baskets. Typically the dataframe supplied "
20 + "to this feature will have many transactions for the same basket, "
21 + "this feature allows you to determine how many shopping baskets "
22 + "existed in that collection of transactions."
23 )