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 numpy as np | |
import pandas as pd | |
def get_disk_holes(r, r_hole, n_hole, allow_center=True): | |
""" | |
Returns disks that are can be used to | |
cut data from a disk of radius `r` | |
""" | |
df = pd.DataFrame(columns=['r_hole', 'r', 'theta', 'x', 'y']) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
def get_pandas_df_for_counterfactual_prediction(df, | |
df_treatments, | |
id_column='customer_id', | |
suffix='_assigned'): | |
"""Returns a pandas dataframe prepared for counterfactual predictions | |
Args | |
df (pd.DataFrame): | |
The dataframe from which to prepare counterfactuals for | |
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
class SampleForwardChainCV(object): | |
def __init__(self, | |
dates, | |
obs_count, | |
min_start_date=None, | |
max_end_date=None, | |
n_min_train_obs=20, | |
n_min_validate_obs=20, | |
n_min_test_obs=20): |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.