同事,不要告诉我可能是什么问题:
我正在尝试训练一个模型来预测公司的违约情况。有一个包含 100,000 家公司和 37 个特征的数据集。
将数据集拆分为训练和测试
from sklearn.model_selection import train_test_split
train, test = train_test_split(df_findataset, test_size=0.2)
X_train = train.iloc[:,0:36]
Y_train = train.iloc[:,-1] # (0 - нет дефолта, 1- дефолтная компания)
x_test = test.iloc[:,0:36]
y_test = test.iloc[:,-1]
创建了一个模型:
x_train = tf.keras.utils.normalize(x_train, axis=1)
x_test = tf.keras.utils.normalize(x_test, axis=1)
model = tf.keras.models.Sequential()
model.add(tf.keras.layers.Dense(50, input_dim=36, activation='relu'))
model.add(tf.keras.layers.Dense(2, activation='relu'))
model.add(tf.keras.layers.Dense(1, activation='sigmoid'))
model.compile(loss='binary_crossentropy', optimizer='adam', metrics=['accuracy'])
model.fit(x_train, y_train, epochs=10, batch_size=10)
训练时,发出以下内容 - 一切都一样:(
Epoch 1/10
108960/108960 [==============================] - 14s 125us/step - loss: 0.1534 - acc: 0.9645
Epoch 2/10
108960/108960 [==============================] - 13s 123us/step - loss: 0.1534 - acc: 0.9645
Epoch 3/10
108960/108960 [==============================] - 14s 125us/step - loss: 0.1534 - acc: 0.9645
Epoch 4/10
108960/108960 [==============================] - 14s 131us/step - loss: 0.1534 - acc: 0.9645
Epoch 5/10
108960/108960 [==============================] - 15s 139us/step - loss: 0.1534 - acc: 0.9645
Epoch 6/10
108960/108960 [==============================] - 15s 136us/step - loss: 0.1534 - acc: 0.9645
Epoch 7/10
108960/108960 [==============================] - 15s 139us/step - loss: 0.1534 - acc: 0.9645
Epoch 8/10
108960/108960 [==============================] - 16s 143us/step - loss: 0.1534 - acc: 0.9645
Epoch 9/10
108960/108960 [==============================] - 14s 129us/step - loss: 0.1534 - acc: 0.9645
Epoch 10/10
108960/108960 [==============================] - 15s 140us/step - loss: 0.1534 - acc: 0.9645
Out[152]:
<tensorflow.python.keras.callbacks.History at 0x7fed4cb9feb8>
告诉我它可能与什么相关联:(((数据似乎已被尽可能多地清理(尽我所能:())
试试这样:
教育:
考试: