You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When registering a model within an estimator run, the register_model function does not include the current runID or experiment in the model repository.
To Reproduce
Inside train.R
# This script loads a dataset of which the last column is supposed to be the
# class and logs the accuracy
library(azuremlsdk)
library(caret)
library(optparse)
options <- list(
make_option(c("-d", "--data_folder"))
)
opt_parser <- OptionParser(option_list = options)
opt <- parse_args(opt_parser)
paste(opt$data_folder)
all_data <- read.csv(file.path(opt$data_folder, "iris.csv"))
summary(all_data)
in_train <- createDataPartition(y = all_data$Species, p = .8, list = FALSE)
train_data <- all_data[in_train, ]
test_data <- all_data[-in_train, ]
# Run algorithms using 10-fold cross validation
control <- trainControl(method = "cv", number = 10)
metric <- "Accuracy"
set.seed(7)
model <- train(Species ~ .,
data = train_data,
method = "lda",
metric = metric,
trControl = control)
predictions <- predict(model, test_data)
conf_matrix <- confusionMatrix(predictions, test_data$Species)
message(conf_matrix)
log_metric_to_run(metric, conf_matrix$overall["Accuracy"])
dir.create('outputs')
saveRDS(model, file = "./outputs/model.rds")
dir('outputs')
message("Model saved")
run <- get_current_run()
ws <- run$experiment$workspace
model <- register_model(ws, model_path = "./outputs/model.rds", model_name = "modelwithinestimator.rds",
tags=list("type"="remotecompute", "who"="julian"), description="julian-test-model")
message("Model registered to workspace")
train.R is called within an estimator as follows
est <- estimator(source_directory = ".",
entry_script = "train.R",
script_params = list("--data_folder" = ds$path(target_path)),
compute_target = compute_target,
environment = refreshEnvironment)
experiment_name <- "train-r-script-on-registermodel"
exp <- experiment(ws, experiment_name)
# Submit job and display the run details
run <- submit_experiment(exp, est)
Expected behavior
ExperimentID and RunID should be included when register_model is executed (similar to python)
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered:
Describe the bug
When registering a model within an estimator run, the
register_model
function does not include the current runID or experiment in the model repository.To Reproduce
Inside
train.R
train.R
is called within an estimator as followsExpected behavior
ExperimentID and RunID should be included when register_model is executed (similar to python)
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: