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

Unsupervised Sentimental Analysis in R

How would you evaluate unsupervised sentimental analysis? I am reading on evaluating sentimental analysis and learning that much of the classification models that are being used, the data has target/...
0
votes
1answer
74 views

Depending upon how I download, I get two different files [closed]

I am downloading the data set for the Kaggle competition on the titanic. If I use the following code : ...
0
votes
2answers
2k views

How to plot using facet_wrap, over multiple pages as a .pdf files in r cran

I am using ggplot, to compare 114 unique studies for a particular variable I'm interested in. This is what I have used. ggplot(steps, aes(x=factor(edu))) + geom_bar(aes(y = (..count..), group = ...
2
votes
2answers
560 views

Is there an R package for Locally Interpretable Model Agnostic Explanations?

One of the researchers, Marco Ribeiro, who developed this method of explaining how black box models make their decisions has developed a Python implementation of the algorithm available through Github,...
2
votes
0answers
1k views

Neural network (multi-layer perceptron) in R with count data as response

The goal is to run Poisson regression for neural networks (multi-layer perceptron) in R. I am currently using the neuralnet package in R. I have read Is there an R ...
1
vote
1answer
516 views

R: reading big data files in R

In R, there are libraries which help speed up the process of reading huge data files. Examples of these libraries include sqldf and ff. What would be the disadvantage of using these packages to read ...
1
vote
1answer
309 views

Which is faster for imputing: R or Python? [closed]

I have a fairly large dataset (about 40k rows, 40 columns) with many NA's (up to 40% of each variable). All of my work has been done in R so far, but I know R (which I'm told runs only on a single ...
7
votes
1answer
2k views

Reproducing randomForest Proximity Matrix from R package in Python

I am trying to port this little piece of R code to python: ...
1
vote
1answer
123 views

Regression model for continuous dependent variable and count independent variables

I am currently learning R and I am relatively inexperienced in the field. Hope I can get some advice from you guys! I am working on a project where I have to estimate the average processing time of ...
2
votes
2answers
29 views

Resources for text classification algorithms

I'm mining raw Facebook comments (irrelevant) and i am looking for an algorithm that can classify their context as negative/positive/neutral. So you can think of the output in the form of two columns. ...
2
votes
1answer
3k views

Weighted mean with summarise_at dplyr

I strictly need to use the summarise_at to compute a weighted mean, with weights based on the values of another column ...
10
votes
1answer
3k views

R, keras: How to get output of a hidden layer?

I am using package Keras in R to do a neural network. How may I extract the output from a hidden layer? I found an example in python, but it is just I have no idea ...
0
votes
2answers
207 views

Replace Values in Vector on Specific Place in R

I want to make $5^{th}$,$10^{th}$,$15^{th}$,$20^{th}$ and $25^{th}$ values of vector an outlier in all xs by using x1 [5]+OT1,...
1
vote
1answer
67 views

Misclassification Rate for Random Forest Plateauing too Early

Using R, I have created 5 different random forest models using 5 different numbers of trees (3,10,30,100,300). My intention was to compute the misclassification rates of each of these models and plot ...
0
votes
0answers
13 views

Adaptive Resampling in Caret with Pre-specified Validation Set

I was wondering if this is the correct way to get adaptive sampling in caret working with a pre-specified validation set using index. I can get this to work using the 'cv' method in caret like so <...
0
votes
1answer
131 views

Spliting training data into multiple variables using R

So right now I am trying to create multiple variables with training data, and in the process I have reached an error Error in eval(predvars, data, env) : object '1.band1' not found which is a ...
2
votes
1answer
2k views

What are some function/package in R to find similarity of individual words not in the context of sentences?

what are some function/package in R/python to find similarity of individual words not in the context of sentences? As a novice, I searched and found methods like adist, cosine similarity, word2vec, ...
4
votes
4answers
7k views

Rules by which RStudio sets Headings

RStudio automatically recognizes headers in an R script that are set via comments: I would like to exploit that feature, but I don't quite understand what the rules are for RStudio to recognize ...
0
votes
2answers
49 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
194 views

Can you reuse observations from your train data in your final test data?

For an employee population, I am trying to determine who among the employees are likely to get injured in the future based on 2 years worth of data. Unlike in most machine learning problems where you ...
4
votes
1answer
700 views

Parking Prediction based on Mobile application

I am quite new to predictive modelling but have knowledge of GIS, R, python, SQL, etc. I am currently doing a project in work trying to predict when parking spaces will be available based on data ...
-2
votes
2answers
149 views

R + Model + web service

