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
4answers
79 views

How to apply k means in my dataset?

I have to detect anomalies from my data-set. The anomaly is about in which area and in which time of network usage(total_activity in my data) drastically improved. Help me to know how to apply k-means ...
0
votes
1answer
22 views

kramdown or rmarkdown? [closed]

I am following this post: http://jmcglone.com/guides/github-pages/ I have been using R and Rmarkdown for a few months, but I have no experience in github pages or any web related content: In the ...
0
votes
1answer
24 views

How to model for binary classification with 'Phone Call or not' classes?

I have texts as long as 3000 characters and I need to classify these in 'Phone call happened' and 'Phone call didn't happen' classes. The training dataset has a proportion of 58%:42% for Yes and No ...
2
votes
1answer
17 views

Can sampling like SMOTE/UP/DOWN applied on Validation set?

I am trying to predict classification problem. For that I have used Ranger, Xgboost and naive bayes. My Response class is imbalance . 92:8 ratio. My positive Response is only 8% of whole data. ...
1
vote
0answers
10 views

Grouping by 2 Columns in R to Sum, Count, Percentage, Weighted mean, mode [closed]

I am trying to use dplyr or data.table to calculate sums, percentages, counts, and weighted means for various sub groups. Each Name can have subgroups High Medium and low, and potentially others, and ...
1
vote
0answers
18 views

Boosting, cross validation on small dataset

I have a really small dataset of 20 numbers and 20 potential predictors. (3 are important, 7 half important, 10 may be important) I use boosting (R-package mboost) to find the best predictive model. ...
3
votes
1answer
25 views

Classification problem: custom minimization measure

Assume a binary classification problem, with $1$ denoted as a "bad" outcome, and $0$ as a "good" outcome. If it's relevant, in the sample there are significantly more bads than goods. I'm trying to ...
3
votes
1answer
406 views

What stopping metric to chose to optimize 'sensitivity' for a GBM in H2O?

I am predicting a disease and want to get the highest possible sensitivity score for the predicted values on my validation and test set. What stopping metric can be used to optimize the sensitivity ...
-1
votes
1answer
21 views

Correlation, Feature Importance in R

If I have 150 features, with the output feature being nominal(multi-class), how can I verify which features play a key role in determining the class?
2
votes
2answers
268 views

Ways to simulate weather data over several periods (Python or R)?

I have a time series dataset that has several variables for a state/province for fixed periods of time. That is for state A, there are samples from April 2017 to July 2019. Of course, I thought adding ...
1
vote
0answers
17 views

Using Boruta for determining the magnitude of importance of R, F and M [closed]

I am a novice to R and sorry if this question is missing the mark. I am working on a dataset with high seasonality and trying to assign weights to recency, frequency, and monetary value. For this, I ...
5
votes
1answer
352 views

A clear visualization of a two-way ANOVA

