SCHOOL OF COMPUTER SCIENCE
AIML LAB WEKA TOOL ASSIGNMENT
Submitted by
Name Kashish
Branch BTech CSE(DevOps)B-1(NH)
Semester 6
SAPID 500107137
Roll no R2142220335
EX.NO:1
LISTING APPLICATIONS FOR MINING
AIM:
To list all the categorical (or nominal) attributes and the real-valued attributes separately.
RESOURCES: Weka mining tool1.
PROCEDURE:
1)Open the Weka GUI Chooser.
2)Select EXPLORER present in Applications.
3)Select Preprocess Tab.
4)Go to OPEN file and browse the file that is already stored in the system “bank.csv”.
5)Clicking on any attribute in the left panel will show the basic statistics on that selected attribute.1.4
Output
EX.NO:2
FILE FORMAT FOR DATA MINING
Aim: To study the file formats for the data mining.
Introduction:
WEKA supports a large number of file formats for the data. The complete list of file formats are given
here:
1. arff
2. arff.gz
3. bsi
4. csv
5. dat
6. data
7. json
8. json.gz
9. libsvm
10. m
11. names
12. xrff
13. xrff.gz
The types of files that it supports are listed in the drop-down list box at the bottom of the screen.
This is shown in the screenshot given below.
As you would notice it supports several formats including CSV and JSON.
The default file type is Arff.
Arff Format
An Arff file contains two sections - header and data.
The header describes the attribute types.
The data section contains a comma separated list of data.
As an example for Arff format, the Employee data file loaded from the WEKA sample databases is
shown below:
From the screenshot, you can infer the following points −
The @relation tag defines the name of the database.
The @attribute tag defines the attributes.
The @data tag starts the list of data rows each containing the comma separated fields.
The attributes can take nominal values as in the case of outlook shown here −
You can also set a Target or a Class variable called play as shown here −
@attribute play (yes, no)
The Target assumes two nominal values yes or no.
Result:
Thus, the different file formats for the data mining were studied.
EX.NO:3a CONVERSION OF TEXT FILE INTO ARFF FILE
Aim:
To convert a text file to ARFF(Attribute-Relation File Format) using Weka3.8.2 tool.
Objectives:
Most of the data that we have collected from public forum is in the text format that cannot be read by
Weka tool. Since Weka (Data Mining tool) recognizes the data in ARFF format only we have to convert
the
text file into ARFF file.
Algorithm:
1. Download any data set from UCI data repository.
2. Open the same data file from excel. It will ask for delimiter (which produce column) in excel.
3. Add one row at the top of the data.
4. Enter header for each column.
5. Save file as .CSV (Comma Separated Values) format.
6. Open Weka tool and open the CSV file.
7. Save it as ARFF format.
Data file:
Arff file:
Result:
Thus, conversion of a text file to ARFF(Attribute-Relation File Format) using Weka3.8.2 tool is
implemented.
EX.NO:3b. CONVERSION OF ARFF TO TEXT FILE
Aim:
To convert ARFF (Attribute-Relation File Format) into text file.
Objectives:
Since the data in the Weka tool is in ARFF file format we have to convert the ARFF file to text format
for
further processing.
Algorithm:
1. Open any ARFF file in Weka tool.
2. Save the file as CSV format.
3. Open the CSV file in MS-EXCEL.
4. Remove some rows and add coreseponding header to the data.
5. Save it as text file with the desire delimiter.
Arff File
CSV File