Create dataset with class and variable labels

4 visualizaciones (últimos 30 días)
KG
KG el 11 de Oct. de 2013
Respondida: SGUNITN el 10 de Abr. de 2018
How do I create dataset for 24 variables with 150 observations (150 x 24 matrix) belonging to 5 classes (in the 25th column ) ? I need to create variable and class labels. I have tried to save the matrix (150x24)as .dat file but need help to create labels within the file. Please help!

Respuestas (1)

SGUNITN
SGUNITN el 10 de Abr. de 2018
Hi,
You can split your dat file into 2:
150 x 24 as a data.csv
150 x 1 as the labels.csv
data = csvread('data.csv'); % Read a 2 D datafile 150 x 24
labels = csvread('labels.csv'); % Read a 1 D labels 150 x 1
a = prdataset(data,labels); % Command to create PR Datasets
a = setprior(a,0); % Reset class prior probabilities of dataset
a(isnan(a)) = 0; % Ensure there is no 'not a number'

Categorías

Más información sobre Large Files and Big Data en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by