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
0
votes
0answers
12 views

How to use interaction variables and indicator variable with GBM model in R?

I am new to Machine Learning and i have been working on a classification model which predicts donor is available or not. There is a variable which specifies whether user registered online voluntarily ...
2
votes
1answer
57 views

When I should use PCA?

I have a data set with 60000 rows and 32 columns. I want to use SVM (with some more constraints that make it more complicated)and I think 32 columns are too large. So I decided to use PCA. But when I ...
-1
votes
1answer
44 views

How to interpret this summary output in R?

How Do I interpret this summary output in R? Coefficients: ...
0
votes
1answer
21 views

Sample Space of Longest Run

I am trying to find a way to calculate all possible combinations of a sequence that have a certain length of long run. When answering questions regarding sequences of heads and tails, sometimes ...
0
votes
0answers
15 views

A way to identify anomalous trends amongst several trends?

I'm working on a personal project, where I'd like to identify anomalous trends. Here's the scenario: Imagine a company can sell 3 types of say, candies: X, Y, and Z. For some reason, these prices can ...
0
votes
0answers
15 views

how should i check stability of community detection algorithm?

I have a community detection algorithm that communities can't have overlap. It works based on density of edges. Now I want to see how stable this algorithm is (if I decrease internal edges and ...
0
votes
0answers
19 views

ARCH and GARCH model working and R code for its implementation

my time series data set doesn't have a proper trend or seasonality. Heard about ARCH and GARCH model which works fine on Un-trended data set but I am not finding the proper R code for its ...
0
votes
0answers
16 views

Create 'All' categories and summarize

I have a dataframe with columns as defined below. For each of these variables ...
0
votes
0answers
32 views

Sum only unique value by group

That's the structur of my data set ...
0
votes
2answers
72 views

Help on Looping in R

I am trying to build a for loop in R. but facing the error as the loop is not creating the exact variable and may be double counting. What i trying to do is The code has to go through every row and ...
0
votes
0answers
29 views

How to add weight to a variable to a ensemble method

I am building an ensemble method and would like to add weight to one particular variable (x3 in this case). How can I do this? Here is my code: ...
0
votes
3answers
48 views

Why does changing the cluster number change the plot in Kmeans?

This might be a dumb questions but I can't find the answer to it. I don't have the perfect mathematical understanding of kmeans, so apologies if it is. I'm just wondering why I see a different plot ...
0
votes
0answers
62 views

Transformation of matrix with missing values for hierarchical clustering

Comparing different variables, I got a matrix with lots of missing values. How do I have to transform the matrix below for hierarchical clustering? What I have already tried: ...
0
votes
1answer
26 views

How to transform many columns of TRUE/FALSE/NA to just TRUE/FALSE?

