1
$\begingroup$

I have GPS data on animal movements from 3 populations which record their position every hour. My hypothesis is that the 3 populations have distinct movement characteristics. I think a random forest would be a good way to determine this.

My issue is that I can generate metrics on different temporal scales. For instance, I can measure daily displacements but also monthly displacements, both of which would be informative.

The random forests I've seen seem to have covariates on the same scale though, so I was wondering if it's possible to combine them into the same model?

My data would look something like this though with a lot more covariates and of course I could have multiple daily distance measures:

ID daily_dist1 daily_dist2 monthly_dist population
bird1 4 4 13 1
bird1 6 5 67 1
bird2 3 6 34 1
bird2 4 7 64 1
bird3 6 3 75 2
bird3 6 2 13 2
bird4 4 2 56 3
bird4 1 5 56 3

Thanks

$\endgroup$
2
  • $\begingroup$ For random forests scaling is not required, scaling is usually required when there is penalization or gradients are involved. $\endgroup$ Commented Nov 29, 2022 at 9:58
  • $\begingroup$ Random forests are typically used for prediction rather than hypothesis testing $\endgroup$
    – Henry
    Commented Nov 29, 2022 at 10:35

1 Answer 1

2
$\begingroup$

(EDIT: I am answering with the assumption that in the future you want to be able to predict the bird population based on their movements. Otherwise, as mentioned in the comments, the use of RF might not be appropriate)

In general, this should not be a huge problem, and the monthly data could indeed bring the forest some very useful information.

It is however very important that you pay attention in the way you split you train-validation-test data to avoid target leakage:
rows that share the same information in a column should not belong to the train AND validate/test groups. For example, if you have the multiple rows for BIRD1 in the month of October 2022, they should all be either in the train, or in test/validate - otherwise the forest will learn to predict the population based on a value that is shared!

Many packages allow you to have some grouped sampling in order to set up your cross validation in the correct way. For the same reason, the OOB score should not be used in this scenario!

$\endgroup$
4
  • $\begingroup$ Thanks very much. I guess that is a related question in how I should format the data for random forest. If I have a month of data, I'd have 30 daily distances and 1 monthly distance but then the birds don't overlap in terms of what month we tracked them for. So do I define these by date e.g. some birds have a 1st October daily distance but others don't. $\endgroup$
    – adkane
    Commented Nov 29, 2022 at 13:51
  • $\begingroup$ Could you please detail bettee what your goal is, and how you compute the monthly column? It appears from your comment that the monthly value is taken from the daily movements of multiple birds in the same month - which makes me think you are indeed trying to do hypothesis testing rather than prediction as Henry suggested $\endgroup$
    – Davide ND
    Commented Nov 30, 2022 at 13:54
  • $\begingroup$ No, the monthly value would be per bird and would be based on the sum of distance travelled over the 30 days or so. The aim is to see if birds in the different areas can be classified to those areas based on what we think are distinct movement behaviours. $\endgroup$
    – adkane
    Commented Nov 30, 2022 at 14:11
  • 1
    $\begingroup$ ok then my first understanding was correct, I had misinterpreted the comment :) $\endgroup$
    – Davide ND
    Commented Nov 30, 2022 at 15:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.