%%
% Function loads Mass Spectrograph Data Set
%
function [ds, sampleCount, lblDist] = load_dataset(dataset)   
    Base = ".";
    datasetPath = fullfile(Base, 'datasets', dataset);

    exts = {'.csv'};    
    ds = imageDatastore(datasetPath, ...
        'IncludeSubfolders',true, ...
        'FileExtensions', exts, ...
        'LabelSource','foldernames');
    
    lblDist = countEachLabel(ds);
    labelCount = numel(ds.Labels);
    sampleCount = numel(ds.Files);
    
    if labelCount ~= sampleCount 
        fprintf("Sample and Label Count Differ")
    else
        fprintf("All samples are labeled")
    end
end
