Professional Documents
Culture Documents
CERTIFICATE
THE EXPERIMENTS DULY SIGNED IN THIS JOURNAL REPRESENT THE
BONAFIDE WORK BY Mr. BHAVIN JITENDRA PANCHAL IN SEMESTER IV OF
SECOND YEAR OF MASTER IN COMPUTER APPLICATION (MCA) IN THE
COMPUTER LABORATORY OF PCP CENTER PUNE VIDYATHI GRIHA’S
COLLEGE, GHATKOPAR FOR SUBJECT ADVANCED DATABASE TECHNIQUES
DURING ACADEMIC YEAR 2017-2018.
____________________ ____________________________
______________________
EXTERNAL EXAMINER
Advanced Database Techniques
INEDX
1. Intrduction To Weka
2. Application of Pre-processing
Techniques
a)ReplaceMissingValues
b)Discritize
c)PKIDiscritize
d)ADD attribute
e)ADD Expression
3. Creation of .arff file
4. Association Rules
5. Study of Classification Techniques
6. Saving and Loading Model
7. Creating Object Types
8. Table Of Objects
9. Manipulating Objects
10. Creating Object Views
11. Objects with Methods
12. Varray
13. Nested Tables
14. Referencing & De-Referencing
Objects
15. Method Overloading
16. OLAP
i)Ranking Functions
a)Rank
b)Dense_Rank
17. OLAP
a) Roll up
b) Cube
18. Partitioning
a)By Range ,b)By Hash, c) By List
Practical 1: Introduction To Weka
Iris data –
Visualize all- sepallength (NUM) – for 1st column all statistic values listed
Practical 2(a) – Replace Missing Values
Before Replacing: missingdataweather
@RELATION iris
@DATA
5.1,3.5,1.4,0.2,Iris-setosa
4.9,3.0,?,0.2,Iris-setosa
4.7,3.2,?,0.2,Iris-setosa
4.6,3.1,1.5,0.2,Iris-setosa
5.0,3.6,1.4,0.2,Iris-setosa
5.4,3.9,?,0.4,Iris-setosa
,?,3.4,1.4,0.3,Iris-setosa
5.0,3.4,?,0.2,Iris-setosa
4.4,2.9,1.4,0.2,Iris-setosa
4.9,3.1,1.5,0.1,Iris-setosa
5.4,?,1.5,0.2,Iris-setosa
4.8,3.4,?,0.2,Iris-setosa
4.8,3.0,1.4,?,Iris-setosa
4.3,3.0,1.1,0.1,Iris-setosa
,?,4.0,1.2,?,Iris-setosa
5.7,4.4,1.5,0.4,Iris-setosa
5.4,3.9,1.3,0.4,Iris-setosa
5.1,3.5,1.4,0.3,Iris-setosa
5.7,3.8,1.7,0.3,Iris-setosa
5.1,3.8,?,0.3,Iris-setosa
5.4,3.4,1.7,0.2,Iris-setosa
5.1,3.7,1.5,0.4,Iris-setosa
4.6,3.6,1.0,0.2,Iris-setosa
5.1,3.3,1.7,0.5,Iris-setosa
4.8,3.4,1.9,0.2,Iris-setosa
5.0,3.0,1.6,0.2,Iris-setosa
5.0,3.4,1.6,0.4,Iris-setosa
5.2,3.5,1.5,0.2,Iris-setosa
5.2,3.4,1.4,0.2,Iris-setosa
4.7,3.2,1.6,0.2,Iris-setosa
4.8,3.1,1.6,0.2,Iris-setosa
5.4,3.4,1.5,0.4,Iris-setosa
5.2,4.1,1.5,0.1,Iris-setosa
5.5,4.2,1.4,0.2,Iris-setosa
4.9,3.1,1.5,0.1,Iris-setosa
5.0,3.2,1.2,0.2,Iris-setosa
5.5,3.5,1.3,0.2,Iris-setosa
4.9,3.1,1.5,0.1,Iris-setosa
4.4,3.0,1.3,0.2,Iris-setosa
5.1,3.4,1.5,0.2,Iris-setosa
5.0,3.5,1.3,0.3,Iris-setosa
4.5,2.3,1.3,0.3,Iris-setosa
5.3,3.7,1.5,0.2,Iris-setosa
5.0,3.3,1.4,0.2,Iris-setosa
7.0,3.2,4.7,1.4,Iris-versicolor
6.4,3.2,4.5,1.5,Iris-versicolor
6.9,3.1,4.9,1.5,Iris-versicolor
5.5,2.3,4.0,1.3,Iris-versicolor
6.5,2.8,4.6,1.5,Iris-versicolor
5.7,2.8,4.5,1.3,Iris-versicolor
6.3,3.3,4.7,1.6,Iris-versicolor
https://machinelearningmastery.com/how-to-handle-missing-values-in-machine-learning-
data-with-weka/
@RELATION iris
@DATA
5.1,3.5,1.4,0.2,Iris-setosa
4.9,3.0,1.4,0.2,Iris-setosa
4.7,3.2,1.3,0.2,Iris-setosa
4.6,3.1,1.5,0.2,Iris-setosa
5.0,3.6,1.4,0.2,Iris-setosa
5.4,3.9,1.7,0.4,Iris-setosa
4.6,3.4,1.4,0.3,Iris-setosa
5.0,3.4,1.5,0.2,Iris-setosa
4.4,2.9,1.4,0.2,Iris-setosa
4.9,3.1,1.5,0.1,Iris-setosa
5.4,3.7,1.5,0.2,Iris-setosa
4.8,3.4,1.6,0.2,Iris-setosa
4.8,3.0,1.4,0.1,Iris-setosa
4.3,3.0,1.1,0.1,Iris-setosa
5.8,4.0,1.2,0.2,Iris-setosa
5.7,4.4,1.5,0.4,Iris-setosa
5.4,3.9,1.3,0.4,Iris-setosa
5.1,3.5,1.4,0.3,Iris-setosa
5.7,3.8,1.7,0.3,Iris-setosa
5.1,3.8,1.5,0.3,Iris-setosa
5.4,3.4,1.7,0.2,Iris-setosa
5.1,3.7,1.5,0.4,Iris-setosa
4.6,3.6,1.0,0.2,Iris-setosa
5.1,3.3,1.7,0.5,Iris-setosa
4.8,3.4,1.9,0.2,Iris-setosa
5.0,3.0,1.6,0.2,Iris-setosa
5.0,3.4,1.6,0.4,Iris-setosa
5.2,3.5,1.5,0.2,Iris-setosa
5.2,3.4,1.4,0.2,Iris-setosa
4.7,3.2,1.6,0.2,Iris-setosa
4.8,3.1,1.6,0.2,Iris-setosa
5.4,3.4,1.5,0.4,Iris-setosa
5.2,4.1,1.5,0.1,Iris-setosa
5.5,4.2,1.4,0.2,Iris-setosa
4.9,3.1,1.5,0.1,Iris-setosa
5.0,3.2,1.2,0.2,Iris-setosa
4.4,3.0,1.3,0.2,Iris-setosa
5.1,3.4,1.5,0.2,Iris-setosa
5.0,3.5,1.3,0.3,Iris-setosa
4.5,2.3,1.3,0.3,Iris-setosa
4.6,3.2,1.4,0.2,Iris-setosa
5.3,3.7,1.5,0.2,Iris-setosa
5.0,3.3,1.4,0.2,Iris-setosa
7.0,3.2,4.7,1.4,Iris-versicolor
6.4,3.2,4.5,1.5,Iris-versicolor
6.9,3.1,4.9,1.5,Iris-versicolor
5.5,2.3,4.0,1.3,Iris-versicolor
6.5,2.8,4.6,1.5,Iris-versicolor
5.7,2.8,4.5,1.3,Iris-versicolor
6.3,3.3,4.7,1.6,Iris-versicolor
Practical 2(b)- Discretize
Filename : discretizeweather.arff
@RELATION iris
@DATA
5.1,3.5,1.4,0.2,Iris-setosa
4.9,3.0,1.4,0.2,Iris-setosa
4.7,3.2,1.3,0.2,Iris-setosa
4.6,3.1,1.5,0.2,Iris-setosa
5.0,3.6,1.4,0.2,Iris-setosa
5.4,3.9,1.7,0.4,Iris-setosa
4.6,3.4,1.4,0.3,Iris-setosa
5.0,3.4,1.5,0.2,Iris-setosa
4.4,2.9,1.4,0.2,Iris-setosa
4.9,3.1,1.5,0.1,Iris-setosa
5.4,3.7,1.5,0.2,Iris-setosa
4.8,3.4,1.6,0.2,Iris-setosa
4.8,3.0,1.4,0.1,Iris-setosa
4.3,3.0,1.1,0.1,Iris-setosa
5.8,4.0,1.2,0.2,Iris-setosa
5.7,4.4,1.5,0.4,Iris-setosa
5.4,3.9,1.3,0.4,Iris-setosa
5.1,3.5,1.4,0.3,Iris-setosa
5.7,3.8,1.7,0.3,Iris-setosa
5.1,3.8,1.5,0.3,Iris-setosa
5.4,3.4,1.7,0.2,Iris-setosa
5.1,3.7,1.5,0.4,Iris-setosa
4.6,3.6,1.0,0.2,Iris-setosa
5.1,3.3,1.7,0.5,Iris-setosa
4.8,3.4,1.9,0.2,Iris-setosa
5.0,3.0,1.6,0.2,Iris-setosa
5.0,3.4,1.6,0.4,Iris-setosa
5.2,3.5,1.5,0.2,Iris-setosa
5.2,3.4,1.4,0.2,Iris-setosa
4.7,3.2,1.6,0.2,Iris-setosa
4.8,3.1,1.6,0.2,Iris-setosa
5.4,3.4,1.5,0.4,Iris-setosa
5.2,4.1,1.5,0.1,Iris-setosa
5.5,4.2,1.4,0.2,Iris-setosa
4.9,3.1,1.5,0.1,Iris-setosa
5.0,3.2,1.2,0.2,Iris-setosa
4.4,3.0,1.3,0.2,Iris-setosa
5.1,3.4,1.5,0.2,Iris-setosa
5.0,3.5,1.3,0.3,Iris-setosa
4.5,2.3,1.3,0.3,Iris-setosa
4.6,3.2,1.4,0.2,Iris-setosa
5.3,3.7,1.5,0.2,Iris-setosa
5.0,3.3,1.4,0.2,Iris-setosa
7.0,3.2,4.7,1.4,Iris-versicolor
6.4,3.2,4.5,1.5,Iris-versicolor
6.9,3.1,4.9,1.5,Iris-versicolor
5.5,2.3,4.0,1.3,Iris-versicolor
6.5,2.8,4.6,1.5,Iris-versicolor
5.7,2.8,4.5,1.3,Iris-versicolor
6.3,3.3,4.7,1.6,Iris-versicolor
Practical 2(b) - PKIDiscritize
Filename : pkdiscretizeweather.arff
@RELATION iris
@DATA
5.1,3.5,1.4,0.2,Iris-setosa
4.9,3.0,1.4,0.2,Iris-setosa
4.7,3.2,1.3,0.2,Iris-setosa
4.6,3.1,1.5,0.2,Iris-setosa
5.0,3.6,1.4,0.2,Iris-setosa
5.4,3.9,1.7,0.4,Iris-setosa
4.6,3.4,1.4,0.3,Iris-setosa
5.0,3.4,1.5,0.2,Iris-setosa
4.4,2.9,1.4,0.2,Iris-setosa
4.9,3.1,1.5,0.1,Iris-setosa
5.4,3.7,1.5,0.2,Iris-setosa
4.8,3.4,1.6,0.2,Iris-setosa
4.8,3.0,1.4,0.1,Iris-setosa
4.3,3.0,1.1,0.1,Iris-setosa
5.8,4.0,1.2,0.2,Iris-setosa
5.7,4.4,1.5,0.4,Iris-setosa
5.4,3.9,1.3,0.4,Iris-setosa
5.1,3.5,1.4,0.3,Iris-setosa
5.7,3.8,1.7,0.3,Iris-setosa
5.1,3.8,1.5,0.3,Iris-setosa
5.4,3.4,1.7,0.2,Iris-setosa
5.1,3.7,1.5,0.4,Iris-setosa
4.6,3.6,1.0,0.2,Iris-setosa
5.1,3.3,1.7,0.5,Iris-setosa
4.8,3.4,1.9,0.2,Iris-setosa
5.0,3.0,1.6,0.2,Iris-setosa
5.0,3.4,1.6,0.4,Iris-setosa
5.2,3.5,1.5,0.2,Iris-setosa
5.2,3.4,1.4,0.2,Iris-setosa
4.7,3.2,1.6,0.2,Iris-setosa
4.8,3.1,1.6,0.2,Iris-setosa
5.4,3.4,1.5,0.4,Iris-setosa
5.2,4.1,1.5,0.1,Iris-setosa
5.5,4.2,1.4,0.2,Iris-setosa
4.9,3.1,1.5,0.1,Iris-setosa
5.0,3.2,1.2,0.2,Iris-setosa
4.4,3.0,1.3,0.2,Iris-setosa
5.1,3.4,1.5,0.2,Iris-setosa
5.0,3.5,1.3,0.3,Iris-setosa
4.5,2.3,1.3,0.3,Iris-setosa
4.6,3.2,1.4,0.2,Iris-setosa
5.3,3.7,1.5,0.2,Iris-setosa
5.0,3.3,1.4,0.2,Iris-setosa
7.0,3.2,4.7,1.4,Iris-versicolor
6.4,3.2,4.5,1.5,Iris-versicolor
6.9,3.1,4.9,1.5,Iris-versicolor
5.5,2.3,4.0,1.3,Iris-versicolor
6.5,2.8,4.6,1.5,Iris-versicolor
5.7,2.8,4.5,1.3,Iris-versicolor
6.3,3.3,4.7,1.6,Iris-versicolor
Filter – choose-unsupervised - Pkidiscretize
Practical 2(c) - Add
@RELATION sales
@DATA
Bread,10,Cheap,yes
Butter,15,Cheap,no
Bread,20,Expensive,yes
Butter,30,Expensive,no
Cheese,50,Cheap,yes
Cheese,75,Expensive,yes
Cheese,50, Expensive,no
Bread,5,?,?
Butter,25,?,yes
Cheese,95,?,?
Butter,?,Expensive,yes
Cheese,?,Expensive,no
Cheese,?,Expensive,yes
?,75,Expensive,?
Weather.nominal arff
C:\Pooja\ADT
Practical 4 - Study of Association Rules
No. of Rules: 10
=== Run information ===
Relation: sales
Instances: 15
Attributes: 4
age
income
profession
buy_comp
Apriori
=======
Buy_comp.arff
@RELATION sales
@data
young,high,student,yes
middle,medium,working,no
old,low,retired,yes
young,medium,student,no
middle,medium,retired,no
old,high,retired,no
young,low,retired,yes
middle,medium,working,yes
old,high,retired,no
young,low,student,no
middle,medium,student,yes
old,high,retired,yes
middle,low,student,yes
middle,high,student,no
middle,low,retired,yes
J48
=== Run information ===
Scheme:weka.classifiers.trees.J48 -C 0.25 -M 2
Relation: sales
Instances: 15
Attributes: 4
age
income
profession
buy_comp
Test mode:10-fold cross-validation
------------------
: yes (15.0/7.0)
Number of Leaves : 1
0 0.5 0 0 0 0.25 no
a b <-- classified as
4 4 | a = yes
7 0 | b = no
ID3
=== Run information ===
Scheme:weka.classifiers.trees.Id3
Relation: sales
Instances: 15
Attributes: 4
age
income
profession
buy_comp
Id3
income = high
| age = middle: no
| age = old: no
income = medium
| age = young: no
| age = middle
| | profession = retired: no
income = low
| age = young
| | profession = student: no
UnClassified Instances 3 20 %
0 0.571 0 0 0 0.321 no
a b <-- classified as
3 4 | a = yes
5 0 | b = no
Practical 6 – Saving & Loading Model
Inserting values
Rank
Selecting top 5 ranks based on salary
OLAP
1. Roll Up
2. Cube
Practical 17 – Ranking Functions
(Range partitioning)
SQL> create table partition_by_range
2 (
3 fname varchar2(25),
4 mname varchar2(25),
5 lname varchar2(25),
6 birth_mm int not null,
7 birth_dd int not null,
8 birth_yyyy int not null
9 )
10 PARTITION BY RANGE (BIRTH_YYYY,BIRTH_MM,BIRTH_DD)
11 {
12 PARTITION DOBS_LESS_1971 VALUES LESS THAN(1972,01,01);
13 PARTITION DOBS_LESS_1971 VALUES LESS THAN(1973,01,01);
14 PARTITION DOBS_LESS_1971 VALUES LESS THAN(1974,01,01);
15 PARTITION DOBS_1975_OR_LATER VALUES LESS THAN(MAXVALUE,MAXVALUE,MAXVALUE)
16 }
17 ENABLE ROW MOVEMENT;
Table created.
SQL>_
//select values from partition
Hash Partitioning
Create table and Insert values
SQL> create table partition_by_hash
2 (
3 fname varchar2(20),
4 mname varchar2(20),
5 lname varchar2(20),
6 age number not null
7 )
8 PARTITION BY HASH(AGE)
9 (
10 PARTITION P1_AGE,
11 PARTITION P2_AGE,
13 PARTITION P3_AGE,
14 PARTITION P4_AGE,
15 PARTITION P5_AGE
16 )
17 ENABLE ROW MOVEMENT;
Table created.
SQL>_
DISPLAY OF PARTITION
7 rows selected.
SQL>_
LIST Partitioning
Creating table
Table created.
SQL>_
Inserting Values
Selecting Values