DMDW LAB NEW - Merged
DMDW LAB NEW - Merged
Step 3: Now check for the executable file in downloads in your system and
run it.
Step 4: It will prompt confirmation to make changes to your system. Click on
Yes.
Step 9: Next screen will be of choosing the Start menu folder so don’t do
anything just click on Install Button.
Step 10: After this installation process will start and will hardly take a minute
to complete the installation.
Step 11: Click on the Next button after the installation process is complete.
Step 12: Click on Finish to finish the installation process.
Step 13: Weka is successfully installed on the system and an icon is created
on the desktop.
Step 14: Run the software and see the interface.
SEPAL WIDTH
PETAL LENGTH
PETAL WIDTH
CLASS
Step-3 Do same for the WETHER DATA. Note down the details of OUT
LOOK,TEMPERATURE,HUMIDITY,WINDY AND PLAY.
OUT LOOK
TEMPERATURE
HUMIDITY
WINDY
PLAY
EXPERIMENT – 3
3) Perform data prepocessing task and demonstrate performing filters discretize and
resamples on iris.
Step-1 Open WEKA and then go to workbench and click on OPEN FILE. In files click on
DATA and click on IRIS and open.
Step-2 Now click on the choose filter and select UNSUPERVISED and then select
ATTRIBUTE. In attribute select DISCRETIZE.
SEPAL LENGTH
SEPAL WIDTH
PETAL LENGTH
PETAL WIDTH
CLASS
Step-4 Now select the INSTANCE and then select RESAMPLE.
Step-5 Note down details of SEPAL LENGTH,SEPAL WIDTH,PETAL LENGTH,PETAL WIDTH
AND CLASS.
SEPAL LENGTH
SEPAL WIDTH
PETAL LENGTH
PETAL WIDTH
CLASS
Experiment -4&5
Demonstrate performing classification & clustering of data sets
Step-1
Open WEKA and then go to workbench and click on OPEN FILE. In files click on DATA and
click on IRIS and open.
Step-2
Now click on the FILTERS and select UNSUPERVISED and in that select ATTRIBUTE. In
attribute select DISCRETIZE and click on apply.
Step-3
Now go to ASSOCIATE and choose APRIORI and click on start. In this apriori change the
different values on “SUPPORT” and “CONFIDENCE”.
Step-1
Open WEKA and then go to workbench and click on OPEN FILE. In files click on DATA and
click on IRIS and open.
Step-2
Now click on the FILTERS and select UNSUPERVISED and in that select ATTRIBUTE. In
attribute select DISCRETIZE and click on apply.
Step-3
Now select CLASSIFY. In classify select choose in that select TREES and select J48 and start.
Instances: 150
Attributes: 5
sepallength
sepalwidth
petallength
petalwidth
class
Test mode: 10-fold cross-validation
Number of Leaves : 10
Step-2 Now click on the FILTERS and select UNSUPERVISED and in that select ATTRIBUTE.
In attribute select DISCRETIZE and click on apply.
Step-3 Now click on classify and apply values for FOLDS and draw the graphs for the
following.
Step-1 Open WEKA and then go to workbench and click on OPEN FILE. In files click on
DATA and click on IRIS and open.
Step-2 Now click on the FILTERS and select UNSUPERVISED and in that select ATTRIBUTE.
In attribute select DISCRETIZE and click on apply.
Step-3 Now click on CLASSIFY and click on choose and select BAYES in it and select NAVIE
BAYES and click on start and note down the values.
Step-4 Now select choose and select lazy classifier and select IBK and click start and note
down the values.
Step – 5 Select TREES classifier and select J48 and click on start and note down the values.
KS MAE RMSE RAE RRSE
Naïve 0.92 0.0532 0.1744 11.9604 37.0028
Bayes
IBK 0.88 0.0611 0.2077 13.7373 44.0545
J48 0.94 0.0489 0.1637 10.9981 34.7274
Step-1 Open WEKA and then go to workbench and click on OPEN FILE. In files click on DATA
and click on IRIS and open.
Step-2 Now click on the FILTERS and select UNSUPERVISED and in that select ATTRIBUTE. In
attribute select DISCRETIZE and click on apply.
Step-3 Now click on CLUSTER and click choose and select clusterers in clusterers select
Simple K means.click on start.
Step-4 Note down SIMPLE K MEANS values at 2 no . of clusters up to 4 cluster.
FOR CLUSTER-2
FOR CLUSTER-3
FOR CLUSTER-4
DEPARTMENT OF CSE RISE KRISHNA SAI PRAKASAM INSTITUTION :: ONGOLE
Experiment – 10
10) Demonstrate knowledge flow application on data sets.
Step-1
Step-9
Now click on the PLAY BUTTON to run the Knowledge Flow Data.
Step-10
Right click on the TEXT VIEWER and select SHOW RESULLTS.
Source code:
import java.io.*;
import java.util.*;
usedAsLibrary = true;
configure(args);
this.addObserver(ob);
go();
}
public Apriori(String[] args) throws Exception
{
configure(args);go();
createItemsetsOfSize1(); int
itemsetNumber=1;
int nbFrequentSets=0;
while (itemsets.size()>0)
calculateFrequentItemsets();
if(itemsets.size()!=0)
nbFrequentSets+=itemsets.size();
createNewItemsetsFromPreviousOnes();
itemsetNumber++;
log("Done");
if (usedAsLibrary) { this.setChanged();
notifyObservers(itemset);
else
{System.out.println(Arrays.toString(itemset) + " ("+
((support / (double) numTransactions))+" "+support+")");}
System.err.println(message);
}
}
if (args.length>=2)
minSup=(Double.valueOf(args[1]).doubleValue());
numItems = 0;
numTransactions=0; BufferedReader
data_in = new
BufferedReader(new FileReader(transaFile));
while (data_in.ready()) {
String line=data_in.readLine();
if (line.matches("\\s*")) continue;
numTransactions++;
StringTokenizer t = new
StringTokenizer(line," ");
while (t.hasMoreTokens()) {
int x = Integer.parseInt(t.nextToken());
//log(x);
if (x+1>numItems) numItems=x+1;
outputConfig();
configuration: "+numItems+"
items, "+numTransactions+" transactions, ");
log("minsup = "+minSup*100+"%");
}
private void createItemsetsOfSize1() { itemsets
= new ArrayList<int[]>(); for(int i=0;
i<numItems; i++)
int currentSizeOfItemsets =
itemsets.get(0).length;
"+currentSizeOfItemsets);
HashMap<String, int[]>
tempCandidates = newHashMap<String, int[]>();
//temporary candidates
int[] X = itemsets.get(i);int[]
Y = itemsets.get(j);
assert (X.length==Y.length);
int ndifferent = 0;
for(int s1=0; s1<Y.length; s1++)
{
{
boolean found = false;
if (X[s2]==Y[s1]) {
found = true;break;
}
(!found){
different++;
newcand=len[newcand-1]=y
if
assert(ndifferent>0);
if (ndifferent==1) {
Arrays.sort(newCand);
tempCandidates.put(Arrays.toString(newCand),new
Cand);
itemsets = new
ArrayList<int[]>(tempCandidates.values());
}
private void line2booleanArray(String line, boolean[]
trans) {
Arrays.fill(trans, false);
while (stFile.hasMoreTokens())
int parsedVal =
Integer.parseInt(stFile.nextToken());
boolean match;
if (match) {
count[c]++;
data_in.close();
/ if ((count[i] / (double)
foundFrequentItemSet(itemsets.get(i),count[i]);
frequentCandidates.add(itemsets.get(i));
itemsets = frequentCandidates;
OUTPUT:
Transaction Number: 2:
Item number 1 = 2
Item number 2 = 3
Item number 3 = 5
Transaction Number: 3:
Transaction Number: 4: