YunlongJiao / kendallkernel

Code to reproduce the experiments in the paper "The Kendall and Mallows Kernels for Permutations"
4 stars 2 forks source link

Sushi dataset #1

Open MichelangeloConserva opened 4 years ago

MichelangeloConserva commented 4 years ago

Good evening,

I am trying to use this code with the SUSHI dataset.

However I am not able to understand how to readapt the code.

# set list of #genepairs for corresponding models
max_nodes = 5000; npairs_out = 30;
npairs_list <- floor(exp(seq(0,1,length.out=npairs_out)*log(max_nodes)))
evenidx <- npairs_list %% 2 == 0
npairs_list[evenidx] <- npairs_list[evenidx] - 1 # keep odd numbers only
npairs_list <- unique(npairs_list)
names(npairs_list) <- paste('k',1:length(npairs_list),sep='')

This chunk of code is not clear to me. Could you expand on this?

Thank you very much.

jpvert commented 4 years ago

This is just to create a list of ~npairs_out=30 odd integers, between 1 and max_nodes=5000, regularly spaced in log scale. The result is the following list (note there are less than 30 numbers because equal numbers are merged together):

npairs_list k1 k2 k3 k4 k5 k6 k7 k8 k9 k10 k11 k12 k13 k14 k15 k16 k17 k18 1 3 5 7 9 13 17 25 33 45 61 81 109 147 197 265 355 477 k19 k20 k21 k22 k23 k24 k25 k26 639 857 1151 1543 2071 2777 3727 4999