What is wrong with this script? I got stuck here. I need your contributions.
#split the targets into training/testing sets using LeaveOneOut
192 sets as training and 1 set as testing
data = LeaveOneOut()
data.get_n_splits (np_all)
results_hansen_d_pred_lasso =
for train_index, test_index in data.split(np_all):
#print ("TRAIN:", train_index, "TEST:", test_index)
np_all_train, np_all_test = np_all[train_index], np_all[test_index]
hansen_d_train, hansen_d_test = hansen_d[train_index], hansen_d[test_index]
#print(np_fps_train, np_fps_test, hansen_d_train, hansen_d_test)
# we can only use predic on data that is of the same dimensionality
# as the training data was. When we want to predict using new value
# using just one row, that row has to be reshaped to be part of another array.
np_all_test_reshape = np.array(np_all_test)
np_all_test_reshape = np_all_test_reshape.reshape (1,-1)
alpha = 0.1
lasso = Lasso(alpha=alpha)
hansen_d_pred_lasso = lasso.fit(np_all_train, hansen_d_train).predict(np_all_test_reshape)
results_hansen_d_pred_lasso.append(hansen_d_pred_lasso[0])
print (hansen_d_pred_lasso)