Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(workflows) Decide whether to put algorithm in Seer or Sentry #1987

Open
Mitan opened this issue Feb 24, 2025 · 1 comment
Open

(workflows) Decide whether to put algorithm in Seer or Sentry #1987

Mitan opened this issue Feb 24, 2025 · 1 comment
Assignees

Comments

@Mitan
Copy link
Member

Mitan commented Feb 24, 2025

Sentry:
Pros:

  • No need to make extra API calls to Seer
  • Easier to re-use for other projects

Cons:

  • Need to bring extra dependencies into Sentry or re-create everything in pure python

Seer:
Pros:

  • Easier to implement (access to all python libraries)

Cons:

  • Extra API call to Seer every time (latency, reliability)
@Mitan Mitan self-assigned this Feb 24, 2025
@Mitan
Copy link
Member Author

Mitan commented Feb 24, 2025

Libraries in order of importance

  1. pandas for data manipulation. Pandas is needed for re-indexing and sorting the data:
distribution = pd.Series({item.get('label', 'value_missing'): item['value'] for item in attr['buckets']})
distribution.reindex(all_keys, fill_value=0)

Computing entropies, KL and sorting the values:

df_results = pd.DataFrame(attrs, columns=['attribute', 'KL score'])
df_results = df_results[df_results['KL score'] > alpha_kl]
df_results['entropy'] = df_results['attribute'].apply(lambda x: entropy(normalized_outlier[x]))
return df_results.sort_values(by='entropy', ascending=True).head(top_k)
  1. . scipy (Scipy has numpy as a dependency). The potentially can be implemented manually.
from scipy.stats import entropy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant