Minor updates based on comments
@@ -226,7 +226,7 @@ class Experiment(object):
'segment': str(bin.representation)}
subgroup_data = bin(self.data, feature)
- if self._isNotValidForAnalysis(subgroup_data):
+ if not self._isValidForAnalysis(subgroup_data):
continue
subgroup_res = self._delta(method='fixed_horizon', data=subgroup_data,
@@ -236,20 +236,20 @@ class Experiment(object):
return subgroups
- def _isNotValidForAnalysis(self, df):
+ def _isValidForAnalysis(self, df):
"""
Check whether the quality of data is good enough to perform analysis.
- This can be 1. there is no data
+ Invalid cases can be 1. there is no data
2. the data does not contain all the variants to perform analysis
:param df: data in the format of pandas dataframe
:return: boolean
"""
if df is None:
- return True
+ return False
for variant_name in self.variant_names:
if len(df[df["variant"] == variant_name]) < 1:
- return True
return False
+ return True
def sga_date(self, multi_test_correction=False):
"""
