Skip to content

Instantly share code, notes, and snippets.

@aficionado
Created January 7, 2014 18:55
Show Gist options
  • Save aficionado/8304590 to your computer and use it in GitHub Desktop.
Save aficionado/8304590 to your computer and use it in GitHub Desktop.
# Dataset with historical data
dataset = ‘dataset/52cb5ac7035d072695000bc6’
# Source data of day i
source_day_i = api.create_source(“day-i.csv”)
dataset_day_i = api.create_dataset(source_day_i)
# Test for covariate shift
if not detect_shfit(dataset, dataset_day_i,
training_sample_size, daily_data_sample_size, trials):
# Merge new data, keep previous model
dataset = api.create_dataset([dataset, dataset_day_i])
else:
# Take further actions e.g., update model or ensemble
raise PotentialShiftDetected
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment