diff --git a/public/css/style.css b/public/css/style.css index 44929dd8..a952854e 100644 --- a/public/css/style.css +++ b/public/css/style.css @@ -2802,35 +2802,41 @@ button:disabled{ } #newsletter { - padding: 10px; - } + display: flex; + flex-direction: column; /* Arrange items vertically */ + height: auto; /* Allow height to adjust based on content */ + padding: 20px; /* Optional padding for spacing */ +} - #newsletter .news-text { - width: 50%; - } +#newsletter .news-text { + margin-bottom: 20px; /* Space between text and form */ +} - #newsletter .news-text h4 { - font-size: 18px; - } +#newsletter .news-text h4 { + font-size: 22px; +} - #newsletter .news-text p { - font-size: 16px; - } +#newsletter .news-text p { + font-size: 18px; +} - #newsletter .news-form { - width: 48%; - } +#newsletter .news-form { + display: flex; + flex-direction: column; + width: 100%; +} - #newsletter .news-form input { - padding: 0px 2px; - height: 20px; - font-size: 12px; - } +#newsletter .news-form input { + height: 2rem; + font-size: 14px; + margin-bottom: 10px; +} - #newsletter .news-form button { - font-size: 8px; - padding: 0px 6px; - } +#newsletter .news-form button { + width: 100%; + text-align: center; + font-size: 10px; + padding: 2px 6px; } @media (max-width: 400px) { diff --git a/tempCodeRunnerFile.python b/tempCodeRunnerFile.python new file mode 100644 index 00000000..6fbfc862 --- /dev/null +++ b/tempCodeRunnerFile.python @@ -0,0 +1,47 @@ +import math + +def classifyAPoint(points,p,k=3): + distance=[] + for group in points: + for feature in points[group]: + + #calculate the euclidean distance of p from training points + euclidean_distance = math.sqrt((feature[0]-p[0])**2 +(feature[1]-p[1])**2) + + # Add a tuple of form (distance,group) in the distance list + distance.append((euclidean_distance,group)) + + # sort the distance list in ascending order + # and select first k distances + distance = sorted(distance)[:k] + + freq1 = 0 + freq2 = 0 + + for d in distance: + if d[1] == 0: + freq1 += 1 + elif d[1] == 1: + freq2 += 1 + + return 0 if freq1>freq2 else 1 + +# driver function +def main(): + + + + points = {0:[(1,12),(2,5),(3,6),(3,10),(3.5,8),(2,11),(2,9),(1,7)], + 1:[(5,3),(3,2),(1.5,9),(7,2),(6,1),(3.8,1),(5.6,4),(4,2),(2,5)]} + + # testing point p(x,y) + p = (2.5,7) + + # Number of neighbours + k = 3 + + print("The value classified to unknown point is: {}".\ + format(classifyAPoint(points,p,k))) + +if __name__ == '__main__': + main()