Questions tagged [r]

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

378 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
7
votes
0answers
1k views

AdaBoost implementation and tuning for high dimensional feature space in R

I am trying to implement the AdaBoost.M1 algorithm (trees as base-learners) to a data set with a large feature space (~ 20.000 features) and ~ 100 samples in R. ...
6
votes
1answer
410 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 ...
5
votes
2answers
90 views

How to interpret two continous variables output using GAM?

I really need help with GAM. I have to find out whether association is linear or non-linear by using GAM. The predictor variable is temperature at lag0 and the output is cardiovascular admissions (...
4
votes
0answers
55 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 ...
4
votes
2answers
758 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 ...
4
votes
1answer
60 views

Alternative to VGAM for Zero Truncated Negativ Binomial GLM in R

Is there an alternative to the vgam Package to do a zero truncated negativ Binomial GLM in R?
4
votes
2answers
2k views

fix first two levels of decision tree?

I am trying to build a regression tree with 70 attributes where the business team wants to fix the first two levels namely country and product type.To achieve this,I have two proposals: 1.Build a ...
4
votes
2answers
2k views

Constrained k-means algorithms in R (must-link constraints)

I currently face an unsupervised learning task that is to be approaches using clustering. More specifically, it is a segementation task and hence there is some prior knowledge about a) the number of ...
3
votes
0answers
48 views

XGBoost custom objective for regression in R

I implemented a custom objective and metric for a xgboost regression task. In order to see if I'm doing this correctly, I started with a quadratic loss. The ...
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 ...
3
votes
0answers
37 views

Bag of words: Prediction on new (out-of-sample) data

I'm working with a bag of words in R: library(tm) corpus = VCorpus(textsource) dtm = DocumentTermMatrix(corpus) dtm = as.matrix(dtm) I use the matrix ...
3
votes
0answers
48 views

How can I improve the accuracy of my model? (Cab Cancellation Prediction)

I am trying to predict based on several parameters like trip type, car type, source of booking, start time, lead time (start- book) and a few other params whether or not a customer will cancel. From ...
3
votes
1answer
27 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 ...
3
votes
1answer
140 views

how can I replicate working of Multi Label Binarizer from sklearn package in R?

I want to achieve same working of MultiLabelBinarizer from sklearn.preprocessing package in R. I have list of labels for each example (for Predicated and Actual) like below. ...
3
votes
0answers
57 views

Features selection with a lot of dummy variables in R

I am performing features selection on 3849 dummy variable (one-hot encoding) using Boruta algorithm and the algorithm is taking forever to run. Is there a faster way I can perform features selection ...
3
votes
1answer
206 views

Look for previous date in dataframe that has certain column category in R

I have the following data frame: ...
3
votes
1answer
50 views

Convert from many sub-tables to a single tidy dataframe

I have data in a bad format that I want to make tidy using an R script. I lack the skills to convert it into the format I want, so I look for an answer that (a) outlines a method, or (b) hands me the ...
3
votes
1answer
353 views

k-Nearest Neighbours with time series data - how to obtain whole-time-period estimators

I have a large dataset for the activities performed by multiple staff in a factory over a long period of time - 01/01/2017 - present. The activities performed by different staff are recorded at each ...
3
votes
0answers
55 views

Echo-Effect-Metric Network

I have been working on data science project where I am trying to build a metric for how inbred a source is in a network. We hope to apply this to intelligence reporting, in which documents tend to ...
3
votes
1answer
9k 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 ...
3
votes
0answers
1k views

XgBoost error: contrasts can be applied only to factors with 2 or more levels

...
3
votes
0answers
366 views

Examples for predict.FAMD?

I am doing a study on unsupervised data with various categorical variables. So I have found the FactoMineR package to be really handy for this, particularly with the FAMD functions. I can get to a ...
3
votes
0answers
465 views

How to use hunspell_stem(or a ordinary function) with tm_map?

Recently I've been doing some text mining and the stemming processing is taking a lot of time (I'm working with portuguese language). I found the hunspell package, ...
3
votes
0answers
502 views

Problem Screen Scraping Google Data

I'm trying to use rvest to screen scrape headline news items from google and failing. Having previously written a utility to screen scrape high level stats from DS.SE (not user info I have to say!), ...
3
votes
0answers
93 views

Is there an interface for bootstrap sampling in rattle in R?

I am using rattle in R for predictive models and am trying to see whether there is a difference in different sampling methods. The split function at the start of rattle for splitting into training and ...
3
votes
0answers
64 views

