Page 1 of 1

MI classified output with Hyperplane distance

Posted: Thu May 19, 2022 6:17 pm
by harithhansaka
I'm using the MI-CSP replay scenario. To get classified output to python, I've used chunk hyperplane values. But problem is, in both directions, those values are positive. To identify the direction, one direction should get positive and the other should get negative?

https://ibb.co/42WSC08
https://ibb.co/VJ0YhKm
https://drive.google.com/file/d/1R9HExD ... sp=sharing
https://drive.google.com/file/d/159lSVe ... sp=sharing

Thank you,
BR,
Harith

Re: MI classified output with Hyperplane distance

Posted: Mon May 23, 2022 9:04 am
by Thomas
Hi Harith,

To identify the direction using the values provided in by the hyperplane output of the processor, you can do the following:

Code: Select all

if (len(chunk) == 2):
	v1 = int(chunk[0])
	v2 = int(chunk[1])
	sum = v1 +v2
	// if sum = 0, neither left or right
	if (sum == 0):
		res = 0
	else:
		res = v2/sum - v1/sum
		
	if(res > 0):
		print("Right")
	if(res <):
		print("Left")
	else:
		return
I haven't tested it, but the logic is here.

Hope this helps,
Thomas

Re: MI classified output with Hyperplane distance

Posted: Wed Jun 29, 2022 4:41 am
by harithhansaka
Thank you Thomas.