Questions tagged [mlr]

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

Filter by
Sorted by
Tagged with
2 votes
1 answer
67 views

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 ...
NDe's user avatar
  • 71
0 votes
0 answers
31 views

Tuning HPO with SVM, poor predictions mlr3

I'm trying to build a SVM learner to predict the target of my task. Here are my datas structure(list(PatientID = c("P1", "P1", "P1", "P1", "P1", "...
NDe's user avatar
  • 71
0 votes
1 answer
25 views

How can I use rsample for multiple mrl algorithms?

I have some difficulty using the function resample of mlr package, in my case for example. library(mlr) learners = makeLearners(cls = c("C50", "rpart","ada","...
royer's user avatar
  • 625
0 votes
1 answer
277 views

Assertion on 'task' failed: Must inherit from class 'Task', but has class 'data.frame'

I trained an XGBoost model using mlr package. I need to make a prediction on a test set that does not have the target variable. I should just predict the target variable. If I do this: testF.pred <-...
ebrahimi's user avatar
  • 912
0 votes
0 answers
29 views

Error in checkMeasures(measures, learner) : object 'fbeta' not found

I am doing an imbalanced classification task, so I want to use f-beta as performance measure. I used the library(mlr) to set measures=fbeta, which follows: library(mlr) #create tasks ## Create ...
ebrahimi's user avatar
  • 912
0 votes
0 answers
61 views

Multiclass classification measures in mlr

I have a multiclass classification problem with 4 classes and am training various learners on the data in mlr. I am using the multiclass wrapper with the default "onevsrest". As I understand ...
panda's user avatar
  • 831
0 votes
1 answer
34 views

Can the mlr package be used to make predictions based on data from a panel study?

I am planning to do a supvervised machine learning project where I use data from a longitudinal study (panel study). The goal is to use the 2004 and 2009 predictors to predict the 2014 outcomes. I ...
Mangus's user avatar
  • 5
0 votes
0 answers
21 views

Error while parallelizing mlr::resample function in R

I'm getting the error: Error in parallelMap(doResampleIteration, seq_len(rin$desc$iters), level = "mlr.resample", : Level 'mlr.resample' not registered while running this function: train....
IDK's user avatar
  • 359
0 votes
1 answer
97 views

Set hyper-parameters to tune with makeParamSet

I am running random forest classification in R with mlr package. I would like to tune the following hyper-parameters: number of trees, number of variables to consider at each split, terminal node size ...
kris's user avatar
  • 109
0 votes
0 answers
17 views

how to fill order arguments in multilabel in R - MLR package

I want to change the order in Classifier Chains multilabel classification makeMultilabelClassifierChainsWrapper(learner, order = NULL) how to fill order arguments ? except NULL
Dinda Galuh's user avatar
0 votes
1 answer
55 views

Why won't MLR package create the single classification task for my data?

I am having a similar issue as this person , but the link to the tutorial they reference seems broken and my problem is more related to a single classifying function, whereas most other posts on this ...
Shawn Hemelstrand's user avatar
1 vote
1 answer
98 views

Is there an R function to combine the results of 2 training data sets?

I have a 2.2 Million row dataset. RandomForest throws an error if I have a training data set with more than 1 000 000 rows. So I split the data sets in two pieces and the models learn seperately. How ...
user19338638's user avatar
0 votes
0 answers
47 views

What is happening in this R code? mlr learners

As part of a course we were given an example of a predictive maintenance (or maybe survival?) analysis. The first part of the code was all about data preprocessing which I understood, I´m just not ...
math_ist's user avatar
0 votes
0 answers
219 views

Apply the Random Forest Algorithm to a Dataset containing missing values

I would like to apply the Random Forest algorithm from the package mlr to a data set. This is the Zoo dataset from the package mlbench. data(Zoo, package = "mlbench") zooTib <- as_tibble(...
RKF's user avatar
  • 131
2 votes
0 answers
552 views

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 ...
Ali Alhadab's user avatar
0 votes
0 answers
58 views

How to Get Optimal Models From Benchmark For Prediction on Test Data

This question is applicable to both mlr and mlr3 but I only included the code for mlr since I have it handy. As an example, when we have 3 folds outer CV, we get 3 sets of optimal hyperparameters (...
Ali Alhadab's user avatar
0 votes
1 answer
1k views

How to manually set the range of coefficients on sklearn

I am trying to fit a regression equation of the following type in sklearn y=ax+bx^2+cx^3+dx^5....... I have a condition on the range of a i.e a should be between amin and amax. Is there a way to do it?...
Vishal Parmar's user avatar
0 votes
1 answer
85 views

How to Create Parametric Survival Learner for MLR in R

I am following the instructions (https://mlr.mlr-org.com/articles/tutorial/create_learner.html) to create a parametric survival learner to use with MLR. My code is below. When I try to make the ...
Ali Alhadab's user avatar
1 vote
1 answer
30 views

Can a resample result object be converted to BMR result object in MLR?

I want to convert resample result object to BMR result object and combine it with previous BMR result object? This is possible in MLR3 (as_benchmark_result() and $cobmine()) but not sure if it is also ...
Ali Alhadab's user avatar
0 votes
1 answer
55 views

Is there a way to add a Cutoff Parameter to makeParamSet() for 'classif.rpart' trees in the mlr package?

When making a parameter set for the randomForest model, I was able to use the following code to include cutoff values as parameters that are checked when doing a random search through the parameter ...
S J's user avatar
  • 31
0 votes
1 answer
179 views

Machine learning in R: Using MLR package survival filters in MLR3

I want to run a number of machine learning algorithms with different feature selection methods on survival data using the MLR3 package. For that, I am using the Benchmark() function of MLR3. ...
Mary B's user avatar
  • 13
0 votes
0 answers
105 views

How does the mlrMBO package optimize hyperparameters when no objective function is specified?

I am still very new to the mlrMBO package and hyperparameter tuning in general, so I apologize for the ignorance here. Previously I was using the makeTuneControlGrid() function for grid search ...
S J's user avatar
  • 31
-1 votes
1 answer
241 views

How to construct a learner or random forest regression in R [closed]

Example scripts for random forest using the mlr package are for classification problems. I have a random forest regression model for water contamination. I could classify the continuous target ...
BHope's user avatar
  • 135
3 votes
1 answer
102 views

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 <- ...
stats_noob's user avatar
  • 5,365
0 votes
0 answers
177 views

Lack of consistency in bayesian optimization of xgboost's hyperparameters using mlrmbo

I am trying to optimize the hyperparameters in an xgboost model using Bayesian optimization (mlrmbo R package). The code below seem to produce reasonable results, but the problem I keep facing is that ...
dean's user avatar
  • 31
0 votes
0 answers
150 views

Problem loading mlr package in R due to memory limit

I am trying to reproduce the example of Spatial interpolation / prediction using Ensemble Machine Learning for which I need to use the "mlr" package I have installed it and everything is ...
dovat_'s user avatar
  • 1
0 votes
1 answer
79 views

How to invert factor.levels of learner in R (mlr), so the output is the same order between different questions

thank you for supporting me with my question! I'm running the code for different questions (e.g "Yellow"/"notYellow", "Blue"/"NotBlue"...). In the end I would ...
bienexo's user avatar
  • 35
0 votes
1 answer
163 views

Why do I have more observations in my Multiple Linear Regression than I do rows in my dataframe in R?

I'm running an MLR in R examining the effects of 4 explanatory variables (Temperature, Dissolved Oxygen, Practical Salinity, and Oxidative Reductive Potential) on 1 response variable (Shell Roundness):...
Melissa's user avatar
1 vote
1 answer
347 views

AdaBoost algorithm Hyperparameter Tuning MLR

Im trying to tune the hyperparameters of the AdaBoost algorithm. The goal is to train a model with a multiclass classification variable as target. Im working with the MLR package in R. However, MLR ...
nelepi's user avatar
  • 27
0 votes
1 answer
114 views

Hyperparameter tuning; what parameter space for ML algorithms (rf, adaboost, xgboost)

Im trying to tune the hyperparameters of several ML algorithms (rf, adaboost and xgboost) to train a model with a multiclass classification variable as target. Im working with the MLR package in R. ...
nelepi's user avatar
  • 27
0 votes
0 answers
153 views

The predict() function is throwing an error even though model columns and data are identical

I currently have a model already trained and saved in MLR. I am trying to produce predictions on new data but it is not working properly and throwing this error: Error in predict.xgb.Booster(m, ...
peterni's user avatar
  • 13
0 votes
1 answer
236 views

How to use mlrMBO with mlr for hyperparameter optimisation and tuning

Im trying to train ML algorithms (rf, adaboost, xgboost) in R on a dataset where the target is multiclass classification. For hyperparameter tuning I use the MLR package. My goal of the code below is ...
nelepi's user avatar
  • 27
0 votes
0 answers
369 views

XGBoost hyper tuned parameters give a lower accuracy compared to the default model

Problem: XGBoost hyper tuned parameters give a lower accuracy compared to the default model. I have a question regarding the XGBoost algorithm. The goal is to predict a multiclass classification ...
nelepi's user avatar
  • 27
3 votes
0 answers
184 views

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, "...
Ana's user avatar
  • 115
1 vote
0 answers
601 views

Error in makeRegrTask: Assertion on 'id' failed: Must be of type 'string', not 'tbl_df/tbl/data.frame'

I have this strange error popping up when defining my mlr Random Forest (regression) Task. I cannot find anything online about this type of error. The error is: era.af.Al_Task <- era.af.Al_Tib %>...
Kamau Lindhardt's user avatar
0 votes
1 answer
147 views

Tuning hyperparameters in mlr does not produce sensible results?

I am trying to tune the hyperparameters in mlr using the tuneParams function. However, I can't make sense of the results it is giving me (or else Im using it incorrectly). For example, if I create ...
Electrino's user avatar
  • 2,676
0 votes
0 answers
307 views

Feature names stored in `object` and `newdata` are different! using mlr package

I am trying to make a multilabel classification model for XGBoost. I have one that works for RF, but when I try this code below for XGBoost I get the error: "Error in predict.xgb.Booster(m, ...
agnesg2g's user avatar
1 vote
0 answers
53 views

How to tune parameters using h2o DL with mlr?

I am trying to change some of the parameters for a h2o deep learner using mlr. Similar questions have been asked here and here. However, I'm still confused as to how to change some specific parameters....
Electrino's user avatar
  • 2,676
0 votes
0 answers
65 views

Combining Multi Class Wrapper with Sampling Wrappers in mlr to get subproblem specific sampling

I face an imbalanced multi-class classification problem I am working on using the mlr package: label samples A 232 B 657 C 221 D 154 I would like to use different machine learning algorithms to ...
jokokojote's user avatar
0 votes
1 answer
226 views

How to use tune parameters for multilabel classification in mlr?

problem I am trying to run a multilabel classification in r using mlr package. I used https://www.rdocumentation.org/packages/mlr/versions/2.19.0/topics/makeMultilabelClassifierChainsWrapper to ...
agnesg2g's user avatar
0 votes
0 answers
110 views

Warning "Unknown or uninitialised column: `ntree`." when trying to pass hyperparameters to a learner with package mlr

problem I want to do a grid search with different hyperparameters that are provided by a self-made grid. But when I am running the code I get a warning: "Unknown or uninitialised column: ntree.&...
agnesg2g's user avatar
0 votes
0 answers
377 views

How do I fix error in resample function in R

When I run the code below, I get an error: Error in resample(learner = knn, task = diabestertask, resampling = holdout, : Assertion on 'resampling' failed: Must inherit from class 'ResampleInstance',...
Li wen H's user avatar
0 votes
1 answer
85 views

R: plotting results with the ml3 library

I am using the R programming language. I am trying to replicate the plots from the following stackoverflow post using the "mlr" library: R: multiplot for plotLearnerPrediction ggplot objects ...
stats_noob's user avatar
  • 5,365
1 vote
1 answer
306 views

Setting the parameters for SVM Classification in R

Description: For a data set, I would like to apply SVM by using radial basis function (RBF) kernel with Weston, Watkins native multi-class. The rbf kernel parameter sigma must be tuned and I want to ...
adam's user avatar
  • 43
0 votes
0 answers
253 views

Relative variable importance from CoxBoost

I am fitting time-to-event survival data using surv.CoxBoost in the mlr package. My question: is there any way to get relative importance for the variables in the fitted model? I have seen this post ...
Amer's user avatar
  • 2,131
0 votes
2 answers
228 views

Different runtime for svm and ranger using the same task

I've bench-marked the runtime of the two learners and also took two screenshots of the {htop} while {ranger} and {svm} was training to make my point more clearer. As stated in the title of this post, ...
Sheykhmousa's user avatar
0 votes
1 answer
200 views

Parallelization on resampling within a stacked learner (ensemble/stack of classification learners) doesn't work

The below code works fine, however, I am interested to run it in parallel. I have tried different plans within future and future.apply but couldn't managed. Any help appreciated. I am running on ...
Sheykhmousa's user avatar
0 votes
1 answer
177 views

How can I use packages (e.g. glmnet) within mlr in R?

I want to reduce features and wanted to use an elastic net regression. Therefore, I wanted to use the glmnet-package and its built-in functions like cv.glment and plot the results etc. The problem is ...
koala's user avatar
  • 5
0 votes
0 answers
307 views

R: Wrap parts of environment with carrier::crate for prediction of new data

I want to deploy a machine learning model that was created using mlr. Therefor I tried wrapping the learned model's predictor applying carrier::crate() function: predictor <- carrier::crate( ...
K.O.T.'s user avatar
  • 111
0 votes
2 answers
111 views

In MLR, How to set Logical Hyperparameter to either TRUE or FALSE only?

I have this dataset to try to make a classification task using classif.ada library(mlr) data("HouseVotes84") #Using HouseVotes84 as Classification Task Dataset and mtcars as Regression Task ...
Jovan's user avatar
  • 783

1
2 3 4 5
7