Created
January 4, 2020 23:34
-
-
Save kperry2215/d91cba02da5d4f89248331e90103d20a to your computer and use it in GitHub Desktop.
This file contains hidden or 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 time_series_train_test_split(time_series, train_split_fraction): | |
""" | |
Split the data into training and test set. | |
""" | |
split_index = int(round(time_series.shape[0]*train_split_fraction, 0)) | |
train_set = time_series[:split_index] | |
test_set = time_series[:-split_index] | |
return train_set, test_set | |
### EXECUTE IN MAIN FUNCTION ### | |
training_set, test_set = time_series_train_test_split(time_series = df['Geothermal_net_generation'], | |
train_split_fraction = .75) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment