我创建了一个带有数字输入和单个分类输出的ANN,这是一个热门编码为19个类别中的1个.我将输出图层设置为19个单位.我现在不知道如何执行混淆矩阵,也不知道如何根据这个而不是单个二进制输出来执行classifier.predict().我不断收到错误消息称分类指标无法处理连续多输出和多标签指标目标的混合.不知道如何继续.
#Importing Datasets
dataset=pd.read_csv('Data.csv')
x = dataset.iloc[:,1:36].values # lower bound independent variable to upper bound in a matrix (in this case only 1 column 'NC')
y = dataset.iloc[:,36:].values # dependent variable vector
print(x.shape)
print(y.shape)
#One Hot Encoding fuel rail column
from sklearn.preprocessing import LabelEncoder, OneHotEncoder
labelencoder_y= LabelEncoder()
y[:,0]=labelencoder_y.fit_transform(y[:,0])
onehotencoder= OneHotEncoder(categorical_features=[0])
y = onehotencoder.fit_transform(y).toarray()
print(y[:,0:])
print(x.shape)
print (y.shape)
#splitting data into Training and Test Data
from sklearn.model_selection import train_test_split
x_train, x_test, y_train, y_test = train_test_split(x,y,test_size=0.1,random_state=0)
#Feature Scaling
from sklearn.preprocessing import StandardScaler …Run Code Online (Sandbox Code Playgroud)