Download as pdf
Download as pdf
You are on page 1of 13
ONIAZ UBLICATION? Course Code : MCSL-223, Course Title : Computer Networks and Data Mining Lab Assignment Number : MCA_NEW(II)/223/Assign/2023-24 Maximum Marks:100 i ei Weightage : 30% wnww.ignousite.com aon fH Last Dates for Submission : 31st October, 2023 (For July, 2023 Sessiort#ea=™ +15" April, 2024 (For January, 2024 Session) Note:-This assignment only for students, not for sell or re-upload ar media or website: Allightreserve to "IGNOU Study Helper’ itis egal to share or reupload it Farything like thsi found, then appropriate action wil be taken and apply copyright ACT to you. You wil be responsible for legal work. So don't share and upload on any med. PART-I: Computer Networks Q1: Create a simple network topology having two client nodes on left side and two server nodes on the tight side. Both clients are connected with another node nt. Similarly, both server node are connected to node n2. Also connect nodes ni and n2 thus formingia dumbbell shape topology. Use point to point link only. You can use any Network Simulator. Ans. can describe the topology you mentioned using Cisco Packet Tracer, which is a network simulation tool, Here's how you can create the fopology using point-to-point links? Topology Description: + Two client nodes (PC1 and PC2) on the left side. + Twoserver nodes (Server! and Server2) on the tightside + Acentral node (Node1) connecting PCI and PC2. + Another central node (Node?) connecting Serverl and Server2. + Nodet and Node2 are interconnected to form 2 dumbbell shape, Steps: 1. Open Cisco Packet Tracer and create a new project. # Create a simulator instance set ns [new Simulator] # Create nodes set client! [Sns node] set client? [Sns node] set servert [Sns node] set server? [ns node] set nt [$ns node} set n2 [$ns node} # Create links $ns duplexclink Selient1 $1 10Mb 10ms DropTail $ns duplexclink Sclient2 $n1 10Mb 10ms DropTail $s duplex-link $servert $2 10Mb 10ms DropTail $ns duplexing $server2 $n2 10Mb 10ms DropTail Ignou Study Help Sunil Poonia Page 1 ONIAZ UBLICATION?: $ns duplex-link Sn $n2 2Mb 20ms DropTail # Set the position of nodes (for visualization purposes) $ns duplex-link-op $client’ $nt orient right-down. $ns duplex-link-op $client2 $n1 orient right-up $ns duplexclink-op $server] $n2 orient left-down $ns duplex-link-op $server2 $n2 orient left-up $ns duplex-ink-op $n1 $n2 orient right #¥ Define a TCP agent and attach it to client and server nodes set tepl [new Agent/TCP] srv0y, Shs attach-agent Sclientd Step. * set sinkl [new Agent/TCPSink] $ns attach-agent Sserverd Ssinki $ns connect Step set tep2 new Agent/TCP] $ns attach-agemt Sellent2 $ccp2 set sink2 (ew Agent/TCPSink] $ns attach-agent Sserver2 Ssink2 $ns connect Step2 Ssink2 # Set up traffic Stepl set packetSize_ 1000 Step2 set packetSize_ 1000 set ftp [new Application/FTP] $ftp1 attach-agent $tcpt set ftp2 [new Application/FTP] $ftp2 attach-agent $tcp2 ff Schedule traffic Sns at 0.1 "Sftp1 start” Sns at 0.1 "Sftp2 start” # Define simulation end time $s at 5.0 "Sns helt” # Run the simulation $ns run 2. Drag and drop four "Generic" computers (PCs) onto the workspace. These will represent your client nodes and server nodes. 3. Connect the nodes as follows: Ignou Study Help Sunil Poonia Page 2 OONIAZ gest Tony Stuer Here UBLicaTion® EY sun Paauia * Conmect PCI to Nodet: Select PCI, elk the copper cros-over cable, and then liek Node + connect PC2 to Nodet: Select PC2, cick the conper crossover cable and then dik Nodet + Connect servers to Node2: Slet Serer, click the copper erss over cable, and then cick Node + Connect Server2 to Node2 Select Server, clk the copper crossover cable ard then ik Node? * Connect Node1 to Node?: Click the capper cross-aver cable, click Node1, and then click Node2. 4. Adjust 5. Save your projet and simulate the network to test connectivity between the nodes 1e layout of the nodes to resemble a dumbbell shape, PART-II: Data Mining Lab QA: Perform the following: a. Create an Exam_Results Table with the help of Data Mining Tool WEKA. Ans. WEKA (Waikato Environment for Knowledge Analysis) is a popular data mining and machine learning tool. However, it's not typically used for directly creating database tables. Instead, it's used for data preprocessing, analysis, modeling, and evaluation. Ifyou want to ereate an Exam_Results table in a database, you'd typically use 2 database management system (DBMS) ike MySQL, PostgreSQL, or SQLite. After cresting the table; you can use WEKA to perform data mining and analysis on the data stored in that teble, ev0y, Here's how you might go about creating the Evam_Results table using SQL in a DBMS Ike MysQu: 2 Rosey Sea eo subject VARCHAR(50), Pores This SQL statement creates a table named Exam_Results with columns for student_id, exam_date, subject, and score. You can then insert data into this table using SOL INSERT staternents. Once you have data in the Exam_Results table, you can use WEKA to load the data, preprocess it (if necessary), apply various data mining algorithms, and evaluate the results. WEKA provides a graphical user interface where you can import data, preprocess t, choose algorithms, configure parameters, and visualize results. Here's a general outline of what you can do In WEKA: Load Data: In the "Preprocess" tab, you can load your data from a CSV or other compatible format. Preprocess Data: You can clean the data, handle missing values, normalize attributes, and perform other preprocessing tasks. 3. Select Algorithms: in the "Classify" or "Cluster" tabs, you can choose from various classification or clustering, algorithms, Ignou Study Helper Page ONIAZ ‘eet Tonou Srp Wespee UBLICATIONS. ey SMe Paswia ‘4, Evaluate Models: WEKA allows you to evaluate the performance of your models using cross-validation, train-test sulis-entverbeeralisiny rete as Rasch Eocue ean ica ol nd dn nal lg bi a b. Apply Pre-Processing techniques to the training data set of Exam_Results Table. ‘Ans. let's assume you have a training dataset stored in a CSV file with columns student_id, exam_date, subject, and score. Here are some common pre-processing techniques you can apply to this dataset using WEKA: 1. Luad Data. Open WEKA, yo Lo Ure "Explore" Lal and lick Urn the bbuttun to ued your ©8V file et il eoe Weka Explorer _[Preprocess | clsssiy Filter choose | None Apply Current relation ‘Selected attribute Relation: Hone ‘Atributes: None Name: Nene ‘Type: None Instances: ‘Sum of weights: Missing Nene -Distiret: None-——_Unique: None Auributes (Autr Visualize Al \ status, Welcome to the Weka Explorer -_—° 2. Remove Irrelevant Attributes: If student_id and exam_date are not relevant for your analysis, you can remove them. Right-click on the attribute name in the "Attributes" panel and choose "Remove". f et 3. Handle Missing Values: ‘+ Inthe "Preprocess" tab, click on “Open file" to load your CSV file, A sn + Glick on the "ReplaceMissingValues" fiter and click “Apply”, This fiter replaces missing values with the mean (for numeric attributes) or the mode (for nominal attributes). 4. Normalize Numeric Attributes: Ignou Study Helper - Sunil Poonia Page 4 ONIAZ UBLICATION? ‘© Glick on the "Normalize" filter and click "Apply". This will norm standard deviation of 1 5. Encode Categorical Attributes: ‘+ ifsubjectis a categorical attribute, you can use the "StringToNominal” filter to convert it to a nominal attribute, lick on the filter and choose the attribute to convert. 6. Remove Duplicates: ‘+ Click on the "RemoveDuplicates" filter and click "Apply" to remove duplicate instances from your dataset. ilter Outliers: ‘+ You can use the "RemoveWithValues" filter to remove instances with outlier values. Specify a range of acceptable values for the score attribute, for example. 8 Binning (Discretization): + fyouwant to convert the score attribute to a nominal attribute with bins (e.g., Low, Medium, High), you can use the "Discretize” filter 9. Select Attributes (Feature Selectio ‘© You can ise filters like "InfoGainAttributeEval" or "CorrelationAttributeFval" to select a subset of relevant attributes. 10, Attribute Transformation: ‘+ Depending on your analysis, you might want to perforin transformations like logarithm or square root on certain attributes. Use filters like "MathExpression’ for this purpose, 11, Save Processed Data: ‘+ After applying the desired pre-processing steps, you car Save the processed dataset by clicking "Save" and choosing a file format (e.g., ARFF). numeric atributes to have a mean of O and ©. Normalize Exam_Results Table data usifig Knowledge Flow / any other similar tool, ‘Ans, 'll guide you through the process of normalizing the data in the Exam_Results table using WEKA's Knowledge Flow interface. This interface allows you to visually design and execute data preprocessing tasks. 1L. Launch WEKA: Open WEKA and choose the "Explorer* option from the main menu. 2. Load Data: * Glick on the "Gpen File" button under the "Preprocess" tab, ‘+ Navigate to and select your dataset file (e.g., CSV file containing Exam_Results data) '* Click "Open" to load the data . Create a Knowledge Flow: * Click on the "knowledge Flow" tab to switch to the Knowledge Flow interface, 4, Load Data into Knowledge Flow: ‘* Drag and drop the "Load ARFF/CSV" operator from the "Readers" category onto the workspace, © Connect the output of this operatar to the next one. Normalize Data: © Drag and drop the "Normalize" operator fram the "Filters" category onto the workspace. * Connect the output of the data loader to the input of the Normalize operator. Page 5S Touoy Srey HeLPee ons Sumit Pocus UBLICATIONS ‘+ Double-click on the Normalize operator to configure its parameters. 6. Save Normalized Data: * Drag and drop the "Save ARFF/CSV" operator from the "Writers" category onto the workspace ‘+ Connect the output of the Normalize operator to the input of the Save operator. * Double-click on the Save operator to specify where you want to save the normalized data and in which format (e.8., ARFE), 7. Run the Knowledge Flow: stuoy, '* Glick the "Run" button at the top to execute the Knowledge Flow. fs eat The data will be normalized and saved as per your configuration. Guy Rtg cae 08-03-23]hindi__ [pass __| 10-10-23] (09-05-23)english [pass | 11-10-23] 10-09-23|math pass | 12-10-23 Iso.sci. [fail 13-10-23] Iscience [pass | 14-10-23] [sanskrit [pass | 15-10-23] [urdu 16-10-23] (supw 1710-23] hindi sha 18-10-23] [elucture 19-10-23] eamdate [rubject | renuit ne g 1 2 3 la 5 6 7 3 3 30 d. To construct a Decision Tree for Exam_Results data and classify it. Note: Assumptions can be made wherever necessary. State them. Ans. I'll guide you through constructing a Decision Tree for the Exam_Results data using WEKA's Explorer interface. Please ‘note that this example assumes a simplified scenario for ilustration purposes. ‘Assumptions: 1. The Exam_Results data consists of columns: student_id, exam_date, subject, and score. 2. We want to predict whether a student will pass or fall based on the score attribute, 3. For simplicity, we'll consider a binary classification problem where a score of SO or above is considered a pass, and below 50 is fal Ignou Study Helper - Sunil Poonia Page 6 ONIAZ UBLICATIONS Here's how you can construct a Decision Tree: 11, Launch WEKA: Open WEKA and choose the "Explorer* option from the main menu. 2. Load Data: + Click on te “Open File" button under the "Presprocess Labs * Navigate to and select your dataset fle (e.g., CSV fle containing Exam_Results data), * Click “Open” to load the data, 3. Choose Classifier: + Goto the "Classify'tab, * Select the "s48" classifier (which implements the C4.5 algorithm, a Decision Tree algorithm). + Click “start” to configure the classifier. 4, Set Class Attribute: * In the"Test options" section, click the "More options" button. * Select the score attribute as the class attribute. _gruoy + chee'sar’tobuld he Deas tee ‘+The resulting Decision Tree will be displayed in the "Result list" panel, 5. Bulld the Decision Tree: 6. Classify New Instances: * Go back to the "Preprocess" tab. * Load a new dataset (or the same dataset If you want) with instances you want to classify * Select the *Classify* tab again. ‘* Load your trained Decision Tree model by clicking the "Load Motel" button and selecting the model file \e.g., J48 model file) 7. Classify instances: Click "start" to classify the instances using the Decision Tree. * The predictions will be displayed in the "Result list” panel. 8. Interpret Results: ‘= Examine the classification results and interpret the predictions. Output: Page7 ONIAZ UBLICATION? “*: Touou Stuer Heupea St Sunt Paonia Prewess HH [Chater Asseoate | eect attintes cate (Ghecee Joo-cos nz Testers ) se anny set Seas elaut sae Cotsectty Classified Tesuances Jnneseeerly Claseitie ogee seatzaric 4.2057 9 Parent os = Detailed Recusscy By Clase — enue ghrp) TPkace 12 Rate Freoizion esas €. Write a procedure for Visualization for Exam_Results Table. ‘Ans. This program calculates and has comparisons on the data set selectionof attributes and methods of manipulations have been chosen. The Visualization can be showin i'@ 2-D represehitation of the information. Creation of Exam Result Table: Procedure: 1) Open Start > Programs -> Accessories -> Notepad 2) Type the following training data set with the help of Notepad for Exam result Table, @relation exam result @attribute outlook (id, exam date, result, result date) @atwibute id nunvesie @attribute exam date numeric @attribute result (TRUE, FALSE) @attribute result date (yes, n @data 1101,08-09-23, TRUE, yes 102,08-08-23, TRUE, yes Ignou Study Helper - Sunil Poonia Page 8 ses Touou Stuny Herre ene EY sunt Poowia UBLICATIONS 1103,10-09-23, TRUE yes, 104,11-09-23,FLASE,no 1105, 12-09-23, TRUE yes 1106,13-09-23, TRUE yes 107, 14-09-23, FLASE,no 1108,15-09-23,FLASE,no 1109,16-09-23, TRUE yes 110,17-09-23, TRUE yes, 3) After that the file is saved with .arff file formats 4) Minimize the arff file and then open Start -> Programs -> weka-3-4. 5) Click on weka-3-4, then Weka dialog box is displayed on the sereen. 6) In that dialog box there are four modes, click on explorer. 7) Explorer shows many options: In that click on ‘open fle’ and select the erff file 8) Click on edit button which shows weather table on weka, Training Data Set > Exam Result Table dere barrel = [( | ties [eo — soi] 08-05-23]hingi__[pass__| 10-10-23) (09-09-23]engiish [pass | 11-10-23] 303] 10-05-23|math__|pass__| 12-10-23] joa] 11-05-23]so.sci._ [fail 1310-23] 105] 12-05-23]science [pass | 14-10-23] 106] 13-08-23]sanskrit [pass | 15-10-23] 14-05-23|urdu [fall 16-10-23] 108) 15-05-23]supw [Fail 17-10-23] 103] 16-05-23]hindisha|pass | 18-10-23] 17-05-23|clucture [pass | 19-10-23] Ignou Study Helper - Sunil Poonia Page 9 ONIA: E-1+ TOMou Stu Here Poomss Neo? Sum. Paowia 2-D Plot Matrix: ‘roc | cast | Cur [asec | eects | Yui Procedure: z e 1) Open Start > Programs > Wekd-34-> Weko-3-4 yumm 2) Open the explorer and click on Preprocess, then a new window will appear. In that window select exam_results.csv fle then the data will be displayed. 3) After that click on the Visualize tab on the top of the Menu bar. 4) When we select Visualize tab then Plot Matrinis displayedion the seréen. Output: Ignou Study Helper - Sunil Poonia Page 10 Touoy Srey HeLPee ONIA; a eat Nut Sumit Poowia | (as) Weka Explorer _Prerocss | Cus | Custer | Assocnte|Selectatbtes, Yovlze Pot Mar id [Posie 0) poe ee) me connie =) Caen) 0 Cos Gane - = ae e (ae) 5) After that we select the Select Attribute button, then select Outlook attribute and clock OK. 5) Click on the Update button to display the output. 7) After that select the Select Attribute button and select Temperature attribute and then click OK 8) Increase the Plot Size and Point Size. 9) Click on the Update button to display the output. ste0y, 10) After that we select the/Sela@iAttribute button, then selact Humidity attribute and clock Ok. fey 11) Click on the Update button to display the output, AS ae 12) After that select the Select Attribute button and select Windy attribute and then click OK. ed 413) Increase the Jitter 14) Click on the Update button to display the output. 15) After that we select the Select Attribute button, then select Play attrbute and clock OK 16) Click on the Update button to display the output. Ignou Study Helper - Sunil Poonia Page 11 ONIAZ E-1+ TOMou Stu Here UBLICATION®. EY Suni POONA utp: ([Peprenesn [Ghvnfy | Genin | Anvoiote | Sele etnies EUS Peet swe ‘exam date exam date Ignou Study Helper - Sunil Poonia Page 12 E-1+ TOMou Stu Here poonet Naz? Sumit Poowa tpt Result: This program has been successfully executed. Ignou Study Helper - Sunil Poonia Page 13

You might also like