#NoPayJan Offer - Access all CloudxLab Courses for free between 1st to 31st JanEnroll Now >>
Let us split the
closing_stock into 3 parts, for training, validation, and testing purposes.
Let us have 80% of the data in the train set, 10% in the validation set, and the remaining 10% in the test set.
Copy-paste the following to get the lengths of each set.
n_train = int(len(closing_stock) * 0.80) n_remaining = len(closing_stock) - n_train n_val = int(n_remaining*0.50) n_test = n_remaining - n_val print("Train samples:",n_train, "Validation Samples:",n_val,"Test Samples:", n_test)
Now, slice the
closing_stock from 0 till
n_train to form the
train_data = closing_stock[0:n_train] print(train_data.shape)
Similarly, slice the
n_train+n_val to form the
val_data, the validation set.
val_data = closing_stock<< your code comes here >> print(val_data.shape)
Very similarly, slice the
n_train+n_val till the end to form the
test_data = closing_stock<< your code comes here >> print(test_data.shape)
No hints are availble for this assesment
Answer is not availble for this assesment
Note - Having trouble with the assessment engine? Follow the steps listed here