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
2
votes
1answer
746 views

How to interpret Variance Inflation Factor (VIF) results?

From various books and blog posts, I understood that the Variance Inflation Factor (VIF) is used to calculate collinearity. They say that VIF till 10 is good. But I have a question. As we can see in ...
0
votes
0answers
8 views

How to get a KNN model (using quantiles to scale variables due to non-normal distributed data) to be better suited for non-extreme values in the data?

I want to cluster my data via k-means/modes. As the variables in my data are not normal distributed, I am not using the z-transformation to scale my data. I am scaling my data by categorizing each ...
1
vote
3answers
46 views

Riskscore creation on Numerical Data

I am working to create a Risk score on a data where I have variables - Invested_amount, Profit Amount, Age of Account in days, Total Trading Transactions,Profit per Transaction & Investment per ...
0
votes
1answer
345 views

Importing C4.5 file to R dataframe

I want to convert the input data available as C4.5 file format into a R data frame. The data set can be downloaded from the following link https://archive.ics.uci.edu/ml/machine-learning-databases/...
0
votes
1answer
73 views

Extract or subset hundreds of columns from a data frame

I need to extract many columns from a dataset. I have a very large csv file with thousands of columns and rows, and I read it into R using: ...
-2
votes
0answers
18 views

KNN and Classification Factor [closed]

I'm studying the KNN algorithm and its application on R. If I correctly understood, KNN is a supervised algorithm able to classify an unlabeled item according to the predominant belonging class in the ...
-1
votes
0answers
32 views

How to predict new data based only on old data? [closed]

Supposing that I have 1000 data of characteristics of a machine (Period = 1..1000), with 6 dependent variables (Pressure, Speed, Temperature, Sound, Noise, and Vibration). Most of these variables ...
0
votes
0answers
8 views

How to: Plot global mean precipitation data from the NDAA onto map regions?

Wondering how to/ if I can display amount of rainfall across regions (in env variable) on the map areas so that the points only pertain to separate languages and sized by rainsetPropn. Have used data ...
1
vote
1answer
25 views

should we include or exclude a variable in a logistic regression based on the description below?

should we include or exclude a variable in a logit regr. model which will only obtain values if a certain event takes place otherwise will show N/A? this variable tells whether or not a product will ...
3
votes
1answer
37 views

Why do Isolation Forest implementations turn it into a supervised learning problem (with random values for the target?)

I am looking at various implementations of the Isolation Forest in python and R. Both sklearn in python and solitude in R use a y variable with the ExtraTrees regressor. Since, Isolation Forest is ...
0
votes
0answers
9 views

Elastic net in R - error whilst prediciting [closed]

I have no idea how to fix the following code to remove an error: ...
2
votes
0answers
56 views

Which one to choose to identify patterns of user activity: Sequence analysis or process mining?

I have the following user activity data that where for each user the activity type they were engaged are recorded along with the phase: ...
0
votes
0answers
20 views

K-means clustering for east west airline marketing data. Confused in choosing the optimal clusters [closed]

Ques: The file EastWestAirlines contains information on passengers who belong to an airline’s frequent flier program. For each passenger the data include information on their mileage history and on ...
1
vote
1answer
160 views

Importing Excel format data into R/R Studio and using glmnet package?

I have no problem importing Excel formatted data into R/R Studio and use all other R packages that I use. But, when I want to use the glmnet package to develop a regularization model, I invariably ...
0
votes
0answers
16 views

String manipulation in R [closed]

