Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [r]

R is a free, open-source programming language and software environment for statistical computing, bioinformatics, and graphics.

1
vote
0answers
13 views

R NbClust for Python?

Is somebody know a Python equivalent to R NbClust? I'm searching for a way to determine the optimal clusters number for many 'similar datasets' and NbClust sounds good but it's for R and i'm a Python ...
1
vote
1answer
18 views

Creating trial number ascending list, for separate subjects in long format data frame, R?

I have a very long data frame (over 300 000 rows), consisting of all subjects trials of a task, in long format. So about 300 rows is successive trials for one subject, followed by the other subjects ...
2
votes
0answers
37 views

Simulating What-If Scenarios using Machine Learning

Consider a Sample Data-set provided below; ...
0
votes
0answers
31 views

Is there an R tutorial of using LSTM for multivariate time series forecasting?

There is a great blog post about how to use keras stateful LSTM in R to forecast sunspots. I applied it to financial ts data ...
0
votes
0answers
8 views

How to apply curve fitting on both completed and active data?

Suppose we have a set of part failure times on which a specific curve (e.g. gamma distribution) is already fitted. Then another set of times are given where the part is still active (not failed yet). ...
0
votes
1answer
13 views

Display a subset of classes in axes in ggplot

I have the following plot, is there any way in ggplot to display just the numbers 1 to 10 instead of all of them? Numbers from 10 and after are not so important, but I need to display the ones before. ...
1
vote
1answer
24 views

Map a number to a string [closed]

I have vector c(1,3,4,5,7). I want convert it in this way: c('apple','pie','nuts','cookies','some_other_class') Do you have any short ways to do it? Like a switch method or something like that?
1
vote
0answers
18 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 ...
0
votes
0answers
10 views

DocumentTerm Matrix Clustering Suggestions

I am trying to use NLP-style techniques to create clusters of similar books based on their "taglines" or "synopses". The problem I am having is that for many of the synopses, only one word is common. ...
2
votes
1answer
46 views

What Machine Learning Algorithm could I use to determine some measure in a date?

I am getting stuck with this problem. Let's say that we have the next information. CustomerID: 1, Date: 3/2/2018, Quantity: 3, Total: 390.78, Min: 130.26, Max: 130.26 We want to determine given a ...
0
votes
1answer
34 views

Cutting numbers into fixed buckets

I am trying to put numeric data into fixed number of buckets using Python/R. I have data in key:value format ...
0
votes
1answer
19 views

Divide a column by itself with mutate_at dplyr

Hi I'd like to turn each non zero value of my selected columns to a 1 using mutate_at() ...
0
votes
2answers
26 views

Mutate with dynamic column names dplyr

Hi I got this datatset ...
0
votes
1answer
16 views

The proper way to codify Na in a list in R

I am trying to impute missing timeseries present in different dimentions, row by row, on the whole date set. I showed the type of return of na.kalman() and it ...
0
votes
2answers
16 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
0answers
12 views

Estimation of hidden Markov Model from multiple time series

I've been using the depmixS4 package in R to estimate a single hidden Markov Model from 30 different time series (i.e., 30 different people). Initially, I took the clumsy approach of fitting a model ...
0
votes
0answers
20 views

Perform Topic Modeling By Creating a Function and Pass Along to Purrr : map() using R

My goal is to perform topic modeling (splitting into 3 topics each) by grouping words by word.trend column rather than copy and pasting block of codes for each word.trend as I have 800 unique values ...
2
votes
1answer
5 views

R package clogitL1 no longer available? [closed]

When I try to install clogitL1 on my work server I get ...
1
vote
1answer
28 views

Test for heteroscedasticity in time series

I want to test heteroscedasticity in time series. The tools in python like: statsmodels.stats.diagnostic.het_breuschpagan require residuals as input obtained by fitting model to data. Since this kind ...
2
votes
1answer
73 views

Binary Classification Probabilities

I'm using keras in R to predict financial time series. I guess that ANN converges. But when I do predictions I can see that probabilities don't sum up to 1 I'm using ...
0
votes
0answers
19 views

Plot of Kernel Cumulative Distribution Function

I am trying to plot $\hat F(x)$ of Log-normal kernel in R. Its a simple $\hat F(x)$ of lognormal distribution with some transformation proposed by Jin and Kawczak (...
0
votes
0answers
15 views

Plotting variable importance and cutoff values for variables

I am training a dataset which is normalized using the scale function in R. Then I train the data with cross-validation. I have a test set to test my prediction. I also normalize the test data to get ...
0
votes
0answers
18 views

Any library to find whether a device was stationary or on the move based on geolocation events

For a data-set with TIMESTAMP, DEVICE-ID, LAT, LONG events, how could I find when the device was dwelling? I would like to generate an aggregated data-set that looks something like: (Start-Time, End-...
0
votes
1answer
31 views

How to split data frame into groups, combine rows

I have a large data set with 405 columns and many rows, with data from 15 sites. Each site has 27 columns, each one one quadrats data. Rows are species data. I want to split the data into the 15 ...
0
votes
0answers
30 views

draw a histogram of each column seperately using ggplot2

I have the following data.frame: ...
2
votes
1answer
65 views

ggplot (in R)/matplotlib (in Python) with linear model?

How can I plot the histogram below, using ggplot (R) and/or matplotlib (...
0
votes
1answer
34 views

What algorithms can be used to derive matching rules between known matches in datasets?

Lets say I have two datasets with different column names except for a unique ID key Table 1 CSV ...
1
vote
0answers
53 views

Applying machine learning to time series data and extracting meaningful patterns

I was just wondering if I could get some advice from all you experts who might be able to advise me as a (brand)newcomer to machine learning! I posted this on stack exchange but was told this forum ...
2
votes
1answer
26 views

Retrieving date ranges with the r platform

Using r if I have a data frame that contains dates and temperatures. I would like to pull out all temperatures for January how would I go about phrasing this. I've tried may ways such as ...
1
vote
1answer
45 views

How to identify potential customers who are ready to convert in to paid?

I have the data which having the actions which performing on my tool and want to predict the customers who are ready to convert from free/trail in to paid category . data looks like below : ...
0
votes
0answers
15 views

Linear Regression for Segmented Data using R

I am relatively new to the field of data science and R programming. I am faced with a requirement, where I need to perform linear regression on segmented data. The sample data would look somewhat like ...
0
votes
0answers
59 views

Maximal Frequent itemset Mining package in R or Python

Could anyone please recommend a good(fast) Maximal Frequent itemset package in R or Python? I have 53003 items and 977 transaction data which are very large and sparse. When i'm using eclat algorithm ...
0
votes
0answers
15 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
0answers
20 views

Misclassification splitting criterion for Random Forest

I would like to use misclassification for the splitting criterion to grow a Random Forest. Is anyone aware of a package, ideally in R or Python, that utilizes this splitting criterion? I've looked ...
0
votes
1answer
60 views

Is there any implementation of Extended Isolation Forest algorithm in R/Python?

I am using isofor package for regular Isolation Forest but I came by an article about Extended Isolation Forest and need your advise which package has this ...
0
votes
0answers
23 views

R caret naïve bayes accuracy is null

I've tried to get an answer on stackoverflow, but I think that data science is more specialized. I have a single dataset to train on with SVM and Naïve Bayes. The SVM works, but Naïve Bayes doesn't ...
1
vote
1answer
47 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+...
2
votes
1answer
50 views

Financial Time Series data normalization

I'm using Keras in R to predict financial time series. It's easy to normalize price, simply compute returns or log returns, usually it's enough. I want to use Goldman Sachs Financial Conditions Index ...
1
vote
1answer
44 views

Sparse matrix in R based on the data frame

Suppose I have book ratings in the form of data frame (where 0 means no rating): $\begin{array}{|c|c|c|} \hline \textbf{User.ID}& \textbf{ISBN} & \textbf{Book.Rating} \\ \hline 276725 & ...
1
vote
1answer
53 views

plot the histogram of purchases

i have a dataframe with 34154695 obs. in a dataset a Class variable with value 0 indicate "not purchased" and 1 indicate "purchase". ...
0
votes
0answers
61 views

How does SMOTE create new data from categorical/factor data?

I have used SMOTE to create new data due to unbalanced data. My original data looks sth like this: ...
1
vote
1answer
98 views

Generating Polynomial Features in R

Is there an optimized way to perform this function "PolynomialFeatures" in R? I'm interested in creating a matrix of polynomial features i.e. interactions between two columns among all columns but I ...
0
votes
1answer
18 views

How is the min_rank used with the flights database

I'm exploring the https://r4ds.had.co.nz/transform.html#add-new-variables-with-mutate r for data science handbook and don't really understand the min_rank() ...
0
votes
1answer
17 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
3answers
80 views

Tell me some things a data scientist/statistician needs to do that can't be done in R/Stata/SAS/SPSS [closed]

Why do I need to learn to program in python or Java and learn data structures? I can't think of a single thing statisticians/data scientists need to do that isn't built in as a package in R/stata.
0
votes
0answers
22 views

R Keras classification same output

I have an issue with my Keras model which gives me everytimes the same output for prediction classes. I tried to change optimizer, number of epoch, learning rate, but no change. My model accruacy has ...
1
vote
1answer
21 views

Grouping and summing with r

I have a data.frame that contains two columns that I want to group and sum the direct labor for employees. ...
0
votes
1answer
37 views

How can I extract bootstrap generated datasets into individual dataframes?

I am having a bit of trouble understanding Bootstrapping and what/how I can manipulate the bootstrap created dataset. This is all in R My original dataset is structured like this: ...
0
votes
0answers
20 views

How to compute a rate equation on bootstrap datasets

I am having a bit of trouble understanding Bootstrapping and what/how I can manipulate the bootstrap created dataset. My original dataset is structured like this: ...
0
votes
1answer
18 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 ...