我正在对数据集使用线性回归算法。并尝试计算 y_pred 和 y_test 之间的混淆矩阵。我收到"ValueError : continuous is not supported"错误。
我已经包含了下面的代码。帮助解决这个问题。
x = data_set.iloc[:, :-1].values
y = data_set.iloc[:, 7].values
x_train, x_test, y_train, y_test = train_test_split(x, y, test_size = 0.25, random_state = 0)
from sklearn.linear_model import LinearRegression
from sklearn.metrics import confusion_matrix
regression = LinearRegression()
regression.fit(x_train, y_train)
y_pred = regression.predict(x_test)
cm = confusion_matrix(y_test, y_pred)