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
1answer
112 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
19 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
169 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
345 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
171 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
16 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
28 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
52 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
29 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
106 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
42 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
302 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
262 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
30 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
29 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
71 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
35 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
27 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
177 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
30 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
51 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
38 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
1k 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
26 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
50 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
74 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
56 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 ...
1
vote
1answer
56 views

Logistic Regression - ROC curve plots Sensitivity vs Specificity instead of (1-Specificity)

I am new to Machine Learning and have been doing some practice on Logistic Regression. To evaluate the models, I've been trying to create some ROC plots. The package that i used is pROC. The model ...
1
vote
0answers
48 views

R: Using Stanford Corenlp to extract sentence from original text

I am creating a summarizer in R of news articles. Hence, I am building an algorithm to get total score of each sentence based on sum of frequency of lemma in the sentences of the article, annotated ...
0
votes
1answer
22 views

What do each of the three SVM classes in R represent?

Inspired by this post, I took a look at this doc SVN in R output this: ...
1
vote
1answer
79 views

When and where dummy.data.frame would be used?

I am learning this post, in which, the author gives the piece of code: ...
2
votes
0answers
27 views

Calculate a mean on condtions in a dataframe with dyplr

My table looks like this: ...
2
votes
1answer
78 views

Logistic Regression - Coefficients have p-value more than alpha(0.05)

I am very new to the machine learning field and have been practicing logistic regression on few sample data sets. I have built a Model using the logistic regression algorithm. Few of the coefficients ...
1
vote
1answer
32 views

Impact calculation- Regression

I am dealing with the below data: \begin{array} {|c|c|}\hline \text{user} & \text{A_PDE} & \text{B_PDE} & \text{C_PDE} & \text{D_PDE} & \text{Sales} & y_\text{pred} & \text{...
1
vote
2answers
21 views

Keeping part of a string in R [closed]

I have a dataframe with the following column city <- c("Sydney NSW", "Newcastle NSW", "Liverpool NSW", "Broken Hill NSW") I want to maintain everything prior ...
3
votes
1answer
64 views

What does “exaggeration” mean in the context of Boosting?

I am learning boosting, the machine learning ensemble meta-algorithm. The professor is grouping 3 weak classifiers into an ensemble and said that before this time point it is easy to understand. Take ...
0
votes
1answer
13 views

Calculate mean by decile in Svydesign object

So, I´m working with ENIGH - Database, which stands for ¨National Survey of Household Income and Expenses¨ in Spanish, this is an exercise conducted by the Mexican government and like most surveys of ...
0
votes
0answers
63 views

Cluster method with binary variable

I need to do a cluster analysis for the following variables: ...
0
votes
1answer
50 views

In which CRAN mirror is the quadprog package available?

I was trying to find the accuracy of some predicted data and I came to know that I can use the forecast package to do this. When I installed it and gave library(forecast), it said it needs quadprog ...
0
votes
0answers
15 views

Neural Networks R package that can learn from logistic regression

I have implemented logistic regression and I know that there are some packages in R that can be helpful in build a neural network taking info (or maybe basing the tuning of the parameters) on the ...
1
vote
0answers
35 views

Fast way to tune SVM parameters in R

I have tried to tuned the parameters with the function tune, but it took over 15 hours to tune this (and at that point I had to stop it): ...