Exercises
- The following are some growth-rate functional forms. Can you arrange them in the order of slower to faster performance?
- 10n3
- 3(log e n)2
- 10n
- 100n
- Log2n2
- Log2n3
- Log3n2
- Log3n3
- n1.5
- Answer the following questions:
- How can we evaluate the total memory currently being used by a given R environment? What is the purpose of garbage collection (GC) in the context of R?
- Which occupies more size-a matrix with 10 numbers of categorical attributes, or a dataframe with 10 numbers of corresponding factors?
- Can you evaluate and plot the memory allocation for dataframes and matrices with an increment of five observations for a fixed number of attributes (15 columns)?
- Why does
data.table
occupy more memory thandata.frame
?
- Is
data.table
scalable in terms of performance (faster execution of operations) related to data pre-processing and transformations?(Hint:
microbenchmark
using large number of variables and observations with a higher number of iterations for each scenario). - What are the best, worst, and average...