0% found this document useful (0 votes)
68 views

Homework 3

This document outlines homework assignments on fuzzy logic inference for classifying iris flower types based on petal measurements, and using linear regression and smoothing algorithms to fit lines to data points. Students are asked to: 1) Design a fuzzy inference system to classify iris flowers into 3 classes based on petal length and width using triangular membership functions and defuzzification, and analyze the results. 2) Use linear regression to find the line of best fit for given x and y data points and predict the y value for x=7, and 3) Plot the raw data, regression line, and smoothed line on one graph. Source code is to be submitted electronically and written solutions as a hard copy.

Uploaded by

krishna135
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
68 views

Homework 3

This document outlines homework assignments on fuzzy logic inference for classifying iris flower types based on petal measurements, and using linear regression and smoothing algorithms to fit lines to data points. Students are asked to: 1) Design a fuzzy inference system to classify iris flowers into 3 classes based on petal length and width using triangular membership functions and defuzzification, and analyze the results. 2) Use linear regression to find the line of best fit for given x and y data points and predict the y value for x=7, and 3) Plot the raw data, regression line, and smoothed line on one graph. Source code is to be submitted electronically and written solutions as a hard copy.

Uploaded by

krishna135
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 2

Soft Computing

Kai Goebel/Bill Cheetham


Homework 3 version 2: fuzzy logic inference (14 points) & linear regression (4 points)
Due: Tuesday September 25th at the beginning of class (no later than 6:10pm)

1. You have been approached by a botanist to help out in the classification of 3 different species of the
flower iris based on measurements of their petal length (x 1) and petal width (x2). The botanist has provided
you with the knowledge about the type of flower (i.e, the class) for each data sample. You are asked to
provide an automated inference tool which assigns a class (e.g., iris class 1, iris class 2, iris class 3) based
on the measurements of petal length and petal width. The task is complicated by an overlapping region in
which the classification is not unique. Misclassifications are unavoidable but it is the goal to hold them to a
minimum. Specifically,

a) Design a fuzzy inference tool with 3 rules of the following type: IF petal length small AND petal width
small, THEN iris belongs to class 1,
b) Use 3 membership functions for petal length (small, medium, large) and petal width (small, medium,
large). Use triangular-shaped functions. Use the max operator for defuzzification of the singleton
output; Hint: the compressed mf notation as shown in equation 2.19 in the text book may be useful.
c) Display the iris data displaying feature x1 vs. x2 using different markers for each class (blue, black, and
red stars for classes 1, 2, and 3, respectively) (2 points)
d) Display the result of the classification on the same plot using blue, black, and red circles, for found
classes 1, 2, and 3, respectively (4 points)
e) Display the membership functions on the same plot on the x-axis and y-axis; in particular, plot the
membership functions for the petal length on the x-axis, the membership functions for the petal width
on the y-axis; add a legend (4 points)
f) Count the total misclassifications and itemize as in the following example (note that the rows need to
add up to the number of samples for that particular class, i.e., 50)- (2 points):
Total misclassifications: 7
Class 1 found Class 2 found Class 3 found
Actual Class 1 50 0 0
Actual Class 2 0 47 3
Actual Class 3 0 4 46
g) Reason about the results; what could improve the results? (2 points)
h) For bonus points: implement suggested improvement and compare results (4 points)

Iris data can be downloaded from the class web site at:
http://www.cs.rpi.edu/courses/fall01/soft-computing/hw/iris2D.dat
An example graph is shown here
(minus the tick marks and mfs(x2)
labels): membership
x2 functions length small
length medium
length large
width small
width medium
width large

mfs(x1)

x1
2.) Use the linear regression algorithm described in class and chapter 5 of Jang to find a line, in the form y
= ax + b, that fits the data below. Hand in the formula for the line and the value of the line for x = 7. (1
point)

X Y
1 2
2 4
3 5
4 5
5 7
6 8

Predict the value of x = 7 for the above data using the smoothing algorithm f(x + 1) = a f(x) + (1 - a) y(x),
where a = .5. Assume f(1) = y(1) = 2. Hand in the value at x=7. (1 point)

Hand in a plot the following in one graph: (2 points)


- raw data (x = 1 6)
- regression line (x = 1 7)
- smoothed line (x = 1 7)

General submission guidelines:


Please submit your homework solutions (excluding source code) including all graphs, numerical output,
and supporting information as a hard copy. Submit source code electronically to the email of the instructors
([email protected], [email protected]). If possible, zip up the source code files and use your last name
as the archive name. Identify the homework in the subject line.

You might also like