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
23 views

Accuracy function in R language [closed]

I would like to find the accuracy of predicted data. Which package in R can I use that has the accuracy function?
0
votes
0answers
12 views

Help in knowing if I am doing Boosting right on satellite data

I'm having trouble with a Machine Learning project, and knowing if I am performing methods properly or not. We are given data from a real satellite, and we have to predict when it will pass through ...
0
votes
0answers
48 views

How to improve accuracy of Decision tree in R studio

I am currently conducting a study on the predictive qualities of odds (Regarding Football/Soccer). I have odds from multiple bookies on each of the seasons and leagues within the study ( as below ). ...
0
votes
1answer
30 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) ...
0
votes
2answers
52 views

White noise seasonality

Is the above graph a white noise? I'm confused by the spikes at certain places. The above plot has been obtained after doing a first order differencing on a time series. How can I justify whether ...
0
votes
1answer
45 views

Preparing dataframe to carry k-means clustering [closed]

Im trying to apply 3 different algorithms of clustering on my dataset. to check which one fits the best. I'm confused how should I convert my dataframe -k-means -DBSCAN -hierarchical clustering ...
1
vote
0answers
149 views

LASSO Regression using Panel Data

I have panel data for 3 countries, ranging over 3 years. The dataset is called CarProduction ...
2
votes
1answer
39 views

how to implement a hierarchical clustering technique using parallel execution in R

In R, currently to implement wards method for hierarchical clustering, I use the following code - results <- hclust(data, "ward.D2"). However as my data size has ...
0
votes
0answers
44 views

Practical use of bootstrap in R

I am a beginner and try to perform a bootstrap in R. It would be nice if somebody could help me with the following situation. I have defined prices and I want to randomly generate quantities (given a ...
1
vote
1answer
29 views

Different t-test results from R and LibreCalc

while I was trying to apply one-tailed t-test to two vector of data on R, I just wanted to apply same thing on librecalc also and then I noticed that p-values are different. Here is a summary what I ...
4
votes
4answers
71 views

How do Data Scientists integrate Predictive Modeling with SQL?

I've heard a lot about the importance of knowing SQL but how do you guys at the larger firms integrate your software for modeling/analysis with the server that holds the data? Do you simply access ...
1
vote
2answers
38 views

Extracting data from a data frame with conditions

Given the first data frame consisting of 4 columns ...
1
vote
3answers
83 views

Why are pandas/R/etc so common in a data scientist or analyst's workflow when one can resort to UDFs in an RDBMS?

It seems common for an analyst to have this workflow when using an RDBMS: use SQL to get a subset of data from the database, export it or use a connector, and then apply a data mining / model ...
0
votes
4answers
74 views

How should we manage large database

We currently manage a large volume of economic data in Excel in my organisation. All of the data is downloaded from different online databases into Excel spreadsheets (one for each data frequency ...
3
votes
2answers
69 views

Is ARIMA appropriate for time series prediction involving a mix of explanatory and independent variables?

I have a table with the following columns: Date(Month,Year), Sold_Past_Month, Quantity_Available, Quantity_Shipping_In, Missed_Sales, Quantity_Needed Quantity_Needed is the dependent variable that ...
4
votes
1answer
44 views

Count and summarise ID's each day while creating a new column that shows the accumulated ID's

I have two column, first one being the ID of a customer and second one being the Date of purchase. ...
0
votes
0answers
119 views

Wrong calculation of feature importance of decision tree in R

I trained decision tree both in python and R, but I think the way feature importance is calculated in R may be wrong. Following is the sample code which you can use to reproduce the problem. Let's say ...
0
votes
0answers
58 views

Running into strange errors when using glmnet and generating graphs

I developed a very simple Ridge Regression with glmnet, the R package. When I use the plot.glmnet() function I encounter strange errors: ...
1
vote
2answers
72 views

Time-series forecasting

Here is the data: ...
3
votes
2answers
78 views

Rearranging data frame from column names to key value pairs

If I have data like this in R: > a = data.frame(a = c(1, 2), b = c(3, 4)) > a a b 1 1 3 2 2 4 but I would like to have it like this: <...
1
vote
1answer
74 views

How to do webscrapping in R on this webpage? [closed]

I am quite new to R and I am trying to learn webscraping. I basically need to extract documents from this website. Ideally, the data needs to be structured in three columns: YEAR, DATE, and ...
0
votes
1answer
51 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: ...
0
votes
1answer
21 views

Amazon Cloud Image istance most suited for R data mining

I'm new to the field of machine learning, I always used my laptop for regular statistical analysis with no performance problems. Though lately I started programming with caret and I find myself stuck ...
1
vote
1answer
45 views

caret dummyVars on unseen data

I created my dummy variables, trained my model and tested it as below: ...
0
votes
1answer
187 views

Setting input shape for an NLP task in R(Rstudio) using keras 1D convolution layer, when it expects 3 dimensional input (a tensor)

I am using R programming language and using Keras API to build a functional 1D CNN. I have a matrix of my dataset of the following shape rows*features (6000*1024). The input layer is set using the ...
1
vote
0answers
80 views

How to set kernel size (height and width) for 1D convolution layer in CNN Keras R API for doc2vec input?

I am using a doc2vec matrix (6000,1024) as feature space to input in a classification model which can categorise each document(sentence in my case) into one of the two classes (A,B). My feature space ...
0
votes
2answers
32 views

Reading Date Time in R (01.01.2019 00:00)

How do you read a date in R that is given in the following way: 01.01.2019 00:00 While reading it with read.csv("my_file.csv", sep = ";", dec = ",") I am getting ...
0
votes
1answer
36 views

Append and replacing data in r

I am writing a few lines of codes to create a data table full of NAs but don't know how to append the data of results into the data table I created while replacing the position of NAs. Here is my data ...
4
votes
1answer
166 views

On the choice of LSTM input/output dimension for a spatio-temporal problem

I am using LSTM neural networks from (R)Keras for a matter of spatio-temporal interpolation. I manage to get the network to output predictions but the results are not outstanding (very little ...
2
votes
1answer
82 views

Difference in model performance measures of train and test data sets

I am using CART classification technique by dividing a dataset into train and test sets. I have been using Mis-classification error, KS by rank ordering, AUC and Gini as MPMs(model performance ...
3
votes
1answer
37 views

How to approach clustering of time-series with a single variable

Let me preface this by saying that I'm a complete beginner to R and data science in general, so my apologies if this is a rather trivial question. I do have a rough idea of what I would like to ...
1
vote
0answers
47 views

Kappa Goes up as Accuracy Goes Down

I have recently been trying to train a randomForest model on a binary outcome with a very uneven class split. 282 control ~82% 63 case ~18% There are a total of 147 predictors that I'm testing for ...
-1
votes
2answers
52 views

Loops in R programming, [closed]

I want to update this Remaining column in this table below: How do I do this in R programming? I tried while (n.Remaining>0) { n.remaining <- n.total-n.expense} Desired Output:
1
vote
0answers
75 views

How to model non-linear demand function?

I am trying to build a dynamic pricing algorithm on intermittent data (a lot of zeros between non-zero values). I have on average 100 non-zero data points for each product. However, it seems to be ...
0
votes
1answer
76 views

Remove part of the string in R - dropping some words from it

I have a column in dataframe which should represent the date, named "taken", and looks like this: taken Sat Jan 01 15:30:27 CET 2011 Thu Jan 06 00:54:26 CET 2011 Sat Jan 08 19:49:02 CET 2011 Sun ...
0
votes
2answers
36 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
1answer
190 views

Using the Stanford Named Entity Tagger in R [closed]

I am experimenting with the Stanford Named Entity Tagger here http://nlp.stanford.edu:8080/ner/process and I feel it would be useful in my research. Does anyone know of a example that I could follow ...
2
votes
2answers
495 views

How to define a custom metric function in R for Keras?

I just started using keras and would like to use unweighted kappa as a metric when compiling my model. Following the instructions from here, I tried to define my custom metric as follows: ...
1
vote
0answers
42 views

Better way to graph percentage of One Categorical Variable by another in R

Looking through the Brfss 2013 dataset (a study that recorded many elements of an observers health habits and outcomes), I wanted to see if there was a correlation between smoking often and being an ...
3
votes
0answers
45 views

Fitting model to differenced time series

I have a time series on daily stock price of company(2013 data points).I took a first order difference and the following acf and pacf plots of the differenced series were obtained. However, I am ...
1
vote
1answer
66 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 ...
1
vote
1answer
41 views

How R performs the operations like Inf + Inf, Inf * Inf, Inf - Inf and Inf / Inf?

In R When we do some operation like Inf + Inf, Inf * Inf gives Inf back, whereas similar ...
2
votes
1answer
1k views

R Combine Multiple Rows of DataFrame by creating new columns and union values

I have a dataframe in R that looks like this ...
0
votes
2answers
72 views

Dataset Merging

I have several datasets (All looks like this). The Problem is, that the same user is on several datasets. I need to merge the different sets in a way, that if the username is the same, the frequencies ...
0
votes
1answer
27 views

LDA as a dimensionality reducer [closed]

I know how to use LDA as a classifier. But how to use Linear Discriminant Analysis as a dimensionality reducer to reduce the number of features and apply logistic regression on top of it. I am using R ...
0
votes
1answer
2k views

How to resolve “invalid number of 'breaks'”

Code: f_custdata <- gsub(".", "", f_custdata) f_custdata <- as.numeric(f_custdata) hist(f_custdata) Error: Error in hist.default(f_custdata) : ...
1
vote
0answers
158 views

Creating word cloud with positive and negative words

Have already load in the lexicon to score my tweets. How do I create a word cloud for the tweets that are negative only? ...
0
votes
1answer
88 views

Clustering by Distributions of Groups of observations

I have data as shown below. Like the groups shown A,B,C.. there are roughly 5400 groups of data and 15 observations for every group (I sampled 6-7 for each group and pasted them here). ...
1
vote
0answers
54 views

Dummy variables for unseen data in R

I got the following problem: When I trained my model I created my dummy variables(before train-test split) in the following way: ...
1
vote
1answer
482 views

Mutate with dynamic column names dplyr

Hi I have this dataset (It has many more columns) ...