CountBaselineRows#
from tmlt.tune import CountBaselineRows
- class tmlt.tune.CountBaselineRows(*, name=None, description=None, baseline=None, output=None, grouping_columns=None)#
Bases:
SingleOutputMetric
Computes the number of rows in the baseline output.
If grouped, will return a count for every group that appears in either the DP or baseline output.
Example
>>> dp_df = spark.createDataFrame( ... pd.DataFrame( ... { ... "A": ["a1", "a2", "a3"], ... "X": [50, 110, 100] ... } ... ) ... ) >>> dp_outputs = {"O": dp_df} >>> baseline_df = spark.createDataFrame( ... pd.DataFrame( ... { ... "A": ["a1", "a2", "a3", "b"], ... "X": [100, 100, 100, 50] ... } ... ) ... ) >>> baseline_outputs = {"default": {"O": baseline_df}}
>>> metric = CountBaselineRows() >>> metric(dp_outputs, baseline_outputs).value 4
- count_baseline_rows(dp_output, baseline_output, result_column_name)#
Counts the number of baseline rows.