Questions tagged [mlr]

mlr is a machine learning package for R that provides an interface to many other packages.

mlr is an R package that provides a standardized API to many of R's machine learning packages. On top of that, it offers resampling, feature selection, automatic tuning, cost-sensitive learning and much more. Its website can be found at https://github.com/mlr-org/mlr/

328 questions
3
votes
1 answer

R Error: unused argument (measures = list("f1", FALSE, etc)

I am trying to use the "mlr" library in R and the "c50" algorithm on the iris dataset (using the F1 score as the metric) : library(mlr) library(C50) data(iris) zooTask <- makeClassifTask(data = iris, target = "Species") forest <-…
stats_noob
  • 5,401
  • 4
  • 27
  • 83
3
votes
0 answers

mlr3 Error: Cannot combine stratification with grouping

Code Example: # BLOCKING by "userID" task$col_roles$group = "userID" # Remove "userID" from features task$col_roles$feature = setdiff(task$col_roles$feature, "userID") # STRATIFICATION (by Target Variable!) task$col_roles$stratum =…
Ana
  • 115
  • 6
3
votes
1 answer

Get access to regression train model

I got an exercise, where I need to train a linear regression model and get some information about the model: linear relationship between my chosen variable and the other variables which variables are important for the model significance It´s easy…
Mel Latour
  • 43
  • 6
3
votes
1 answer

How does the wrapper normalizeFeatures behave with a validation set?

I am wondering how the function normalizeFeatures works along with a resampling strategy. Which of these statements is true? The whole task data is normalized The training data is normalized, and the parameters of that normalization (let's say,…
lordbitin
  • 185
  • 1
  • 9
3
votes
0 answers

Noisy optimization problem not well solved (by mlrMBO)

I am trying to minimize a simple noisy function: function(x,prec=10){x^2+rnorm(1)/(prec)} The noise is moderate, i.e., it should be fairly easy to find the optimum at 0. What I consider important here, is that the noise is independent, i.e.,…
sheß
  • 484
  • 4
  • 20
3
votes
1 answer

mlr : Avoiding data leakage in cross validation

I am using mlr for my machine learning project. I am using 5-fold cross-validation repeated 5 times and a number of different algorithms. I am imputing the missing data using MICE (multiple imputation for chained equations). I also need to…
panda
  • 821
  • 1
  • 9
  • 20
3
votes
1 answer

mlr package: Cross-validation with tuneParams() and resample() yield different results

I try using tuneParams() and resample(), both of which are from mlr package, to double check my cross-validation RMSE. However, I could not get the 2 functions to yield the same result. Tune parameters by mlr package: train <-…
John
  • 71
  • 2
  • 6
3
votes
1 answer

What does the warning "NA used as a default value for learner parameter missing" mean in mlr?

I am running a classification xgboost via the mlr package. I have missing values in my data, which I would like to preserve (that is, I would like to keep these observations and I would like to avoid imputation). I understand that the xgboost…
PBB
  • 131
  • 1
  • 7
3
votes
1 answer

How to plot a decision tree horizontally in R Markdown?

In R Markdown, I would like to plot a decision tree horizontally, so that it fits better the entire PDF page. This code plots it vertically: ```{r, message=FALSE, warning = FALSE, echo=FALSE, cache = FALSE} rpart.lrn <- makeLearner("classif.rpart",…
Javide
  • 2,477
  • 5
  • 45
  • 61
3
votes
1 answer

How to preprocess newdata for prediction using the mlr package

If I want to make a prediction on new data using the mlr package, how can I preprocess the new data so that the information necessary from the preprocessing of the original data is being used. E.G. if I merge small factor levels and the frequencies…
tover
  • 535
  • 4
  • 11
3
votes
2 answers

How can a blocking factor be included in makeClassifTask() from mlr package?

In some classification tasks, using mlr package, I need to deal with a data.frame similar to this one: set.seed(pi) # Dummy data frame df <- data.frame( # Repeated values ID ID = sort(sample(c(0:20), 100, replace = TRUE)), # Some…
Enrique Pérez Herrero
  • 3,699
  • 2
  • 32
  • 33
3
votes
2 answers

Error while running the predict() function in mlr package

I'm trying to run a model with the mlr package but I'm having some problems with the predict() function. It gives me the following error message: Error in predict(mod, task = task, subset = test) : Assertion on 'subset' failed: Must be of type…
danilofreire
  • 503
  • 1
  • 5
  • 18
2
votes
1 answer

p-values for optimization on validation set MLR

I have optimized some algorithms (in mlr3) on a validation set : random forest xgboost svm I have extracted the balanced accuracy of each algorithm but I'd like to know if there is a possibility to have the p-values of each prediction versus…
NDe
  • 71
  • 6
2
votes
0 answers

Difference in Computation Speed and Results Between MLR and MLR3

I don't get similar results when I use the same data and models using mlr and mlr3. Also I find mlr runs at least 20-fold faster. I used lung data from survival and I was able to replicate the difference in computation speed and results since I…
Ali Alhadab
  • 101
  • 5
2
votes
1 answer

Error with mlrMBO rBayesianOptimization of R keras model through caret

I am trying to implement a Multi-layer Perceptron through the Keras package (and tensorflow) to run a fast MLP. I want to use Bayesian Optimization to train the algorithm's hyperparameters. I get an error message though, saying "ValueError: rate is…
Noah Hammarlund
  • 103
  • 1
  • 10
1
2
3
21 22