From 50bff5cabfaabaf17b8e5025c0ba1a67998cc916 Mon Sep 17 00:00:00 2001 From: jakewindle47 Date: Wed, 14 Aug 2019 10:15:24 -0400 Subject: [PATCH] Work on generating random candidates --- Experiment.jl | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Experiment.jl b/Experiment.jl index 6aa13a2..e4fc84e 100644 --- a/Experiment.jl +++ b/Experiment.jl @@ -11,7 +11,6 @@ for i = 1:length(header) header[i] = tmp end header = dropdims(reshape(header, :, 1), dims=2) - df = DataFrames.DataFrame() # Finally, construct our dataframe @@ -33,4 +32,13 @@ function search(candidates) parents = candidates[1:3] end -search(generateCandidatePool()) \ No newline at end of file +function randRow() + # Generate a random row index + abs(rand(Int) % size(df, 1)) +end + +function randomCandidate(n) + # Select n random rows from the dataset. + rows = [randRow() for i = 1:n] + df[rows, :] +end \ No newline at end of file