#labels must be a df loaded from label_summary run over avianz data (not raven)
function one_hot_labels(labels::DataFrame)
gdf = groupby(labels, :File)
vdf = []
for group in gdf
dur = first(group.duration)
nrows = dur ÷ 5
seil = nrows * 5
df = DataFrame(
file = [first(group.File) for x = 1:nrows],
start_time = collect(0:5:seil-1),
end_time = collect(5:5:seil),
)
for row in eachrow(group)
fst = st(row.start_time)
@assert fst >= 0
lst0 = et(row.end_time)
#end time must not be greater than duration
lst0 > dur ? lst = lst0 - 5 : lst = lst0
@assert lst <= dur
f_idx = fst ÷ 5 + 1 |> Int
l_idx = lst ÷ 5 |> Int
vect = [false for x = 1:nrows]
for idx = f_idx:l_idx
vect[idx] = true
end
col_name = row.Species
df[!, Symbol(col_name)] = vect
end
#(names(df) |> length) > 4 && println(df)
push!(vdf, df)
end
cdf1 = reduce(
(x, y) ->
outerjoin(x, y, matchmissing = :equal, on = intersect(names(x), names(y))),
vdf,
)
cdf2 = coalesce.(cdf1, false)
end