Comments (6)
Ah, excellent, thanks for the tip. I will also eventually have to update to R v4, but have been a bit hesitant to do so fearing it will break all my scripts.
Thanks again for the help!
from mikropml.
I wasn't able to reproduce the error with R 4.0.3 and mikropml 1.1.0, nor with your versions of the software (expect I had to use future.apply 1.7.0 because 1.8.1 requires R >= 4). Can you provide the code that reproduced the error using the otu_mini_multi
dataset?
Here's the code I used for testing:
library(mikropml)
ml_results <- run_ml(otu_mini_multi,
"glmnet",
outcome_colname = "dx",
find_feature_importance = TRUE,
seed = 2019,
cv_times = 2
)
And here's how I created the conda environment with your software versions:
mamba create -n R-3.6.1 r-base=3.6.1 r-caret=6.0-88 r-mikropml=1.0.0 r-future.apply
from mikropml.
Thanks for following this up. Interesting... if I use your exact code it works. However, if I generate the otu_mini_multi from the otu_large_multi.csv file, I get the error. See my code below:
library(mikropml)
otu_large_multi <- read.delim("otu_large_multi.csv", sep = ",")
otu_mini_multi <- otu_large_multi[, 1:11]
ml_results <- run_ml(otu_mini_multi,
"glmnet",
outcome_colname = "dx",
find_feature_importance = TRUE,
seed = 2019,
cv_times = 2
)
Using 'dx' as the outcome column.
Training the model...
Training complete.
Finding feature importance...
Error in calc_perf_metrics(test_data, trained_model, outcome_colname, :
subscript out of bounds
In addition: Warning messages:
....
Both datasets seem to be identical, so not sure what is going on.
from mikropml.
I seem to have figured it out. If I read in the file with "stringsAsFactors = FALSE" it works. If I recall correctly this is the default in R v4 now, so this might have been the reason.
from mikropml.
Ahh stringsAsFactors
strikes again! Glad you figured it out.
from mikropml.
By the way, you can also instead read in the file with readr::read_csv("otu_large_multi.csv")
. It won't convert strings to factors unless you explicitly specify the col_types
. https://readr.tidyverse.org/reference/read_delim.html
from mikropml.
Related Issues (20)
- Need function to compare models HOT 5
- grouped features are not always in the same order
- Providing case weights HOT 4
- Conversion of numeric outcomes to character error HOT 1
- Warning message about '%dorng%' vs '%dopar%' when run in parallel HOT 2
- Report p-values for permutation importance
- classification of new (and outcome unknown) samples HOT 1
- use which run_ml() output to plot ROC curve? HOT 2
- Impute missing values after the train/test split
- Refactor `select_apply()`
- Use hyperparams from `rf` for `parRF`
- meta-analysis using mikropml?
- NaN as character causes some problems HOT 3
- Extracting weights from 100 iterations and from random random forset model HOT 1
- Report confidence interval for permutation feature importance
- Create function to bootstrap the test set to get a confidence interval for performance
- Switch from {future.apply} to {furrr} where possible HOT 1
- roxygen2 docs: switch `@noRd` to `@keywords internal` for all internal functions
- Calculate the area under the balanced precision-recall curve (AUBPRC)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mikropml.