Unable to Use The K-Fold Validation Sklearn Python I have an dataset.
I am unable to use the K-Fold Validation. I am getting the error raised:

ValueError(&quot;{0} is not supported&quot;.format(y_type))
ValueError: continuous is not supported .

I do not want to do encoding to int, since it may affect the data, and also I want to understand why K-fold is not working.
Below is my python code.
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from sklearn.ensemble import RandomForestRegressor
from sklearn import cross_validation, metrics
from sklearn.cross_validation import train_test_split
from sklearn import model_selection
from sklearn.metrics import classification_report
from sklearn.metrics import confusion_matrix
from sklearn.metrics import accuracy_score
from sklearn.linear_model import LogisticRegression
from sklearn.tree import DecisionTreeClassifier
from sklearn.neighbors import KNeighborsClassifier
from sklearn.discriminant_analysis import LinearDiscriminantAnalysis
from sklearn.naive_bayes import GaussianNB

from sklearn import svm
from sklearn import preprocessing

 - `List item`

url = &quot;https://archive.ics.uci.edu/ml/machine-learning-databases/00242/ENB2012_data.xlsx&quot;
names=['Relative Compactness','Surface Area','Wall Area','Roof Area','Overall Height','Orientation','Glazing Area','Glazing Area Distribution','Heating Load','Cooling Load']
df = pd.read_excel(url,names=names)

#Feature selection
train=df.sample(frac=0.8,random_state=150)
test=df.drop(train.index)
 
#save the original values in a dataframe so we can compare later
test_loads=test[[&quot;Cooling Load&quot;]]
 
#Create 2 lists of response values to train our model
Y1=np.array(train['Heating Load'])
Y2=np.array(train['Cooling Load'])

#Select the features
train_corr=train[['Overall Height','Relative Compactness','Roof Area','Surface Area']]
test_corr=test[['Overall Height','Relative Compactness','Roof Area','Surface Area']]
seed = 7
scoring = 'accuracy'
X_train,X_test,y_train,y_test=cross_validation.train_test_split(train_corr,Y1,test_size=0.2)
kfold = model_selection.KFold(n_splits=10, random_state=seed) 
cv_results = model_selection.cross_val_score(RandomForestRegressor(), X_train, y_train, cv=kfold, scoring=scoring)
print (cv_results.mean())
Based on the answer here, Since you are doing a classification task, you should be using the metric R-squared (co-effecient of determination) instead of accuracy score (accuracy score is used for classification purposes). You should use something like score for evaluation because your task is regression.