Case Based Reasoning for Classification Problem Essay

CASE BASED REASONING FOR CLASSIFICATION PROBLEM INTRODUCTION The Car Classify System is an intelligence system which applying Case Based Reasoning approach. This system was developing to classify the car class whether they are unacc, acc, good or very good (vgood). This system classified the car by calculate the similarities with the new data with the history data in the data base. The new data is data that key in by the user. The history data is the old data that get from the UCI Machine Learning website.

OBJECTIVE The objective to develop this system is to classify the car class by using the Case Based Reasoning approach for final project course TIN 5013 Artificial Intelligence. SCOPE The scope for this system is to classify the car were in the class unacc, acc, good or vgood. THE DESIGN The system was developing by using Visual Basic C++ 6. 0 and the dataset for training are from the external file named “car. txt”. The total of the training set are 1037 instances from the 1728 instances (original dataset).

In CBR approach, to classify the class for the new data, the system should calculate the local similarity for each attribute by comparing between the new case and the training dataset. After calculating the local similarity, this system will calculate the global similarity. To calculate the global similarity, the results of local similarity will times by weight. For this system, the weight was initializing by one (1) for each attributes. In this system, we calculate the normalization of weight because it can make easy to system to calculate the global similarity. After calculating the global similarity, the system will sort the 10 highest alues of the global similarity then the system will only choose the global similarity value more than 80% to count majority voting. The result to classify the car class is based on the class which has the highest total vote. The flow for this system is shown in the flow chart below: THE ALGORITHM Step 1 : Retrieve data from external file Step 2 : Retrieve new data from user Step 3 : Calculate normalized weight NormalizedWeight =Weight(xi) TotalWeight Step 4 : Calculate local similarity 1 new == old Localsim(new,old) 0 new ==old Step 5 : Calculate global similarity Globalsim(new,old) = (localism(new,old)*NormalizedWeight)*100

Step 6 : Sorted 10 highest global similarity Step 7 : Count Majority Voting Step 8 : Display result RESULT **************************************** * * * Car Classify System * * * **************************************** 1st data : Buying –> v-high [1], high [2], med [3], low [4] 2nd data : Maint –> v-high [1], high [2], med [3], low [4] 3rd data : Doors –> 2, 3, 4, 5-more [5] 4th data : Persons –> 2, 4, more [5] 5th data : Lug_boot –> big [1], med [2], small [3] th data : Safety –> high [1], med [2], low [3] Insert data 1: 4 Insert data 2: 4 Insert data 3: 5 Insert data 4: 5 Insert data 5: 1 Insert data 6: 1 New Case: {4,4,5,5,1,1,} sumweight: 6 **************************************** * * * Sorted Similarity Result * * * **************************************** Global Similarity (Sort) Class 83. 3333% 3 83. 3333% 1 83. 3333% 3 83. 3333% 1 83. 3333% 1 83. 3333% 1 83. 3333% 1 83. 3333% 1 83. 3333% 4 83. 3333% 1 **************************************** * * Majority Voting * * * **************************************** Global Similarity Class 83. 3333% 3 83. 3333% 1 83. 3333% 3 83. 3333% 1 83. 3333% 1 83. 3333% 1 83. 3333% 1 83. 3333% 1 83. 3333% 4 83. 3333% 1 Class 1 = 7 Class 2 = 0 Class 3 = 2 Class 4 = 1 The class for the new case is v-good Press any key to continue CONCLUSION For conclusion, the CBR approach is one of the way that can be use to solve the classification problem that enables the implementation of intelligent function.

SOURCE CODE /*———————————————– FINAL PROJECT ARTIFICIAL INTELLIGENCE TIN5013 CASE BASE REASONING – CAR DATASET PREPARED FOR: MR AZIZI GROUP MEMBERS: MAZNIE JUSNANI ————————————————*/ #include #include #include #include #include # define LAJUR 6 # define BARIS 1036 void data(); int count=0, number,i,j; char k; double newcase[LAJUR]; double localsim[BARIS][LAJUR]; int oldCases[BARIS][LAJUR+1]; fstream infile; fstream outfile; void main() { data(); cout