我尝试在模型上使用cross_val_score,但出现以下错误:
Dim arrival As Date = CDate(txtArrivalDate.Text)
Dim Departure As Date = CDate(txtDepartureDate.Text)
Dim Days As Long = DateDiff(DateInterval.Day, arrival, Departure)
Dim Total As Long = 160 * Days
Dim Day As Date = arrival
While (Day <= Departure)
If CBool(Day.DayOfWeek.Friday And Day.DayOfWeek.Saturday) Then
Total += 180
End If
Day = Day.AddDays(1)
End While
这是我的模特
Traceback (most recent call last):
File "/home/dinhnha1402/.local/lib/python2.7/site-packages/keras/wrappers/scikit_learn.py", line 210, in fit
return super(KerasClassifier, self).fit(x, y, **kwargs)
File "/home/dinhnha1402/.local/lib/python2.7/site-packages/keras/wrappers/scikit_learn.py", line 139, in fit
**self.filter_sk_params(self.build_fn.__call__))
TypeError: __call__() takes exactly 2 arguments (1 given)
我在任何地方(在Google上)都找不到此错误。是否有人对如何解决此问题有任何想法?
答案 0 :(得分:0)
只需放下“()”
那样:
分类器= KerasClassifier(build_fn = binary_classify_lstm_fc_model(),batch_size = 10,epochs = 100,verbose = 0)
======
分类器= KerasClassifier(build_fn = binary_classify_lstm_fc_model,batch_size = 10,epochs = 100,verbose = 0)
答案 1 :(得分:0)
只需将损失从categorical_crossentropy更改为mean_squared_error。