I would like to interface R with some other language (C#/Python/anything easy to use) to provide it with a web service (or other technology) to an other application developed in C#. R => black box ...
1
vote
0answers
19 views

Why is the behaviour of groupby command different in R and in python with pandas? [closed]

if I execute the following lines of codes in R as well as python for groupby command, the order of the resulting ...
0
votes
1answer
34 views

Bad results for training set and good results for test set

When training an algorithm, I have ROC = 0.5896, Sensitivity = 0.3333, and Specificity = 0.8375. When considering the test set, Sensitivity = 1 and Specificity = 1. This could happen or is a problem? ...
5
votes
1answer
93 views

Finding aggregated information of data

I am new to data science. I have a dataset of around 200,000 records, having 5 columns. There is a field called, class. For each ...
0
votes
1answer
38 views

Creating dummy variables [closed]

I have a Eurobarometer dataset and want to eventually create a logistic regression model and a linear probability model using a set of dates as the dependent variable. However, the dates in the ...
1
vote
2answers
173 views

R : Counting the number of observations per category

I'm currently starting out in R and wondering how to count the number of observations per day, per node, per replicate from the below dataset, and store in a different data set. The original dataset ...
4
votes
9answers
2k views

Python and R good tutorials? [closed]

I would like to learn both Python and R for usage in data science projects. I am currently unemployed, fresh out of university, scouting around for jobs and thought it would be good if I get some ...
1
vote
1answer
349 views

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

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

How to give breakdown of text prediction sentences in Shiny

I have created a text prediction app that displays 10 sentences based on the word searched in the toolbar. However, all the sentences are being displayed in a single toolbar horizontally. I would like ...
21
votes
3answers
14k views

is there any data tidying tool for python/pandas similar to R tidyr tool?

I'm working on a Kaggle challenge where some variables are represented by rows instead of columns (Telstra Network Disruption). I am currently searching for the equivalent of ...
0
votes
1answer
30 views

Randomforest parameter tuning R(caret) and Python(scikit learn)?

Question: is it possible, or even necessary, to perform a cross-validation check to tune the parameters of a Python randomforest implementation (eg scikit learn) when training a new model, as can be ...
2
votes
2answers
50 views

Measure correlation for categorical vs continous variable

Given a variable which is categorical that depends on continuous variables, I would like to know how to check wether these continous variable explain the categorical one. So: ...
2
votes
2answers
36 views

Resampling train and test data in R

I need to try out few different machine learning methods (SVM, Logistic regression etc.), predict a value either true or false, and write down their AUC and Accuracy of these predictions. I have ...
0
votes
0answers
43 views

Do I need to use learning algorithms for this type of data?

I'm studying the behavior of machine failures in a production scenario. For this, I generated random data to form my imbalanced training set, consisting of categorical data, which indicate whether or ...
0
votes
2answers
571 views

Assessing Group Similarities and Dissimilarities Post PCA

The goal is to assess similarity and dissimilarity between 6 known groups. The original data began with the 6 known groups and 2,700+ variables all on a scale of 0 to 100. I have performed PCA to ...
0
votes
1answer
24 views

Sample Space of Longest Run

I am trying to find a way to calculate all possible combinations of a sequence that have a certain length of long run. When answering questions regarding sequences of heads and tails, sometimes ...
1
vote
2answers
39 views

Can an entire data frame be used as a prediction variable?

I am attempting to use XGBoost in R to train a model that predicts a fixed number of target variables using all data from previous dates, as well as the two categorical variables (...
1
vote
0answers
37 views

cor() function giving unexpected result for numeric data frame(Updated) [closed]

I have a file named "specdata" which has a lot of CSV that each have the columns: ("Date", "sulfate", "nitrate", "ID"). I want to calculate the ...
1
vote
1answer
241 views

Column header in XTS and Data frame in R

I used quandl function extract stock data with object type as xts. ...
0
votes
1answer
41 views

How to get a output of a hidden layer of a single-layer LSTM

How can get the hidden layer outputs in a simple one-layer lstm? ...
0
votes
3answers
963 views

Drop NA values in an imported xlxs document with R

I have the attached document. I've imported an xlxs document into R. I would like to get rid of all rows containing NA. I've tried the following but it isn't working. ...
0
votes
2answers
41 views

Linear Regression Model

I'm taking a course on Supervised Learning in R: Regression. There is a section where I'm supposed to predict blood pressure given age and weight. This is was MY approach ...
2
votes
1answer
53 views

Computing adjusted p-values in batches

Data For simplicity I propose the following scheme: I have two DataFrames, one with genes, the other with miRNA (it is a simple example, it is not the case what the DF are), the data are continuous: ...
0
votes
2answers
236 views

Adjusted R-squared is too high (=1) in Linear Model [closed]

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
1answer
163 views

R - How do I remove a varying number of digits from a date-vector

I want to remove a varying number of digits from a date vector. My date vectors looks like this: I want to convert this vector into a date vector, but first I have to get rid of the number in front ...
0
votes
2answers
28 views

Calculating Median and Mode of numerical variables for different subgroups in R

I have customer call data and I want to get the median and mode for the call success rate for different subgroups. My variables are: Customer ID, Employment Status (Retired, Employed, Unemployed), ...
0
votes
1answer
42 views

How do i iterate functions until convergence in R?

I am looking to iterate until convergence but I am not sure how i should code it. A simple similar example is something like $X_0=5 , Y_0=3$ for $n=1,2..$ $P_n=X_{n-1}-Y_{n-1}$ $Y_n=3P_n$ $X_n=P_n+...

1 2
3
4 5
25