
<SYSTEM_TASK:>
Given the following text problem statement, write Python code to implement the functionality described below in problem statement
<END_TASK>
<USER_TASK:>
Problem:
Sklearn Stratified K-Fold - Splitting Data & Saving to File

<ASSISTANT_TASK:>
Python Code::
import pandas as pd
from sklearn.model_selection import StratifiedKFold
df = pd.read_csv('data/raw/train.csv')
# initialise a StratifiedKFold object with 5 folds and
# declare the column that we which to group by which in this
# case is the column called "label"
skf = StratifiedKFold(n_splits=5)
target = df.loc[:,'label']
# for each fold split the data into train and validation 
# sets and save the fold splits to csv
fold_no = 1
for train_index, val_index in skf.split(df, target):
    train = df.loc[train_index,:]
    val = df.loc[val_index,:]
    train.to_csv('data/processed/folds/' + 'train_fold_' + str(fold_no) + '.csv')
    val.to_csv('data/processed/folds/' + 'val_fold_' + str(fold_no) + '.csv')
    fold_no += 1

<END_TASK>