To provide a full yet simple picture of a 3-level, one-way ANOVA, I use the following visualization where variation within each group (the filled circles) and variation between the groups (black ...
0
votes
0answers
4 views

Removing one data element (value) at a time from variable and performing function in R [migrated]

I am attempting to write code in R that permits me to: Remove the first data element (value) from a variable (column) within a larger data frame. Run a function on the full data frame (with the data ...
3
votes
0answers
24 views

NLP problem : Choosing the optimal parser for extracting quantitative values from text

I have a clinical NLP problem for which I would need some help to establish a proper framework. I am trying to extract different elements from echocardiography reports. Those elements are both ...
1
vote
1answer
432 views

Calculate weighted mean for two columns and hundreds of rows?

I'm trying to teach myself basics of R and I couldn't find the answer: Say, I have a csv file and I want to calculate weighted mean for each subject such that I have a mean mu = 0.015*1030+0.16*26930+...
1
vote
1answer
74 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
1answer
32 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
38 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 ...
-1
votes
1answer
32 views

R package vs REST API

I have a logistic regression algorithm in R to predict irresponsible users. I need this to be as flexible as possible for any market. I would need to use the logistic regression algorithm to ...
1
vote
1answer
62 views

How to plot multiple columns with ggplot in R?

I do have a data frame with different categorical and numerical columns with the following schema: Id | num_col_1 | num_col_2 | num_col_3 | cat_col_1 | cat_col_2 ...
1
vote
1answer
203 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
20 views

Fitting glm without explicit declaration of each covariate

When I fit a linear model with many predictor variables, I can avoid writing all of them by using . as follows: ...
0
votes
1answer
32 views

Median of a list of frequencies

I have a list of groups and the frequencies of every group. E.g. ...
4
votes
1answer
329 views

Clustering for high dimensional data

I am have a data set with 52 variables. Most of them have zeros, it resembles a sparse matrix. How can I cluster this kind of data and are there any special types of clustering? I am attaching pca ...
1
vote
0answers
9 views

Which PC hardware would you recommend to invest in for movement ecology studies in R (x,y,t data analysis)? [closed]

I mean all possible work with tagging data: GIS, tagging data pre-processing, visualisation, different types of modelling, simulations and modern analysis. I think it will be about 40 tagged animals ...
1
vote
2answers
63 views

Handling NA Values in the Chicago Crime Rate data set

I am doing a little project on the Chicago Crime Rate data set and I noticed that there are over 600,000 NA values, primarily in the location fields. I feel that ...
3
votes
2answers
2k views

How to optimising caret for sensitivity

I am currently using caret which optimises for accuracy. Is it possible to optimise for sensitivity. I see documentation mentioning that metric = 'roc' has been used, but sensitivity does not appear ...
0
votes
1answer
34 views

converting sql to width bins in r

I want to create a histogram out of the range of a column named surfacearea with country data frame. I made an sql file ...
3
votes
1answer
28 views

NA in LR model summary(R)

So, i was trying to improve mr LR model performing multiple linear regression on a dataset. I had a categorical variable region Region(variable): Midwest Northeast South West I made dummy ...
1
vote
1answer
46 views

Time Series Forecasting

I work in the Oil & Gas industry. I have been trying to build a ts forecasting model with covariates, and the model R code is as follows: ...
0
votes
1answer
282 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: ...
9
votes
1answer
79 views

Features reduction for the not correlated data set

I am working with classification problem on a training data set, which have 100 features. All the features in pairs haven't visible correlation. One can see it in the example pair plot for the some of ...
0
votes
1answer
383 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 ...
0
votes
1answer
52 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
20 views
0
votes
1answer
32 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,...
1
vote
0answers
15 views

Replace values before and after a certain value [closed]

I have a variable like this: V1: 0 0 0 0 0 1 0 0 0 0 0 2 0 0 0 0 0 I want to change the 0 before the 1 to 1, and the 0 after the 2 to 2. It is supposed to look like this: V1: 1 1 1 1 1 1 1 0 0 0 0 ...
4
votes
3answers
5k views

Additive vs Multiplicative model in Time Series Data

The above time series plot is a daily closing stock index of a company. I want to know which model between additive and multiplicative best suits the above data. I know what the two models are, but i ...
1
vote
2answers
29 views

R: Producing multiple plots (ggplot, geom_point) from a single CSV with multiple subcategories

I have a collection of bacteria data from approximately 140 monitoring locations in California. I would like to produce a scatterplot for each monitoring location with the Sampling Date on the Y-axis ...
0
votes
1answer
477 views

Coloring labels using scatterplot3d in R

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

Identify members who are likely to switch where they receive drug administration

I have access to medical claim data from a large health insurance company. As some of you may know there is a large delta between the price of drug X depending on where it is administered. My ...
2
votes
2answers
40 views

Which feature selection technique to pickup(Boruta vs RFE vs step selection)

I have data with 103 columns. I would like to understand which algorithm is best for feature selection and what may be the logic to call any feature as best. ...
1
vote
0answers
39 views
3
votes
2answers
70 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 ...
3
votes
2answers
516 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
45 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 ...
2
votes
1answer
34 views

Machine learning dataframe dimension concept vs NumPy dimension

From Machine Learning for Absolute Beginners: A Plain English Introduction: Contained in each column is a feature. A feature is also known as variable, a dimension or an attribute - but they all ...
3
votes
1answer
7k 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
1answer
400 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() ...