Questions tagged [r]

R is a free, open-source programming language and software environment for statistical computing, bioinformatics, and graphics.

Filter by
Sorted by
Tagged with
1
vote
0answers
31 views

Every machine learing model i build, always predict wrongly almost the same samples. (Random forest, XGBoost, AdaBoost)

First of all, I'd like to apologize for any spelling or grammar mistakes. I'm having a problem using R for a classification problem. My dataset contains ~300.000 genomic data, and the features are ...
0
votes
0answers
5 views

What information can be drawn from the area between the warping function and the diagonal path in DTW?

I'm using the R package dtw: Dynamic Time Warping Algorithms to study the similarity of two time series. This package provides also the possibility to estimate the area between the warping function ...
0
votes
0answers
20 views

Why does the Neuralnet package predict constant values when a second hidden layer is added?

I'm trying to use a multi-layered neural network to predict concrete strength, using R's neuralnet package. Everything works great with a single layer, but when a second layer is added, the ...
0
votes
1answer
21 views

How to group and order columns in r

...
1
vote
1answer
85 views

Best approach to find optimal solution to linear equation by group in R

I am currently modeling a pricing and discount system in R. My data frame looks as follows: ...
0
votes
0answers
24 views

Imbalanced Data Classification

This is my code with which I tried to attack my imbalanced dataset from here. Now I have 2 questions. When I try to split my data into train/test data and try to run the table() function, I always ...
0
votes
1answer
20 views

How to change random number of random elements in a column by group in R?

I have the following data frame: >df Name 1 Ed 2 Ed 3 Bill 4 Tom 5 Tom 6 Tom 7 Ed 8 Bill 9 Bill 10 Bill My goal is that from each group by "Name" ...
2
votes
0answers
9 views

How to create new graph vertices from existing one with igraph in R?

I have the following DF in R representing a directed graph: ...
0
votes
0answers
14 views

Shall I install anaconda, with Python3 and R already installed?

On my Ubuntu 18.04, I have Python 3 and R installed. I am about to study some data science, and just found https://www.anaconda.com/distribution/. anaconda comes with Python and R and some packages. ...
1
vote
0answers
14 views

Time Series prediction using R

I have a dataset which contains data related to the exchange rate in a certain time period(2013-2015). The dataset has a column date with YYYY/MM/DD format and USD/EUR which contains the exchange rate....
0
votes
0answers
23 views

Computing Rare values After SMOGN - Imbalanced Regression

I am dealing with a regression problem where I have the phenomenon "Imbalanced Regression". In my problem, the most relevant events are scarcely represented. In order for me to evaluate my models' ...
0
votes
2answers
22 views

Converting data format

I'm trying to use the recent COVID-19 data from the site of Italian Civil Protection, but they use a rather complicated time format that I'm finding troublesome as a novice to plot as data in a graph. ...
0
votes
0answers
10 views

optimize integers using GA package

The GA package is a great package to use Genetic Algorithm for optimization. See for example this. I have a use case, where my possible values are integer (e.g. 1, 2, 4 ...). So far, I simply rounded ...
0
votes
0answers
21 views

Improve elastic-net feature selection to reduce the file-size burden on the system

I have written a feature selection program in R using elastic-net regression. My training data has around 65 samples with 500K features. I am using 500 bootstraps to resample the data and during each ...
1
vote
0answers
27 views

CART classification for imbalanced datasets with R

Hey guys i need your help for a university project. The main Task is to analyze the effects of over/under-smapling on a imbalanced Dataset. But before we can even start with that, our task sheet says, ...
1
vote
1answer
24 views

Find the mode value and frequency in R

I'm trying to come up with a function in R that gives the mode value of a column along with the number of times (or frequency) that the value occurs. I want it to exclude missing (or blank) values, ...
1
vote
0answers
44 views

Understanding the output of the Random Forest method for classification

I'm using a Random Forest method to predict the behavior of failures at Period_12. My dataset has information about the eleven periods before, considering 112 subperiods (rows). Each one of these ...
0
votes
0answers
20 views

