Posts

Showing posts from April, 2025

ann

prac  Group B -  2. Write a python program to illustrate ART neural network. class ART1:     def __init__(self,threshold=0.7):         self.threshold=threshold         self.cluster=[]     def match(self,pattern,cluster):         if sum(pattern)==0:             return false         match_score=sum(map(min,pattern,cluster))/sum(pattern)         return match_score>=self.threshold     def train(self,data):         for pattern in data:             for i,cluster in enumerate(self.cluster):                 if self.match(pattern,cluster):                     self.cluster[i]=[min(p,c) for p,c in zip(pattern,cluster)]                     br...

DS prac

 1) Data Wrangling, I import pandas as pd import numpy as np import matplotlib.pyplot as plt import seaborn as sns ----------------------------------------------------- df = pd.read_csv("C:\\Users\\isham\\Downloads\\archive (4)\\train.csv")  # Assuming file is in the same directory df.head() ---------------------------------------------------- df.isnull().sum() -------------------------------------------------- df.describe() ------------------------------------------------ df.shape -------------------------------------- df.dtypes --------------------------------- df['Pclass'] = df['Pclass'].astype('category') df['Sex'] = df['Sex'].astype('category') df['Embarked'] = df['Embarked'].astype('category') ------------------------------------------------------ pd.get_dummies(df, columns=['pclass'], drop_first=True).head() ----------------------------------------------------- 2) Data Wrangling II  import ...