我正在尝试使用 D3.js 创建一个 Chord Diagram 来显示不同客户和供应商之间的关系,但是在运行页面时我不断收到以下错误,这是我的代码:
未捕获的类型错误:d3.queue 不是 chord.html:47 的函数
d3.queue()
.defer(d3.json, 'NewData/Client_Supplier-matrix.json')
.defer(d3.csv, 'NewData/Client_Supplier.csv')
.await(function(err, matrix, mmap) {
if (err) console.log(err);
_.each(mmap, function (d, i) { d.id=i; d.data=d.color })
drawChords(matrix, mmap);
});
Run Code Online (Sandbox Code Playgroud) 我正在使用 Keras 来预测我是否会得到 1 或 0 的输出。数据如下所示:
funded_amnt emp_length avg_cur_bal num_actv_rev_tl loan_status
10000 5.60088 19266 2 1
13750 5.60088 2802 6 0
26100 10.0000 19241 17 1
Run Code Online (Sandbox Code Playgroud)
目标是loan_status,特征是剩余的。在开始构建神经网络模型之前,我已经对数据进行了标准化。
这是我的训练和测试数据的形状:
print(X_train.shape,Y_train.shape)
# Output: (693, 4) (693,)
print(X_test.shape,Y_test.shape)
# Output: (149, 4) (149,)
Run Code Online (Sandbox Code Playgroud)
我构建神经网络的过程是:
# define the keras model
model = Sequential()
model.add(Dense(4, input_dim=4,activation='relu'))
model.add(Dense(4 ,activation='relu'))
model.add(Dense(1,activation='sigmoid'))
# compile the keras model
model.compile(loss='binary_crossentropy', optimizer='adam', metrics=['accuracy'])
# fit the keras model on the dataset
hist = model.fit(X_train, Y_train, epochs=10, batch_size=2)
Run Code Online (Sandbox Code Playgroud)
运行后输出 …