Monitor the progress of model

r

#1

Hi All,

I am training a bootstrapped model having data frame 891 * 17

CtrlBoot <- trainControl(method = "boot", number = 1000) modelC50_titanic <- train(as.factor(Survived) ~., data = train, trControl = CtrlBoot, mrthod = "C5. 0")
How much time it will take to train the model? It is running from last one hour, is there any way to track the progress of completion ?

PC configurations
RAM: 4GB
Processor: i3@2.10GHz
HDD: 512GB
OS: Windows 7
Platform: Rstudio

Thanks in advance


#2

you can use progress bar function form the tcltk package in R , use the progress function before the model , it will show you progress of the model. :slight_smile:


#3

Adding to @HUNAIDKHAN2000 answer, there’s a great python package for monitoring progress called tqdm


#4

Thanks …i tried using the function but i am not able to implement it …it would be helpful if you can just show me with above code.


#5

@ajas.bakran : Below is the sample code how you can implement it .

Code :

library(tcltk)
total <- 20
# create progress bar
pb <- txtProgressBar(min = 0, max = total, style = 3)
for(i in 1:total){
  Sys.sleep(0.1)
  # update progress bar
  setTxtProgressBar(pb, i)
}
close(pb) 

Hope, now you can get the progress bar :wink:


#6

@HUNAIDKHAN2000: I was implementing the same code… :laughing:…but my question is like in sample code we have exit criteria total <- 20 so it is running till total and exiting the loop, till here i am able to implement without my model code.

But where exactly my line of code will be inserted or what will be the exit criteria for my code :sweat::sweat::sweat:

In above provided sample code, i dont think so we need “tcltk” package to load for TextProgressBar, correct me if i am wrong.

I know i am troubling you but i am totally new to this and trying to learn…please help…:worried:


#7

@ajas.bakran : You have to insert your code in for loop.Just before Sys.sleep.
The progress bar update after line by line execution, and after completion of code you progress bar will show you 100% complete
Please view my comment which i have done in @HUNAIDKHAN2000 code .

example:

library(tcltk)
total <- 20
# create progress bar
pb <- txtProgressBar(min = 0, max = total, style = 3)
for(i in 1:total){
 # Your model code
  Sys.sleep(0.1)
  # update progress bar
  setTxtProgressBar(pb, i)
}
close(pb)

#8

Thank you saurabh…