JuliaAI / JuliaAI/DecisionTree.jl

Speed comparison with R

Open
#15 8 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Julia
Stars
364
Forks
100
PR merge metrics
No merged PRs in 30d

Description

Hello, I tried these two codes in Julia and R respectively:

Ytrain=rand(2000,1)
Xtrain=rand(2000,60)

addprocs(3)
using DecisionTree

@time model = build_forest(Ytrain[:,1],Xtrain,20,200,5,1)

library(randomForest)

X=replicate(60, runif(2000))
Y=runif(2000)

ptm <- proc.time()
rf=randomForest(X, Y, importance = FALSE, ntree=200,do.trace=0,nodesize=5)
proc.time() - ptm

In Julia it takes around 30 seconds and in R it takes around 10. I think that configuration of both "build_forest" and "randomForest" are the same (as rF takes one third of the variables for each node which is exactly 20). And as far as I know, rF in R cant use paralellization (at least this library cant) and Julia should be way faster than R.

So, what might be causing the difference in speed?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names the Julia build_forest call and the R randomForest call but no repository files or tests. Start by reproducing both snippets and verifying that their tree, feature, node-size, and parallelization settings match; done means identifying and documenting the cause of the timing difference.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia, r
Domain
machine-learning, performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.