public Datasets(CommonParameters cp, DatasetParameters dp, DataDense trainData, DataDense validData) { Common = cp; Dataset = dp; Training = LoadTrainingData(trainData); if (validData != null) { Validation = LoadValidationData(Training, validData); } }
private Dataset LoadTrainingData(DataDense trainData) { if (trainData == null) { throw new ArgumentNullException(nameof(trainData)); } trainData.Validate(); // TODO: not parallelised, better off to concat data and pass in as a single matrix? Dataset dtrain = CreateDatasetFromSamplingData(trainData, Common, Dataset); return(dtrain); }
/// <summary> /// Create a dataset from the sampling data. /// </summary> private Dataset CreateDatasetFromSamplingData(DataDense data, CommonParameters cp, DatasetParameters dp) { var dataset = new Dataset(data.Features , data.NumColumns , cp , dp , data.Labels , data.Weights , data.Groups ); return(dataset); }
private Dataset LoadValidationData(Dataset dtrain, DataDense validData) { if (validData == null) { throw new ArgumentNullException(nameof(validData)); } validData.Validate(); var dvalid = new Dataset(validData.Features , validData.NumColumns , Common , Dataset , validData.Labels , validData.Weights , validData.Groups , dtrain ); return(dvalid); }