Kiyoshika / CppEZML

A work in progress C++ machine learning library designed to be very easy to use. Everything pretty much written from scratch.
0 stars 0 forks source link

DataSet.h - sample() #17

Closed Kiyoshika closed 3 years ago

Kiyoshika commented 3 years ago

Allow to sample with or without replacement from a data set.

Kiyoshika commented 3 years ago

Implemented.

#include <iostream>
#include <vector>
#include "data/DataSet.h"

using namespace std;

int main() {

    DataSet data, sample;

    data.load("xtrain.csv");
    sample = data.sample(10); // without replacement
    sample = data.sample(10, true); // with replacement

    return 0;
}