Azzera filtri
Azzera filtri

Split data into training and validation sets

17 visualizzazioni (ultimi 30 giorni)
Hello I am trying to split this data into a 70% and 30% partition with 70% stored for training and 30% for validation for training a neural network. Any help would be greatly appreciated.
data =readtable('EURUSD=X.csv');
%training = first 70% of data
%testing = last 30% of data

Risposta accettata

the cyclist
the cyclist il 27 Dic 2022
There are several ways to do this. (I'm curious if you even tried to google this, because there are many answers online.)
Here is one way. There are perhaps more elegant ways, if you have the Statistics and Machine Learning Toolbox. (For example, you could use the cvpartition function.)
numberObservations = height(data);
randomizedIndices = randperm(numberObservations);
numberTraining = floor(0.7*numberObservations);
dataTraining = data(randomizedIndices(1:numberTraining),:);
dataTest = data(randomizedIndices(numberTraining+1:end),:);

Più risposte (0)

Categorie

Scopri di più su Sequence and Numeric Feature Data Workflows in Help Center e File Exchange

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by