Question: Must be done in Python or MATLAB In a multi-class classification problem, there are multiple classes in the dataset, but each data sample can belong
Must be done in Python or MATLAB


In a multi-class classification problem, there are multiple classes in the dataset, but each data sample can belong to only one class. Multi-label classification is a generalization of multi-class classification, where each data sample can belong to multiple classes simlutaneously. For instance, consider the problem of classifying an outdoor image of a scene. Suppose the possible classes are beach, mountain, field and sunset. It is possible for a particular image to contain both beach and mountain or beach, mountain and sunset all together. The objective of multi-label learning is to predict all the classes present in a data sample. The Scene dataset consist of 2407 images of an outdoor scene, where each image is represented by a feature vector of dimesnion 294. Also, there are 6 classes in the problem and an image can belong to one or more of the 6 classes. The dataset has been divided into a training set (with 1500 samples) and a test set (with 907 samples). Each row of X_train and X_test denotes a sample and each column denotes a feature. Each row of ytrain (y_test) denotes the labels of the corresponding training (testing) sample, where 1 means the class is present and 0 means the class is absent. For instance, in the training set, sample 462 belongs to classes 4 and 5 . One strategy to solve a multi-label learning problem is to train an SVM separately for each class. To predict a test sample, each SVM is applied separately on it. A positive output indicates that the corresponding class is present and a negative output indicates that it is absent. The accuracy in the multi-label setting is computed as follows: i) For each test sample, compute the quantity A=TPTP where T is the true class label vector of a test sample and P is the predicted class label vector. The numerator denotes the number of entries in which both T and P have a value 1 (positive prediction) and the denominator denotes the number of entries in which at least one of T and P have a value 1 ii) Average this value over all the test samples to compute the final test accuracy Train an SVM classification model on the training set and test on the test set. Report the percentage accuracy on the test set using the following classification models: (i) SVM with polynomial kernel with parameter 2 and (ii) SVM with Gaussian kernel with parameter 2. In a multi-class classification problem, there are multiple classes in the dataset, but each data sample can belong to only one class. Multi-label classification is a generalization of multi-class classification, where each data sample can belong to multiple classes simlutaneously. For instance, consider the problem of classifying an outdoor image of a scene. Suppose the possible classes are beach, mountain, field and sunset. It is possible for a particular image to contain both beach and mountain or beach, mountain and sunset all together. The objective of multi-label learning is to predict all the classes present in a data sample. The Scene dataset consist of 2407 images of an outdoor scene, where each image is represented by a feature vector of dimesnion 294. Also, there are 6 classes in the problem and an image can belong to one or more of the 6 classes. The dataset has been divided into a training set (with 1500 samples) and a test set (with 907 samples). Each row of X_train and X_test denotes a sample and each column denotes a feature. Each row of ytrain (y_test) denotes the labels of the corresponding training (testing) sample, where 1 means the class is present and 0 means the class is absent. For instance, in the training set, sample 462 belongs to classes 4 and 5 . One strategy to solve a multi-label learning problem is to train an SVM separately for each class. To predict a test sample, each SVM is applied separately on it. A positive output indicates that the corresponding class is present and a negative output indicates that it is absent. The accuracy in the multi-label setting is computed as follows: i) For each test sample, compute the quantity A=TPTP where T is the true class label vector of a test sample and P is the predicted class label vector. The numerator denotes the number of entries in which both T and P have a value 1 (positive prediction) and the denominator denotes the number of entries in which at least one of T and P have a value 1 ii) Average this value over all the test samples to compute the final test accuracy Train an SVM classification model on the training set and test on the test set. Report the percentage accuracy on the test set using the following classification models: (i) SVM with polynomial kernel with parameter 2 and (ii) SVM with Gaussian kernel with parameter 2
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
