To monitor an area of 100 miles by 50 miles about the pollution
of nuclear
radiation dust, Molly places 25 sensors in the area. Each sensor
measures ra-
diation and gives red signal if exceeding the safety threshold, or
gives green
signal if not exceeding the safety threshold. The coordinates of
sensors giving
green and red are listed beside the area map. Without taking
Statistical Infer-
ence or Machine Learning, Molly intends to identify the safe zone
(radiation
lower than the threshold), or the green zone contrary to the red
zone (radiation
larger than the threshold). Please use SVM to help Molly specify
green and
red zones.
ANSWER
Please find below the python code for problem
import pandas as pd
from sklearn import svm
data=pd.DataFrame({'x1':[4,7,13,21,28,34,44,56,65,69,77,82,10,14,19,29,31,32,45,61,65,71,77,89,92],
'x2':[45,12,28,3,43,16,40,8,44,28,14,43,7,20,37,11,41,27,19,36,15,39,31,9,42],
'y':[0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1] })
X=data.iloc[:,0:2]
Y=data.y
clf = svm.SVC()
clf.fit(X, Y)
To monitor an area of 100 miles by 50 miles about the pollution of nuclear radiation...