Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In this project you should use C , you are expected to read data from the file, make some statistical calculations using the functions given

image text in transcribed

image text in transcribed

In this project you should use C , you are expected to read data from the file, make some statistical calculations using the functions given on the read data set, and write these calculations to the file.

The first row of the Iris.csv dataset contains the index information of the Iris flower data. In Line 2 of the file, the following features of the Iris flower are given:

Id: Line number of the data in the file (It will not be taken into account when reading!)

SepalLengthCm: The length of the sepal

SepalWidthCm: The width of the sepal

PetalLengthCm: The length of the petal

PetalWidthCm: The width of the petal

Species: 3 different types of iris flower. These species are: Iris-setosa, Iris versicolor, Iris-virginica

In the given Iris.csv file, each record is separated by a comma (,). separated. Commas will be ignored when reading data.

Each line will be properly read from the file, with a structure variable you named IrisDataType. All the data in the file (except the Id column) will be kept in a dynamic array of type IrisDataType. The last column where the iris flower types are given will be labeled as (Iris-setosa=1, Iris-versicolor=2, Iris-virginica=3) with the appropriate data structure you will create and the reading operation will be from this data structure type.

Statistical calculations will be made by using the functions given below by taking the 150x4 feature matrix from the dynamic array IrisDataType that you created in the main() function.

Mean and variance values of SepalLengthCm, SepalWidthCm, PetalLengthCm and PetalWidthCm features, correlation of 3 feature pairs with each other and covariance matrix of feature matrixwill be calculated.

The accounts you made will be written to the "IrisStatistic.txt" file you created.

Functions:

float *returnVector(int size);

float **returnMatrix(int row, int col);

void freeMatrix(float **mat, int row);

float mean(float *vec, int size);

float variance(float *vec1, float *vec2, int size);

float covariance(float *vec1, float *vec2, int size);

float **matrixMultiplication(float **mat1, float **mat2, int row1, int col1, int row2, int col2);

float **matrixTranspose(float **mat, int row, int col);

float *rowMeans(float **mat, int row, int col);

float *columnMeans(float **mat, int row, int col);

float **covarianceMatrix(float **mat, int row, int col);

float determinant(float **mat, int row);

void printVector(float *vec, int N);

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database And Expert Systems Applications 22nd International Conference Dexa 2011 Toulouse France August/September 2011 Proceedings Part 1 Lncs 6860

Authors: Abdelkader Hameurlain ,Stephen W. Liddle ,Klaus-Dieter Schewe ,Xiaofang Zhou

2011th Edition

3642230873, 978-3642230875

More Books

Students also viewed these Databases questions

Question

You have

Answered: 1 week ago