بنقرة واحدة
microbenchmark
R microbenchmark package for precise timing. Use for sub-millisecond accurate timing of R expressions.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
R microbenchmark package for precise timing. Use for sub-millisecond accurate timing of R expressions.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
R language data analysis and visualization skill. Use when user asks to (1) run R scripts or code, (2) install/update R packages, (3) perform data analysis with R, (4) create visualizations with ggplot2/plotly, (5) statistical analysis, (6) data manipulation with tidyverse/dplyr/data.table. Triggers on keywords like "R语言", "R脚本", "ggplot", "tidyverse", "数据分析", "可视化".
R DALEX package for model explanations. Use for explaining complex machine learning models.
R iml package for interpretable ML. Use for model-agnostic interpretability methods.
R lime package for local explanations. Use for explaining individual predictions with local interpretable models.
R packages for ML interpretability. Use for explaining and interpreting machine learning models.
R vip package for variable importance. Use for computing and visualizing variable importance scores.
| name | microbenchmark |
| description | R microbenchmark package for precise timing. Use for sub-millisecond accurate timing of R expressions. |
Accurate timing functions.
library(microbenchmark)
# Benchmark expressions
microbenchmark(
sqrt(x),
x^0.5,
exp(log(x)/2)
)
microbenchmark(
sqrt(x),
x^0.5,
times = 100, # Number of evaluations
unit = "ms", # Time unit
check = "equal", # Check results equal
control = list(
order = "random", # Randomize order
warmup = 10 # Warmup iterations
)
)
microbenchmark(
"sqrt" = sqrt(x),
"power" = x^0.5,
"exp_log" = exp(log(x)/2)
)
microbenchmark(
sort(x),
order(x),
setup = {
x <- runif(1000)
}
)
results <- microbenchmark(
sqrt(x),
x^0.5
)
# Summary
summary(results)
# As data frame
as.data.frame(results)
# Print with unit
print(results, unit = "ms")
# Autoplot (requires ggplot2)
library(ggplot2)
autoplot(results)
# Boxplot
boxplot(results)
# Violin plot
autoplot(results) +
geom_violin()
# Compare implementations
f1 <- function(x) sum(x)
f2 <- function(x) Reduce(`+`, x)
x <- 1:1000
microbenchmark(
f1(x),
f2(x)
)
# Available units
# "ns" - nanoseconds
# "us" - microseconds
# "ms" - milliseconds
# "s" - seconds
print(results, unit = "relative") # Relative to fastest
results <- microbenchmark(expr1, expr2)
# Access statistics
summary(results)$min
summary(results)$mean
summary(results)$median
summary(results)$max
summary(results)$neval