Encrypting your link and protect the link from viruses, malware, thief, etc! Made your link safe to visit.

From the Matlab command window download the iris dataset using the load command: load ('fisheriris.mat'). This will download two variables. The species and meas. The former contains the list of species or types of the iris. However, the latter is a double matrix with 4 features and 150 data samples. You are required to do the followings:

 Answer & Explanation

VerifiedSolved by verified expert

Properly labelled MATLAB code and the figures are attached in the explanation. Please run this code to get answers to all parts.


Answer to Part 4 : From figures it seems that features 2&3 and 3&4 can be used to separate the colors as different color points corresponding to flowers of different species have very less overlap in figure 2 and figure 3.

Step-by-step explanation

clear all

clc

close all

load ('fisheriris.mat')

 

idx_setosa = strcmp(species,'setosa');

idx_versicolor = strcmp(species,'versicolor');

idx_virginica = strcmp(species,'virginica');

%% PART 1

figure;

plot(meas(idx_setosa,1),meas(idx_setosa,2),'ro','LineStyle','none')

hold on

plot(meas(idx_versicolor,1),meas(idx_versicolor,2),'bs','LineStyle','none')

plot(meas(idx_virginica,1),meas(idx_virginica,2),'g*','LineStyle','none')

legend('setosa','versicolor','virginica')

xlabel('Feature 1')

ylabel('Feature 2')

%% PART 2

figure;

plot(meas(idx_setosa,2),meas(idx_setosa,3),'ro','LineStyle','none')

hold on

plot(meas(idx_versicolor,2),meas(idx_versicolor,3),'bs','LineStyle','none')

plot(meas(idx_virginica,2),meas(idx_virginica,3),'g*','LineStyle','none')

legend('setosa','versicolor','virginica')

xlabel('Feature 2')

ylabel('Feature 3')

%% PART 3

figure;

plot(meas(idx_setosa,3),meas(idx_setosa,4),'ro','LineStyle','none')

hold on

plot(meas(idx_versicolor,3),meas(idx_versicolor,4),'bs','LineStyle','none')

plot(meas(idx_virginica,3),meas(idx_virginica,4),'g*','LineStyle','none')

legend('setosa','versicolor','virginica')

xlabel('Feature 3')

ylabel('Feature 4')

 %% PART 4

%

 

%% PART5 - Euclidean distance calu=culation

Dist = zeros(length(species),length(species));

for i = 1:length(species)

  for j = 1:length(species)

    Dist(i,j) = myEucDis(meas(i,:),meas(j,:));%distance between ith and jth data sample

  end

end

% Dist is the matrix whose (i,j)th element is the euclidean distance

% between features of ith and jth iris flower in he datasample

%% PART6 - Mean calculation

Mean_setosa = mean(meas(idx_setosa,:)); %mean of individual features for setosa iris

Mean_versicolor = mean(meas(idx_versicolor,:)); %mean of individual features for versicolor iris

Mean_virginica = mean(meas(idx_virginica,:)); %mean of individual features for virginica iris

 


%%% MATLAB FUNCTION FILE

function dis = myEucDis(pt1,pt2)

%calulates euclidean distance between one data sample and the other

dis = sqrt(sum((pt1-pt2).*(pt1-pt2)));

end

 

 

 







ST

Search This Blog

Labels

Report Abuse

QUESTION 6 (a) The bar shown in Figure Q2(a) is subjected to tensile load of 150 Kn. If the stress in the middle portions is limited to 160 N/mm², determine the diameter of the middle portion. Find also the length of the middle portion if the total elongation of the bar is to be 0.25 mm. E E = 2.0 + 105N/mm². (12 marks) 150 KN 10 cm DIA 10 cm DIA 150 KN 45 cm Figure Q6(a) (b) A brass bar, having cross-section area of 900 mm², is subjected to axial forces as shown in Figure Q2(b), in which AB = 0.6 m, BC = 0.8 m, and CD = 1.0 m. Find the total elongation of the bar. E = 1.0 + 105N/mm2 . (8 marks) Page 4 of 5 B D 40 KN 70 KN 20 KN 10 KN Figure Q6(b) (TOTAL = 20 MARKS)

  Question: Show transcribed image text Answer:
  Introduction To find incremental revenue and cost, we subtract Current revenue and cost from Projected revenue and cost. Answer Current Situation Projected Sales and Profit Incremental Revenues and Costs Total Revenue Php1,500,000 Php1,800,000 + Php3000,000 Variable Cost 575,000 425,000 - Php 332,000 Direct Fixed Costs 625,000 700,000 + Php 75,000 Indirect Fixed Costs 100,000 100,000 No change Profit Php 200,000 Php 575,000 + Php 375,000 Profit increases by Php 375,000, thus a new camera and coffee maker must be purchased.

Contributors