Is there any multivariate time series prediction tutorial/code using RNN LSTM for R?

I have been searching and reading many articles, tutorials and academic journals including this forum. All I find is predicting a univariate time series. (except for François Chollet's tutorial, I ...
0
votes
0answers
6 views

Load tsv file as SummarizedExperiment

I have received some NGS data ( sample below ) as a tsv file and shall analyze it in R. ...
0
votes
1answer
17 views

prediction() returning mistakenly false positives [closed]

I do not know how to interpret the result of: prediction(c(1,1,0,0), c(1,1,0,0)) prediction() functino comes from prediction {ROCR} it has this site: ...
0
votes
0answers
48 views

XGBoost Python API - performance by API, R vs Python inconsistencies, GPU memory and verbosity

I'm combining a few questions together as I feel that it could benefit others. XGBoost API Is there a performance boost (training time or accuracy) when you use the learning API vs the Scikit-Learn ...
0
votes
0answers
20 views

Specifying priors in rstanarm for hierarchical model

We are given the model $$ \begin{align*} y_{ij} & \sim \mathsf{Normal}(\alpha_j + \beta x_i, \sigma^2)\\ \alpha_j & \sim \mathsf{Normal}(\gamma_0 + \gamma_1 u_j, \tau^2) \end{align*} $$ with ...
1
vote
1answer
71 views

Recommendations for statistical models given my dataset

I'm having a problem when using the k-fold cross-validation with the Random Forest method. One of the outputs is the error "Error in randomForest.default(x, y, mtry = param$mtry, ...) : Need at least ...
0
votes
0answers
16 views

How much can I reduce sample size in a bootstrap used for density estimation?

I have a dataset with 90m rows by 10 numeric/boolean columns. I need to calculate bootstrap distributions for 40 statistics. These statistics are definitely not Gaussian (nor similar to the mean of ...
2
votes
0answers
26 views

how to plot a mixed graph in R?

How can I plot a mixed graph in R? I have used this but doesn't work (in bnlearn he calls 'arc' to a directed edge and 'edge' to an undirected edge): ...
1
vote
0answers
24 views

Test and Control analysis to measure the impact of Change in sales-rep for territories

I hope you all are doing well. Before I proceed with my problem statement, a few terminologies for reference - Territory = Sales Territory - Think of it like a county/region assigned to a particular ...
1
vote
1answer
910 views

SMOTE for regression

I am looking into upsampling an imbalanced dataset for a regression problem (Numerical target variables) in python. I attached paper and R package that implement SMOTE for regression, can anyone ...
1
vote
0answers
25 views

De-Normalizing Predicted Values from Neural Network

When fitting the neural network model I normalized the data using the min/max formula: normalized = (data - min(data)) / (max(data) - min(data)) I fitted the ...
-1
votes
1answer
24 views

How to randomly split the data set into multiple different sets:(training 70%:validation 10%(optional):testing 20%) in R?

I have a dataset with 4 predictor variables X1, X2, X3, X4, and one response variable Y. I have been asked to check the correlation between these variables and see how they are related and then use a ...
1
vote
2answers
95 views

Which data set to use to find correlation between Predictor and response variables? Test data set? Training data set? or the entire data set?

I have a dataset with 4 predictor variables X1, X2, X3, X4, and one response variable Y. I have been asked to check the correlation between these variables and see how they are related and then use ...
1
vote
0answers
15 views

Dynamic time warp z score normalisation not working

I have data that looks like this A bit of background, these are soil moisture graphs of different depths. I wish to investigate how long it takes for water to drip down from one depth to another, ...
0
votes
0answers
20 views

Create graph from 2D grid in R

I have 40 images (256 x 256 vertices-pixels) where each vertex (i,j) has an intensity value corresponding to the weight of the edges of the vertex. For each image I want to create a graph where each ...
0
votes
0answers
21 views

How to combine three lists of data.frames?

I have been reading over similar questions asked here but the solutions aren't working at all and I cannot work out how to make their examples applicable to me. Any help would be appreciated. I ...
1
vote
2answers
39 views

Can an entire data frame be used as a prediction variable?

I am attempting to use XGBoost in R to train a model that predicts a fixed number of target variables using all data from previous dates, as well as the two categorical variables (...
1
vote
1answer
43 views

Group_by 2 variables and pivot_wider distribution based on 2 others

Performing some calculations on a dataframe and stuck trying to calculate a few percentages. Trying to append 3 additional columns added for %POS/NEG/NEU. E.g., the sum of amount col for all ...
0
votes
0answers
25 views

How to iterate over the rows of a data frame?

I want to perform perform the following operations on a dataFrame in R ...
1
vote
1answer
52 views

Is it possible to pass dataframes between R and Python using Arrow with zero-copy?

Arrow is an in-memory format, so I can have a dataframe in Python backed by the arrow format. So the dataframe sits in memory, can I use that dataframe directly from R without making a copy of the ...
0
votes
1answer
20 views

How to group a unique column and find the mean value in a separate column in R

My table of data looks like this image (but with many more lines): I want to be able to find the mean age of each region, so the mean age for region SSC20790 and so on. I believe I can use the <...
1
vote
0answers
30 views

CP plot in decision tree showing upward trend only

In cp plot for decision tree, we expect the error to drop down with size of the tree (or form an elbow). This helps to select right cp value. But in my graph the relative error is continuously ...
2
votes
1answer
48 views

Decision Tree on Unbalanced Data

While running decision tree, i have unbalanced data. The data balance is 93%(Class 0) to 7% (Class 1). Now when i am plotting decision tree to understand the factors contributing to class 1 then in ...
1
vote
0answers
28 views

How to do Multivariate Adaptive Regression Splines feature selection in python? Specifically, I need the python equivalent of the earth function in R

This is the code in R: marsModel <- earth(eval(parse(text=paste(ResponseVariable,"~."))), data = data) #build model ev <- evimp (marsModel) Response ...
3
votes
0answers
47 views

How can I improve the accuracy of my model? (Cab Cancellation Prediction)

I am trying to predict based on several parameters like trip type, car type, source of booking, start time, lead time (start- book) and a few other params whether or not a customer will cancel. From ...
3
votes
1answer
205 views

Can I use LSTM models to evaluate multiple, independent time series?

Let's say that I would like to predict the temperature tomorrow. I could use the approach whereby I train a model based on a time-series dataset collected from a single location (for example, see this ...
2
votes
1answer
20 views

Can sampling like SMOTE/UP/DOWN applied on Validation set?

I am trying to predict classification problem. For that I have used Ranger, Xgboost and naive bayes. My Response class is imbalance . 92:8 ratio. My positive Response is only 8% of whole data. ...
1
vote
0answers
48 views

Grouping by 2 Columns in R to Sum, Count, Percentage, Weighted mean, mode [closed]

I am trying to use dplyr or data.table to calculate sums, percentages, counts, and weighted means for various sub groups. Each Name can have subgroups High Medium and low, and potentially others, and ...
2
votes
2answers
384 views

Ways to simulate weather data over several periods (Python or R)?

I have a time series dataset that has several variables for a state/province for fixed periods of time. That is for state A, there are samples from April 2017 to July 2019. Of course, I thought adding ...
1
vote
0answers
23 views

Using Boruta for determining the magnitude of importance of R, F and M [closed]

I am a novice to R and sorry if this question is missing the mark. I am working on a dataset with high seasonality and trying to assign weights to recency, frequency, and monetary value. For this, I ...
3
votes
1answer
43 views

NLP problem : Choosing the optimal parser for extracting quantitative values from text

I have a clinical NLP problem for which I would need some help to establish a proper framework. I am trying to extract different elements from echocardiography reports. Those elements are both ...
-1
votes
1answer
27 views

Correlation, Feature Importance in R

If I have 150 features, with the output feature being nominal(multi-class), how can I verify which features play a key role in determining the class?
1
vote
0answers
41 views

Problem in performing LOOCV

I am trying to run LOOCV on my regression model. I tried to run it in r and encountered the following warning message: ...

1 2
3
4 5
25