I have a vector called "condition" and I want to change the value of condition to number of hours left for all the records. What is the best way to do it ? condition <- c("10 days ...
1
vote
1answer
42 views

In a Time Series Problem, is it possible to forecast quantities by learning the patterns of other items? What are my options?

Suppose I own a store that sells a variety of apples and I have the following stats each month. Report Date Type of Apple (TA) Quantity Available(QA) Quantity Sold in the Past 30 days(QS30) ...
1
vote
2answers
161 views

Does Python have R's tidytext equivalent?

I can't seem to find a tidytext (R library) equivalent in Python. Text mining in Python seems quite weak compared to R.
0
votes
0answers
14 views

Error in predictions using glmnet() function in R

I've got a problem with my code, whilst making predictions using glmnet() Here is my code plus an error which occurs: ...
1
vote
2answers
46 views

How to make a dataframe with lists or vectors as its elements

This is something I have been wondering for ages but I am never able to get an answer. I am trying to understand how to make a dataframe in R, where each element of the dataframe is itself a vector ...
0
votes
0answers
11 views

How can the forecast accuracy of three models for a categorical time series be compared?

This is a general question. Can anybody please point me in the direction of how I can compare the forecasts of a 3 level categorical time series by three competing models? I would like to compare the ...
0
votes
1answer
29 views

Replace values that starts with “<” in a data frame in r [closed]

I am new to R and would like some assistance on replacing multiple values in a large dataset with many variables to NA at once in r. I want all the cells with "<0.01, <0.02, and many others ...
0
votes
0answers
9 views

Endogenous and exogenous ordinal variables in R studio Lavaan

I am new to using R studio, so apologies for the basic question. I have run a number of Confirmatory Factor Analyses using the Lavaan package. Each questionnaire item is on a 4 point Likert scale 0 = ...
0
votes
0answers
32 views

Odd results on bias-variance tradeoff assessment

I am running a bias-variance tradeoff assessment on ten regression models of increasing complexity (linear to x^10), but my results do not satisfy the MSE = Bias^2 + Variance + True Error relationship....
0
votes
1answer
36 views

Merging three different customer segmentation systems into one

I have been given a task where I have three existing customer segmentation systems (rule based e.g. if customer spends X in Y amount of time AND whatever then put in top spender segment is one segment,...
0
votes
0answers
10 views

R - using heatmaply for a 2d histogram / density

I have a rather long series of x, y coordinates representing a character in 2d space. Let's say that space is 200 x 400. I want to represent the amount of time the character is in each x, y coordinate ...
2
votes
1answer
217 views

Missing population values in census data

I have population data from Census.gov: Total US population by age by year from 1940 through 2010 Depending on the range of decades, the data is missing discrete population values for ages greater ...
1
vote
1answer
697 views

Error loading tidyverse in R Studio - No broom package

I'm getting numerous errors when trying to install packages, namely tidyverse and ggplot. The error is of the form are always in the form: ...
1
vote
1answer
44 views

Relating changes of a value in time to known events

I work with two datasets. The first dataset contains fluor values measured every minute. The second dataset contains certain events and their time. We know that these events cause peaks in fluor ...
0
votes
1answer
25 views

How to output my uploaded text in Shiny in R at the position of the screenshot?

I would like to position a long text on the right side of this Shiny app, as shown on the screenshot below. ...
3
votes
0answers
34 views

XGBoost custom objective for regression in R

I implemented a custom objective and metric for a xgboost regression task. In order to see if I'm doing this correctly, I started with a quadratic loss. The ...
0
votes
1answer
525 views

faster alternatives to sparse.model.matrix?

I have a large dataset that is entirely categorical. I'm trying to train with it using xgboost, so I must first convert this categorical data to numerical. So far I've been using sparse.model.matrix() ...
3
votes
1answer
9k views

Plot of ACF & PACF

There are 96 observations of energy consumption per day from 01/05/2016 - 31/05/2017. I am trying an ARIMA model in R to be fitted to these time series observations. I have chosen the frequency of ...
0
votes
0answers
23 views

Trying to plot REC curve and calculate AUC in R but getting error

I am working on regression machine learning techniques and calculating AUC (plotting REC) by using below paper link: http://homepages.rpi.edu/~bennek/papers/rec.pdf My Code; REC <- function(y_val , ...
2
votes
2answers
810 views

ndiffs for Python

Is there a function equivalent of R's ndiffs function in Python? It is used to estimate a ...
0
votes
0answers
15 views

python equivalent of doParallell in R [closed]

I have a code written in R which uses doParallel and makeCluster libraries. I try to convert that into Python and send it to a ...
0
votes
1answer
53 views

Removing constant from the regression model

I am trying to calibrate two variables $(X,Y)$ of different measuring techniques from two instruments, the result of the linear regression analysis appears as shown in the image. The result shows the ...
0
votes
1answer
75 views
2
votes
1answer
36 views

Association rules in R / Subset rules based on feature

I tried using the apriori algorithm in the arules library for association rules mining in R. There's two thing I'd like to ask: Why are the lhs and rhs of the rules in intervals? For example U get ...
4
votes
2answers
737 views

How can I use two different datasets as a training model for svm

I know that you're supposed to scale your test data using the parameters (mean and stdev) from your training data. This is relatively simple; but what if the number of samples is limited in one ...
0
votes
1answer
563 views

Coloring labels using scatterplot3d in R

I am trying to visualize data using R and scatterplot3d. I have loaded data and used: ...
2
votes
1answer
30 views

Question about scaling in (R) Principal Components Regression

I'm reding Introduction to Statistical Learning (ISL), Ch. 6 Principle Component Regression. When I look at the Labs, I wonder how scaling is handled in R in this ...
0
votes
2answers
744 views

Fitting an arimax model on out of sample dataset

I have built an arimax model where we have sales data across time as the response variable and price is one of the external variables. I used the below code to build a simple arimax model. I had data ...
2
votes
0answers
32 views

Plotting regression test errors

I am trying out an R exercise where I have to randomly split my data into train/test set 50 times. On each iteration, I use lm() to train polynomial models up to ...
1
vote
1answer
49 views

Trouble doing a simple Box Plot

This is a problem that I keep having when trying to do a boxplot in R. From what I can see the code I am using should work, not ...
0
votes
1answer
90 views

sagemath: compared to r.quantile, what is a faster way to find boundaries for a boxplot?

I was using the r.quantile method in sagemath to find boundaries for a box plot. The plot was taking a long time using r.quantile. r.quantile took more than 20 seconds to find the quartiles for a ...
7
votes
4answers
5k views

Exploratory Data Analysis with Image Datset

In Machine Learning Kernels on Kaggle I often see EDAs with structured data. So, I was wondering, if there are any recommended/standard procedures for EDA with image datasets. What kind of statistical ...
1
vote
0answers
18 views

Stabilize Neural network prediction for class probability

I could not carry my question from stackoverflow I ve been trying to fit a neural network for binary setting using library(keras) and I am interested in class ...
-1
votes
0answers
9 views

Cannot differentiate lines in R [migrated]

I'm learning how to use R. I'm running a competing risk analysis with the cmprsk package. ...

1
2 3 4 5
25