Identifying sequences of behavioral interactions between multiple individuals

I'm wondering if anyone might have some novel insights as to the best way to analyze the following data. It's a problem I've been thinking about in the back of my mind for a while, so I thought that ...
3
votes
0answers
39 views

What are the parameter estimation methods for the two methods in this paper?

Automated Time Series Forecasting for Biosurveillance in the above paper, page 4, two models, non-adaptive regression model, adaptive regression model, the non-adaptive regression model's parameter ...
3
votes
0answers
433 views

ANOVA RBF kernel returns very poor results

I was curious about the ANOVA RBF kernel provided by kernlab package available in R. I tested it with a numeric dataSet of 34 input variables and one output variable. For each variable I have 700 ...
2
votes
0answers
58 views

Which one to choose to identify patterns of user activity: Sequence analysis or process mining?

I have the following user activity data that where for each user the activity type they were engaged are recorded along with the phase: ...
2
votes
0answers
32 views

Plotting regression test errors

I am trying out an R exercise where I have to randomly split my data into train/test set 50 times. On each iteration, I use lm() to train polynomial models up to ...
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
39 views

Association rules in R / Subset rules based on feature

I tried using the apriori algorithm in the arules library for association rules mining in R. There's two thing I'd like to ask: Why are the lhs and rhs of the rules in intervals? For example U get ...
2
votes
0answers
19 views

User defined aggregations on data of around 200GB where row order matters

I am working with "medium large" data of around 200GB. The data are long form log files, where there are several thousand logs for each "entity". The entities are actually flights ...
2
votes
0answers
76 views

Platt Scaling vs Isotonic Regression for reliability curve

I am learning classifier probability calibrations and have calibrated an eleastic net model using both Platt scaling and isotonic regression. As you can see in the attached image Platt scaling (on the ...
2
votes
0answers
106 views

K-Means Clustering Profile Plot & Data Normalization

I am new to k-means clustering and I am working on a project on cryptoanalysis. I have a few questions and I hope to get some help here. I have four variables and my variables data values can range ...
2
votes
0answers
10 views

How to create new graph vertices from existing one with igraph in R?

I have the following DF in R representing a directed graph: ...
2
votes
0answers
26 views

how to plot a mixed graph in R?

How can I plot a mixed graph in R? I have used this but doesn't work (in bnlearn he calls 'arc' to a directed edge and 'edge' to an undirected edge): ...
2
votes
0answers
23 views

How to find transictions and group variables

Having a dataset like this: ...
2
votes
0answers
18 views

Four parameter self-starting function based on SSfpl

I am currently working with a self-starting function for four parameters which I based on SSfpl but with a different formula. This is the formula for my self-starting function: ...
2
votes
0answers
28 views

R train(method=“naive_bayes”) and naiveBayes() very different performance

I am an R novice and having some difficulty. I was hoping R would be a good (flexible, easy) way to do machine learning of textual data. A few years ago, I wrote a naive Bayesian classifier (from ...
2
votes
0answers
22 views

Distinction of different types of missing values is lost after importing data from SPSS into R

I've got a file containing survey data in SPSS. There are 3 types of missing values defined: invalid (coded as 900), not applicable (990), not filled in (999). After importing the SPSS file into R ...
2
votes
0answers
118 views

Tools for reading data from large, irregular csv files (aka excel file hell)

I have a csv file with 1000 columns and 50 rows that was collected over a few months. Embedded randomly in the file are ~1000 small datasets with semi-standard formats (some columns differ, so does ...
2
votes
0answers
19 views

Packages for regression presentation

I have a linear regression model with 20+ variables and am looking for the best way to present my results in R Markdown HTML. Are there any R packages that make significant coefficients stand out and ...
2
votes
0answers
561 views

Can you do automated feature engineering in R?

Since now Python has its own deep feature synthesis library, is there anything similar available in R? I know of bounceR but I'm not sure if it does the job as DFS does. Is anyone aware of anything ...
2
votes
0answers
31 views

Calculate a mean on condtions in a dataframe with dyplr

My table looks like this: ...
2
votes
1answer
124 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 ...
2
votes
1answer
1k 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 ...
2
votes
0answers
58 views

ML/Statistical Model to Analyse the Distribution

Consider a Sample Data-set provided below; ...
2
votes
1answer
583 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
0answers
81 views

detecting anomaly from cdr data

I need to find anomalies from this. The term anomaly in my case is in which square id and in which time the total activity goes higher, how can I detect anomalies with the help of machine learning ...

1
2 3 4 5
8