Commit 8f5ee017 authored by Sascha Herzinger's avatar Sascha Herzinger
Browse files

removed correlation computation for subsets

parent 658b3b02
......@@ -54,12 +54,7 @@ class CorrelationTask(AnalyticTask):
df = apply_subsets(df=df, subsets=subsets)
df = apply_categories(df=df, categories=categories)
global_stats = self.compute_stats(df, method)
subset_dfs = [df[df['subset'] == i] for i in range(len(subsets) or 1)]
subset_stats = [self.compute_stats(subset_df, method)
for subset_df in subset_dfs]
output = global_stats
output['subsets'] = subset_stats
output['method'] = method
output['data'] = df.to_json(orient='records')
output['x_label'] = x_label
......
......@@ -28,7 +28,6 @@ class TestCorrelation:
assert result['p_value'] == 0
assert result['slope']
assert result['intercept']
assert result['subsets']
assert result['method'] == 'pearson'
assert result['data']
assert result['x_label'] == 'foo'
......@@ -115,8 +114,3 @@ class TestCorrelation:
subsets=[[101], [102, 104], [103], []],
categories=[])
assert not np.isnan(result['coef'])
assert len(result['subsets']) == 4
assert np.isnan(result['subsets'][0]['coef'])
assert not np.isnan(result['subsets'][1]['coef'])
assert np.isnan(result['subsets'][2]['coef'])
assert np.isnan(result['subsets'][3]['coef'])
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment