Questions tagged [r]
R is a free, open-source programming language and software environment for statistical computing, bioinformatics, and graphics.
1,479
questions
0
votes
1
answer
14
views
As an intermediate R programmer looking to dive into machine learning, should I choose Python or stick with R?
Background
I am an intermediate R programmer with some experience in machine learning concepts and simple modeling in R. I have an opportunity to collaborate with a professional machine learning team ...
0
votes
1
answer
16
views
Learning material for R
I am looking for learning material for R (including base R & tidyverse approaches (with a focus on readr, dplyr & tidyr)) and data visualisation using ggplot2 library for commercial teaching ...
0
votes
0
answers
13
views
Plot a combined stacked and clustered bar graph showing mutually- and non-mutually exclusive data in R
I am looking to make a stacked bar graph showing mutually exclusive categories of data. One of these categories should be further broken down into non-mutually exclusive sub-categories. I feel this ...
0
votes
0
answers
11
views
Is there a way to create a bootstrapped beta calibration function to use on new data?
I have created ML classification models that are now to be evaluated on a different population for external validation (n=5000, event rates between n=400 and n=1200 for different outcomes under study)....
1
vote
1
answer
35
views
Guidelines for image recognition model (inventory purposes)
I have 20,000 plus images of art (paintings, sculptures, jars, etc) stored in a data base. The actual pieces are distributed in multiple warehouses. Ideally, the physical pieces SHOULD have a sticker ...
0
votes
1
answer
36
views
cor() function in R returns NA when given two integers or continuous values
Using R version 4.4.0, I was using the cor() function and originally inputting two continuous values to obtain a default calculated correlation. NA is returned instead of a numeric. I'm able to ...
1
vote
0
answers
28
views
What informatics tools will allow complex search in order to select full-text articles?
I'd like to search plant science literature (full text) to only return articles in which the word "three" appears four or more times in the full-text Methods section (presumably the best ...
1
vote
0
answers
11
views
Use a metric that is not available in the list of metric for xgboost
Working in R.
I am following this post on stack overflow.
I am train an xgboost model and I want to use another metric that is not in the list of metric we can whoose for the eval_metric parameter.
I ...
0
votes
0
answers
10
views
Fequency encoding in R while using a cross validated model: How to use step_lencode_mixed()
One way of addressing high cardinality in a column is the use of frequency encoding. However, if you use a cross validated analysis plan the you would need to re-encode the column at each step.
It's ...
1
vote
0
answers
41
views
Why do I get missing value error in XGBoost when it is supposed to be supported?
I read that in the latest versions of XGBoost, the model can handle missing values. I am using the model on some data that contains for example, the BMI, bloodpressure, age, binary data (yes/no) and ...
0
votes
1
answer
23
views
Error in f1(x) : argument "y" is missing, with no default
f <- function(x,y){2x^2(y-2)^2+6xy}
integrate(f, -2, 4)
#Error in f1(x) : argument "y" is missing, with no default
0
votes
1
answer
17
views
Struggling with normalization/Standardisation for machine learning dataset
Sorry for what is probably a very obvious/rookie question. I'm currently doing a data science module for my degree and making very slow progress with the work.
The case study i'm doing is around HR ...
1
vote
0
answers
10
views
Checking MixedModel convergence in Julia
I'm trying to teach myself how to use Julia as an alternative to R, and was running into some trouble with checking convergence of a MixedModel object. In R, if I use the following code
...
0
votes
0
answers
13
views
How can I combine/pool of the results of regression with neural network?
My study has ten imputed dependent variables (plausible values). After separately analyzing each dependent variable using a regression neural network (NN), I must combine/pool the results. I tried ...
0
votes
0
answers
15
views
How to get probability of an outcome from skewed t distribution in R
I am trying to calculate the probability of stock return to be greater than X in next 28 days, using the skewed t-distribution as it fits the best to the ...
0
votes
1
answer
15
views
lookup tables with multiple (possibly partly empty key columns) - prefer specific match over general one
Assume I have a table with samples:
ID
sample type
origin
project_l1
project_l2
project_l3
...
1
DNA
Blood
p1
p1.1
p1.1.1
p1...
2
DNA
Blood
p1
p1.1
p1.1.2
p1...
3
DNA
Blood
p1
p1.1
4
DNA
Blood
p1
...
0
votes
0
answers
10
views
0
votes
0
answers
11
views
What is the best visualization to demonstrate Likert proportion differences between treatment groups?
I ran a survey experiment a month or so ago and have been struggling to find the best way to visualize the proportions of Likert responses between the control and treatment groups. Brief context for ...
2
votes
0
answers
34
views
Best practices for handling "NA" when all NA values exist due to being below the limit of detection?
I am working in R, and have a data set which has a few metabolite concentration values as continuous variables. Anywhere that the concentration was too low to be detected it simply says <LOD. This ...
0
votes
0
answers
14
views
Evaluation of the loss function
Why the three evaluations of the loss in the following code do not agree?
...
0
votes
0
answers
15
views
How to correctly use gstar package of R for spatio-tempral analysis?
I want to perform a spatio-temporal analysis by highlighting spatial as well as temporal dependencies of the data (I have a 'weight matrix' highlighting spatial dependencies of the counties) on the ...
0
votes
0
answers
33
views
sklearn Random Forest classifier vs R’s Random Forest classifier
I’m trying to implement the R’s random forest classifier equivalent in python-
...
0
votes
1
answer
97
views
ROC curve manual calculation vs. pROC package R
I want do recreate ROC curve manually on my dataset and compare it to roc function from pROC package in R. I'm using dataset on customer churn telco.csv from Kaggle....
0
votes
1
answer
91
views
Should I choose an ARIMA model (2,1,1) with a higher AIC value or an ARIMA model (6,1,8) with a lower AIC value?
I am trying to fit an ARIMA model to time series data. When I fit the model using auto.arima function in R, ...
0
votes
0
answers
25
views
5-fold cross validation in R: getting error Age variable different lengths
I am tasked to do a 5-fold cross validation for my R grad course with pga golf data. I continually get an error for a certain variable, Age, saying different lengths. Here is the error code:
...
0
votes
0
answers
15
views
How to visualize correlation values coming from two data frame for comparison
I am working on a project wherein we are comparing two methods used for modeling gene expression.
One method is using elastic net and other is using lasso regression.
In one method: we see that ...
1
vote
1
answer
133
views
Packages for Density Estimation using K-Nearest Neighbor
I would like to have suggestions for packages that provide K-Nearest Neighbor density estimator, I've already searched the web (to not bother you guys with my question :) ), but most results were ...
0
votes
1
answer
39
views
Selecting optimal regression model using cross validation
I have a logistic mixed model (lme4 package in R). I want to assess whether participants scores on the measures 'sumspq', 'sumpdi', and 'sumcaps' significantly affect the difference in performance ...
0
votes
0
answers
28
views
How to reduce number of continuous variables before I make a set of best predictors (for handgrip strength in women)
My assignment question is quoted: "2. Which set of variables best predicts handgrip strength in women? a. Reduce the number of continuous variables before doing the analysis."
I do not ...
0
votes
0
answers
82
views
R [Warning] No further splits with positive gain, best gain: -inf in lightgbm training
I read through some answers, it seems many people face this message before.
The answer seems there is no further need to split the tree, so you need to adjust the super parameter to make new splitting....
0
votes
0
answers
33
views
R, Caret Predict(), and errors
So I've been playing around with/testing out a few ideas. I just wasn't sure though if there is a simple command you can use to have caret like send you back a list (or data.frame) of all the errors ...
0
votes
0
answers
33
views
Algorithms from R-statistics package Caret R Package- LVQ algorithm, is there similar in Python
In the R-statistics package : Caret R Package, they have the LVQ algorithm that is used
for the purpose of "Feature Selection".
I have used this to do some data science in R-stats over 6 ...
0
votes
1
answer
25
views
Working with functions [closed]
What are some good sources for learning how to deal with functions in Python and R. I have used them a lot of times and they can be a bit challenging. I like to write out a plan of what I want done ...
1
vote
1
answer
22
views
Question regarding coefficents regarding linear modeling in R
I had a question regarding the composition of coefficents of a linear model in R.
Let's say my model is as follows, with three columns/independent variables: X, Y, and Z.
And my model is: (X * Z) + (Y ...
0
votes
0
answers
19
views
Top hundred nearest neighbour
I have a dataframe with a column called pharmacy number and other columns corresponding to each pharmacy number, there many rows and each row corresponds to pharmacy number. I want to create a ...
1
vote
2
answers
190
views
Does it make sense to tune a model in scikit-learn and copy/paste the parameters into Rust's linfa?
I have a situation where my data can only be read from in a hosted Python environment, due to data security reasons. However, I am constrained to run ML models in a Rust environment due to work-...
0
votes
1
answer
24
views
Does anyone know if I have written this mixed model correctly in lme4?
All effects should be random except Genotype. Index is a plant trait.
Model from literature: Index=OverallMean+Location+Rep(Location)+Genotype+Location*Genotype+error
Model as I have written in lme4:
...
0
votes
0
answers
6
views
R lm log v log log for asymptotic fit
I have data from a "bleed" experiment. That is, I fill a chamber with a gas that I can measure precisely (say, methane), and then just let it sit. The chamber has a natural bleed rate, which ...
0
votes
0
answers
12
views
Interpreting large discrepancies between Specificities & the # of Extraneous Variable Models selected by a variable selection algorithm
I am going to preface my question by saying that this problem of interpretation I have run into is in the context of me doing my part as a collaborator on a statistical learning paper for the first ...
0
votes
0
answers
38
views
Calculate the curve of a list and apply that to calculate the values of a larger list
I have a list of ~125 sorted ascending values and I am converting those to percentages of total so that they add up to 100% (shortened example would be: 0%, 0%, 15%, 15%, 30%, 40% with the total of ...
0
votes
0
answers
26
views
How to solve starting values problem in midas in R?
I am running the following code.
...
0
votes
0
answers
70
views
Unable to create associations using Apriori association rule algorithm for my dataset where the support is 0.01, confidence=0.8 and maxlen=10
Here's the code that I'm using:
library(arules)
library(arulesViz)
library(tidyverse)
library(readxl)
library(knitr)
library(ggplot2)
library(lubridate)
library(plyr)
library(dplyr)
tr <- read....
0
votes
2
answers
980
views
Help with R - funModeling package no longer available, need help downloading older version
I have posted on GitHub but I'm not getting a response as quickly as I would like so I figured I'd seek help on multiple forums/websites. I am trying to do a few sample mean exercises from a textbook '...
0
votes
0
answers
74
views
Correlation in R between categorical and boolean variables
I want to use the data attached to see i there is correlation between a bootcamp that students attended and the job they end up getting. For example, does someone who attended a software engineering ...
0
votes
0
answers
91
views
Trouble With Keras in R
I am using Rstudio on windows 11 trying to install and use keras for deep learning. Following the instructions from the ISLR2 book for installing dependencies (https://hastie.su.domains/ISLR2/keras-...
0
votes
0
answers
100
views
How to simulate from bivariate time series using VAR in R?
Background
I've run into a problem while trying to simulate from an existing time series using a VAR. My aim is to simulate future "trajectories" which I'd like to integrate in an existing ...
0
votes
0
answers
86
views
Prediction in multiclass classification
Context: I need to make an multiclass classification to predict what type of sentence(law) the case will have in the end.
Data: I Have several columns to predict the case:client, cause of action, ...
0
votes
0
answers
37
views
0
votes
0
answers
39
views
How do I group data to have a similar range of levels?
Background
I am working on a procurement bid where we are purchasing a number of different vehicle types for our various locations. As part of the analysis, I want to plot the prices of vehicle type ...
0
votes
0
answers
76
views
Recursive Feature Elimination - Long-Running R Code
I am running recursive feature elimination (RFE) in R using the code below. It never seems to finish on my PC. What options has anyone found useful to get R code, specifically RFE like that noted ...