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
1answer
48 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
54 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
26 views

Calculate a mean on condtions in a dataframe with dyplr

My table looks like this: ...
2
votes
1answer
67 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
31 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
63 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
12 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
58 views

Cluster method with binary variable

I need to do a cluster analysis for the following variables: ...
0
votes
1answer
40 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
14 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
28 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): ...
0
votes
1answer
22 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
28 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
44 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
41 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
129 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
35 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
43 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
68 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
37 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
67 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
43 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
112 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
69 views

Time-series forecasting

Here is the data: ...
3
votes
2answers
73 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
67 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
42 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
20 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
41 views

caret dummyVars on unseen data

I created my dummy variables, trained my model and tested it as below: ...
0
votes
1answer
140 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
77 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
31 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
35 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
153 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
69 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
43 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 ...
0
votes
2answers
41 views

Loops in R programming,

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
74 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
75 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
1answer
27 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 ...