我正在使用这个库来实现学习代理.
我已经生成了培训案例,但我不确定验证和测试集是什么.
老师说:
70%应该是培训案例,10%是测试案例,其余20%应该是验证案例.
编辑
我有这个训练代码,但我不知道何时停止训练.
def train(self, train, validation, N=0.3, M=0.1):
# N: learning rate
# M: momentum factor
accuracy = list()
while(True):
error = 0.0
for p in train:
input, target = p
self.update(input)
error = error + self.backPropagate(target, N, M)
print "validation"
total = 0
for p in validation:
input, target = p
output = self.update(input)
total += sum([abs(target - output) for target, output in zip(target, output)]) #calculates sum of absolute diference between …Run Code Online (Sandbox Code Playgroud) 我在几毫秒内收到SOAP服务的时间戳.所以我这样做:
Date date = new Date( mar.getEventDate() );
Run Code Online (Sandbox Code Playgroud)
我如何从日期中提取当月的日期,因为这些方法已Date::getDay()被弃用?
我正在使用一个小黑客,但我不认为这是获得一天的正确方法.
SimpleDateFormat sdf = new SimpleDateFormat( "dd" );
int day = Integer.parseInt( sdf.format( date ) );
Run Code Online (Sandbox Code Playgroud) HashMap selections = new HashMap<Integer, Float>();
Run Code Online (Sandbox Code Playgroud)
如何在所有HashMap中获取Float的第3个较小值的Integer键?
为此使用HashMap 编辑即时消息
for (InflatedRunner runner : prices.getRunners()) {
for (InflatedMarketPrices.InflatedPrice price : runner.getLayPrices()) {
if (price.getDepth() == 1) {
selections.put(new Integer(runner.getSelectionId()), new Float(price.getPrice()));
}
}
}
Run Code Online (Sandbox Code Playgroud)
我需要第3个较小价格的跑步者,深度为1
也许我应该以另一种方式实现这一点?