Beispiel #1
0
def test_input():
	S = system_2.sys_2(t_delta_init=datetime.timedelta(seconds=1))
	L = S.layers[0]
	C = L.cluster_spaces[0]
	I = L.add_input()
	I.attach(C)
	I.add( observation_base(val=5,t=datetime.datetime.now() ) )
	I.add( observation_base(val=6,t=datetime.datetime.now() ) )
	I.add( observation_base(val=7,t=datetime.datetime.now() ) )
	t_val = datetime.datetime.now()
	I.add( observation_base(val=8,t=t_val ) )
	I.add( observation_base(val=9,t=datetime.datetime.now() ) )
	I.add( observation_base(val=9,t=datetime.datetime.now() ) )
Beispiel #2
0
def test_function():
	K = svm.kernel(gamma=.05,sigma_q=.25)
	l = observation_list_base()
	test_t = datetime.datetime.now()
	l.append( observation_base(val=5,t=test_t ) )
	l.append( observation_base(val=6,t=datetime.datetime.now() ) )
	l.append( observation_base(val=7,t=datetime.datetime.now() ) )
	l.append( observation_base(val=8,t=datetime.datetime.now() ) )
	l.append( observation_base(val=9,t=datetime.datetime.now() ) )
	l.append( observation_base(val=9,t=datetime.datetime.now() ) )
	
	F = svm.function_svm(l,K)
	assert F.equality_check(), F.equality_check()
	assert abs( F.reg(test_t) - 5) < .001
	assert len(F.SV) <= 6
Beispiel #3
0
def test_kernel():
	K = svm.kernel(gamma=.05,sigma_q=.25)
	l = observation_list_base()
	l.append( observation_base(val=5,t=datetime.datetime.now() ) )
	l.append( observation_base(val=6,t=datetime.datetime.now() ) )
	l.append( observation_base(val=7,t=datetime.datetime.now() ) )
	l.append( observation_base(val=8,t=datetime.datetime.now() ) )
	l.append( observation_base(val=9,t=datetime.datetime.now() ) )
	l.append( observation_base(val=9,t=datetime.datetime.now() ) )
	
	K.load(l)
	
	assert K.x
	assert K.y
	assert K.xx
	assert K.yy
	assert K.intg
	assert K.l == 6
	assert K.xx.size == (K.l,K.l)
	assert K.yy.size == (K.l,K.l)
	assert K.intg.size == (K.l,K.l)
	assert K.xy(1,2)