I have a dataframe that consists of a few columns of text, and then a bunch of columns that are TRUE/FALSE or NA (they were TRUE/FALSE but I left-joined them with ...
0
votes
1answer
90 views

Adjusted R-squared is too high (=1) in Linear Model

I built a Linear model which has an adjusted r-squared value of 1. I understand that this is a near perfect number. Upon further investigation, I found that one of the 96 independent variables in the ...
0
votes
0answers
10 views

Performant alternatives to Matrix package in R that requires minimal effort by end users to install

Background I'm going to be releasing a package for R that does calculations involving extremely large sparse matrices (1,000,000 x 1,000,000 is the minimum for what we consider useful). For this ...
0
votes
0answers
11 views
0
votes
0answers
16 views

Error decompose time series

I have a time series which represents the amount of a certain product sold throughout the year 2018. I am trying to decompose the time series but I get the following error ...
0
votes
1answer
118 views

How to apply a trained Random Forest model to a new data set in R?

So I have a data set that is essentially football players statistics in 2017 and 2018. I have trained my model to use the 2017 data to predict the 2018 number of touchdowns. My code is below: ...
0
votes
1answer
158 views

Auto.arima with xreg in R, restriction on forecast periods

I am using the forecast package and implement auto.arima with xreg. Here I want to forecast ...
1
vote
2answers
133 views

Xgboost in R: Dealing with extreme class imbalance

My data has an extreme class imbalance - 99.7% is 0's and 0.2% is 1's and almost all the predictor variables (6 out of 7) are categorical. I trained an xgboost classifier after performing an ...
0
votes
0answers
13 views

Feedback on duplicate and near-duplicate image detection

Good morning all, I recently completed building a script that does the following: Stores a list of all .jpg images existing in specified drive. Cleans/ids duplicates through md5sum Iterates ...
-2
votes
1answer
26 views

Which function should I use for a nonlinear regression in panel data in R?

I have a data set with different years, so it is panel data. I know what features I should use in my model for a nonlinear regression. I already used the nls()...
0
votes
1answer
46 views

XGBoost: Can the features in test data be a subset of the features used to train the model?

Is it a problem if the test data only has a subset of the features that are used to train the xgboost model? All my predictor variables (except 1) are factors, so one hot encoding is done before ...
0
votes
1answer
32 views

Y-axis output is not order

I am currently attempting to output some data based on user agent strings. The strings are too messy to place into a plot similar to the one shown below, so I plotted their index instead. Why is my ...
0
votes
2answers
26 views

Different significant variables but same Adjusted R-squared value

I performed a multiple linear regression on 64 variables with 3 different models: Performed Multiple Linear Regression on all 64 variables Perform Feature Selection with Random Forest and then ...
2
votes
1answer
96 views

Automatically uses several cores on R

I am using a library called MFE to generate meta-features. However, I am working right now with several files and I notice that I am using only 1 core of my machine and taking too much time. I have ...
1
vote
0answers
28 views

How to interpret the graph representing the fit provided by the ARIMA model?

I'm following this tutorial here to build an ARIMA model in R. I've done a Forecast using a fitted model in R. I specified the forecast horizon h periods ahead for predictions to be made and used ...
0
votes
1answer
196 views

Do we have to split our dataset into training & testing when using ARIMA model?

I am working on a project where I predict the total quantities sold at the ITEM/DAY leve. As for the model, I decided to with an ARIMA model (I'm using R). For guidance, I decided to follow the two ...
1
vote
1answer
232 views

What should I master better for professional data science in economics and finance? [closed]

First, excuse me for the noob and long question which is probably doesn’t even belong to here, I know there are several question been answered like this out there, but I think this is going to be up-...
0
votes
1answer
25 views

How to distinguish between normal fluctuation and outliers in ARIMA model?

I have a dataset about sales per day of certain products at the ITEM/DAY/STORE level , I've plotted the series and visually examined it for any outliers, volatility, or irregularities. And this is ...
0
votes
2answers
26 views

In which predictive tasks are the ARIMA model useful?

I'm working on a project where I have to predict the total quantities sold at the ITEM/DAY level. As a model, I thought of using an ARIMA (I'm using R), but I wanted to get a confirmation of whether ...
1
vote
0answers
62 views

How to tune the parameters of ANN in R?

I tried below code where I used method as 'mxnet': classifier = train(form = Survived ~ ., data = training_set_scaled, method = 'mxnet') From this code I got ...
0
votes
1answer
34 views

Grouping factors in more general ones

I have to work on this database on R. I have tried to make a tree model, but all the variables are factors with too many levels. I tried changing the column "operator" in three levels (keeping private,...
0
votes
1answer
26 views

Unable to use readline() for function() input [closed]

I recently started learning R and was trying to make a script that would give specific values of a probability distribution. Ideally, in this script, there would be a list of probability distributions ...
0
votes
1answer
139 views

How to find optimal number of trees in random forest using Grid search in R?

From below code, I am getting optimal number of mtry. What is this mtry ? and How should I find the optimal number of tree that to be assigned to Random forest algorithm so that it will give High ...
1
vote
1answer
39 views

Relating two data sets at the row level where table one may correlate to zero or more rows in another

I'm just looking for some high level recommendations on libraries, design patterns, or algorithms here. I obviously don't expect you to build a model for me. I would like to predict the monetary ...
0
votes
0answers
16 views

Choosing predictive model for dataset

have a question about the type of model which I should use for a dataset I have. I have use 2 data-sets for my project. After hypothesis testing, I me Out of the 7 input variables, 6 of them are ...
0
votes
1answer
27 views

How to club the orders in such a way that maximum number of items are common amongst them?

Consider the following data set: The above table shows the quantity of each item used in the orders SO1 SO2 etc. I need to club the orders in such a way that maximum number of items are common amongst ...
0
votes
0answers
18 views

Coding type affects the fit of a mixed model in R

I'm running a mixed effects model in R, using the lme4 package. The model I'm running is this: ...
0
votes
1answer
28 views

How do I compare data frames in R?

I have two data frames, dfA (t1) and dfB (t2), with subject IDs and associated variables. I want to compare the two data frames based on subject IDs and retain the subject IDs (and the associated ...
0
votes
0answers
47 views

Predict vs. Impute: Filling missing data using Random Forest

I am using R package randomForest to build a Random Forest model for classification. Ultimately, I need to choose one of five programs for a group of individuals ...
0
votes
1answer
33 views

Random Forest application with 40+ Predictor Variables

I am using R package randomForest to build a Random Forest model for classification. Ultimately, I need to choose one of five programs for a group of individuals ...
0
votes
1answer
764 views

R - newdata has X rows but variables have X rows

I have a dataset dimensions 1142obs in 454 variables. I've used 'caret' to separate into training and testing datasets. training =858 obs of 99 var testing =284obs of 99 var I make a linear ...
0
votes
0answers
23 views

Changing the performance metric used to optimize with random-forest

I'm looking to change the performance metric used to optimize the training for my data set because it is highly unbalance. Because it's highly unbalanced, I don't feel like accuracy is the appropriate ...
0
votes
0answers
21 views

Forecast Hospitalizations for US Counties

I have a U.S. County-level data set with information on the total number of hospitalizations from 2011 to 2016. Each observation in the data set is a county and there are 8 columns in total (State ID, ...
0
votes
0answers
49 views

How do I avoid time leakage in my KNN model?

I am building a KNN model to predict housing prices. I'll go through my data and my model and then my problem. Data - ...
-1
votes
2answers
27 views

How do I fix space allocation error on a machine with plenty of space?

I'd like to run a model on RStudio Server, but I'm getting this error. Error: cannot allocate vector of size 57.8 Gb This is what my data looks like and it has 10,000 rows. ...
1
vote
2answers
72 views

Outlier detection for Disk Space Usage

I would like to do outlier or anomaly detection on the disk free space data. Sample dataset as below (I don't have any label dataset): ...
1
vote
0answers
55 views

Variable Importance changes with oversampling

I am currently using Xgboost for a binary classification problem with highly imbalanced data in R. I have used oversampling to train the model. This worked well, now however it comes to measuring ...