The banana dataset is included in this directory in banana_dataset.csv . The first column contains labels, and the remai
Posted: Sat Feb 19, 2022 3:20 pm
The banana dataset is included in this directory in banana_dataset.csv . The first column contains labels, and the remaining columns are two features. This is a comma- separated file, so you will need to use the keyword parameter delimiter=',' in np.loadtxt(). 0) Read in the data, and split out the test data. import numpy as np bdataset = np.loadtxt("banana_dataset.csv", delimiter=',') print("Shape of the bdataset: ", bdataset.shape ) Shape of the bdataset: (300, 3) bfeat = bdataset[:,1:] blabl = bdataset[:,] 1) Fit a support vector classifier with this data. 2) Choose hyperparameters y and C using validation set. 3) Choose hyperparameters y and C using 4-fold cross validation. 4) Check the final performance with the test set.
1 2.4334 3.352 1 1 -3.2396 0.45375 2 1 0.13938 4.0563 3 N 3.9115 -3.4965 4 1 -2.569 1.5221 5 N 3.3915 4.5878 6 1 1.9851 2.6224 7 1 2.3676 0.28626 8 N 2.0595 -5.7196 9 N 1.5485 5.925 10 1 0.23373 3.6432 11 1 -3.8208 1.2365 12 1 2.2347 -2.917 13 1 2.4776 -3.1183 14 2 -0.37768 1.6368 15 1 2.2801 1.8652 16 1 -0.43457 4.7782 17 1 2.1479 3.2924 18 N 6.0209 -1.4616 19 N -0.14719 2.2312 20 N 3.7698 4.5685