View decision_tree_root_cause.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import graphviz | |
import pandas as pd | |
import numpy as np | |
import sklearn.impute | |
import sklearn.tree | |
# Load the data from disk | |
df_good = pd.read_csv("~/Downloads/good_data_sample.csv") | |
df_bad = pd.read_csv("~/Downloads/bad_data_sample.csv") |
View pivot_sql_example.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
This is an example python class that can be used to create SQL that will pivot data SQL | |
query-able database (such as Redshift). | |
Note that it uses an Anomalo library, dquality.db, which is not open-sourced. However, | |
you can replace the calls to self.db and DB with the appropriate calls for your warehouse | |
to construct and execute SQL queries. | |
""" | |
import logging |
View retry.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import functools | |
import logging | |
class RetryTest: | |
""" | |
Decorator for re-trying flickering tests multiple times | |
to attempt to get them to pass. | |
Note that it creates a new copy of the test class for each |