def create_split(folder, input_path='user_item_matrix.pkl', ouput_path='user_item', cut_dump=10):
    '\n    Loads the horizontal user item data from folder and creates a user-wise a 70% train, 20% validation, 10% test split.\n    This means for each user the first 70% read articles are in the train the next 20% in validation and the last 10%\n    read articles in the test set. We remove users with less than 10 clicked articles.\n    This is the data that is loaded to train/test the models in the end.\n    '
    now = datetime.datetime.now()
    user_item = pd.read_pickle(f'{folder}/{input_path}')
    user_item = user_item[(user_item.str.len() > cut_dump)]
    user_item_train = user_item.apply((lambda x: x[:int((len(x) * 0.7))]))
    user_item_test = user_item.apply((lambda x: x[int((len(x) * 0.7)):int((len(x) * 0.9))]))
    user_item_validation = user_item.apply((lambda x: x[int((len(x) * 0.9)):]))
    user_item_train.name = 'article_id'
    user_item_test.name = 'article_id'
    user_item_validation.name = 'article_id'
    user_item_train.to_pickle(f'{folder}/{ouput_path}_train.pkl')
    user_item_test.to_pickle(f'{folder}/{ouput_path}_test.pkl')
    user_item_validation.to_pickle(f'{folder}/{ouput_path}_validation.pkl')
    print(f'Split created {(datetime.datetime.now() - now)}')
Loads the horizontal user item data from folder and creates a user-wise a 70% train, 20% validation, 10% test split.
This means for each user the first 70% read articles are in the train the next 20% in validation and the last 10%
read articles in the test set. We remove users with less than 10 clicked articles.
This is the data that is loaded to train/test the models in the end.
def create_split(folder, input_path='user_item_matrix.pkl', ouput_path='user_item', cut_dump=10):
    '\n    Loads the horizontal user item data from folder and creates a user-wise a 70% train, 20% validation, 10% test split.\n    This means for each user the first 70% read articles are in the train the next 20% in validation and the last 10%\n    read articles in the test set. We remove users with less than 10 clicked articles.\n    This is the data that is loaded to train/test the models in the end.\n    '
    now = datetime.datetime.now()
    user_item = pd.read_pickle(f'{folder}/{input_path}')
    user_item = user_item[(user_item.str.len() > cut_dump)]
    user_item_train = user_item.apply((lambda x: x[:int((len(x) * 0.7))]))
    user_item_test = user_item.apply((lambda x: x[int((len(x) * 0.7)):int((len(x) * 0.9))]))
    user_item_validation = user_item.apply((lambda x: x[int((len(x) * 0.9)):]))
    user_item_train.name = 'article_id'
    user_item_test.name = 'article_id'
    user_item_validation.name = 'article_id'
    user_item_train.to_pickle(f'{folder}/{ouput_path}_train.pkl')
    user_item_test.to_pickle(f'{folder}/{ouput_path}_test.pkl')
    user_item_validation.to_pickle(f'{folder}/{ouput_path}_validation.pkl')
    print(f'Split created {(datetime.datetime.now() - now)}')