I am trying to run a leave-one-one kfold validation on a linear regression model I have but keep getting errors with my script leaving with nan values at the end. x7 is my true values and y7 is my modeled values. Why do I keep getting an error at the end?
from sklearn.model_selection import train_test_split
from sklearn.model_selection import KFold
from sklearn.model_selection import cross_val_score
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
x7 =np.array([16.36,24.67,52.31,87.31,3.98,63.45,40.47,35.67,52.12,9.39,57.61,35.77,113.1])
a=np.reshape(x7, (-1,1))
y7 = np.array([19.678974,4.824257,75.617537,62.587548,40.287506,76.576852,38.777129,29.062245
,50.088907,34.415783,46.466144,44.848378,68.988740])
b=np.reshape(y7, (-1,1))
a_train, a_test, b_train, b_test = train_test_split(x7, y7, test_size=12,
random_state=None)
train_test_split(b, shuffle=True)
kfolds = KFold(n_splits=13, random_state=None)
model = LinearRegression()
score = cross_val_score(model, a, b, cv=kfolds)
print(score)