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
0answers
7 views

Changing objective functions with penalty term in XGboost in R

I basically have something like: ...
2
votes
0answers
12 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 ...
1
vote
0answers
9 views

How to speed up propensity matching (matchit) in R?

My dataset has 7 columns(patient level data columns being age,gender etc and a target flag). My set has around 12 Million rows around 16K targets out of the same. I'm trying to match similar patients ...
0
votes
1answer
15 views

How to interpret Variance Inflation Factor (VIF) results?

From various books and blog posts, I understood that the Variance Inflation Factor (VIF) is used to calculate collinearity. They say that VIF till 10 is good. But I have a question. As we can see in ...
0
votes
2answers
15 views

Logistic regression threshold value

How can i set the threshold value for the target variable. For example if a target variable is chance_of_admit and it has values from 0 to 1, how can I pick a value and so that I can convert it to 0's ...
1
vote
2answers
22 views

How to make tool that's robust to user-generated typos?

Background: A client is generating datasets (excel files). They asked I make an app to analyze the datasets, e.g. summary tables and figures. I'm doing this in R shiny. Problem: There are many typos ...
0
votes
0answers
10 views

How does setting preProcess argument in train function in Caret work?

I am trying to predict the times table training a neural network. However, I couldn't really get how preProcess argument works in ...
1
vote
0answers
14 views
2
votes
1answer
42 views

Evaluate clustering by using decision tree unsupervised learning

I am trying to evaluate some clustering results that a company did for some data but they used an evaluation method for clustering that i have never seen before. So i would like to ask your opinion ...
0
votes
1answer
27 views

overfitting of regression tree from the beginning

I am trying to build a regression tree to model insurance claim frequencies. I have 36000 observations and 9 covariates. My model overfits right from the beginning!, ie as the cost complexity goes ...
0
votes
1answer
51 views

Random Forest Overfitting, issues with mtry=1?

I am constructing what is known as an 'Expected Goals' model for football. This metric measures shot quality and a probability is assigned to a shot to achieve this, i.e. the chance a shot will be ...
0
votes
0answers
6 views

`fourfoldplot` not displaying size and colors correctly with numbers in column labels

If I use a sample table, like so: ctable <- as.table(matrix(c(42, 6, 8, 28), nrow = 2, byrow = TRUE)) and plot with ...
1
vote
0answers
21 views

Predict with some probability the day of the month paycheck received through daily transactions

I am using R to do machine learning. I have daily shopping expenditure data of individuals over a couple of months and my goal is to be able to identify through their shopping pattern the day of the ...
2
votes
3answers
48 views

Big difference in randomTree accuracy with train and test sets

I've created a model using randomForest for the following dataset: https://archive.ics.uci.edu/ml/datasets/Contraceptive+Method+Choice The thing i'm questioning is that the results of the model when ...
0
votes
0answers
72 views

Error using msmFit in R

I am trying to analyze a time series data using the MS model with R. I wrote the following codes and then got an error at the last line: ...
3
votes
2answers
67 views

Am I overfitting my random forest model (more information in description)?

First off, sorry if this a novice question! Relatively new to all this stuff. Posted this in Stack Overflow and someone sent me here! Hope it's the right place. Anyway, I'm working with 22 datasets ...
0
votes
0answers
73 views

Python Keras model performs much worse than R Keras model

I got this R Keras model from GitHub that performs really well. GitHub repo ...
0
votes
1answer
22 views

Merge columns of coordinates and construct sequence

I have to following data frame. ...
0
votes
0answers
12 views

Multivariate survival analysis on R?

I’m doing a project where I need to carry out a multivariate survival analysis in R. The usual method is to use a Cox proportional hazards model but in this case, the proportional hazards assumption ...
0
votes
1answer
32 views

In a list, find the numbers where they are bigger than the next numbers

I'm using Rstudio. I have a list like below, I want to find all the numbers that are bigger than the next numbers (i.e. numbers on their right hand, I make them bold). 7 7 9 9 9 10 10 1 51 51 53 ...
0
votes
1answer
22 views

Customer Segmentation: Should I use a variable, representing a product, that is unpopular in the dataset for K-Means Clustering?

I am working with a data set that, besides customer age and income, tells the balance a customer has in different type of bank accounts: Checking, Shares, Investment, Savings, Deposit, Mortgage, Loan, ...
0
votes
1answer
17 views

Free API for historical weather US data?

I am trying to retrieve a free R-Python API that provides historical weather data in US. In fact wunderground API is no longer available. Any suggestion?
1
vote
3answers
89 views

Correlation Matrix for non-numeric features

Currently, I have dataset with numeric as well non-numeric attributes. I am trying to remove the redundant features in the dataset using R Programming Languages. Note: Non-numeric attributes cannot ...
0
votes
0answers
17 views

Reverse of Yeo Johnson variable transformation done by preprocess function in caret package to get original Target and predicted values

I have done a Yeo Johnson transformation by using preprocess from caret package. I have predicted the Target Variable using linear regression. Now I want to reverse the transformation for both the ...
0
votes
0answers
5 views

Error condition has length > 1 and only the first element will be used [migrated]

I am writing a function so that I can count the number of NAs in the columns I am interested in. Below, pts_au is a balanced panel data set of country-years, ...
0
votes
0answers
6 views

Decompose and stl decomposition functions problem when frequency is equal to 1

I am using the library fpp2 in R and using the wmurders time-series to forecast the murders of females in the US. We have a time-series from 1950 until 2004. I actually have a problem defining the ...
0
votes
0answers
11 views

Interpretation of hurdle model with negative binomial distribution

I envisage to employ a hurdle model in R, as for instance described here. Question: how I can derive marginal effects from the hurdle model? With linear ...
0
votes
1answer
25 views

Fill the missing values (NA) in various columns (independently of each other) using imputeTS package (in particular, na_kalman function)

A friend of mine has recently started working on R-studio and is interested in filling the NA values in different columns using the above-mentioned function. Also, since he intends to run a time ...
1
vote
1answer
18 views

Is there a way to aggregate frequency distribution for many runs?

In the following plot I have frequency distribution for each of the fitness values that are shown in thte legend. Each run (x-axis) has a different frequency of each fitness value. The total runs is ...
0
votes
0answers
54 views

Why does Caret featurePlot returns returns NULL?

I am trying to use featurePlot of caret in R. This is the code I am using: ...
0
votes
1answer
30 views

R packages: How to access csv files in data subfolder? [closed]

I have successfully written an R package and want to ship it with a specific csv file. I placed the file in the data and ...
1
vote
0answers
12 views

r - tbart package, allocations function - How can I force a solution without a list of sites?

I am attempting to solve a p-median problem for a given dataset. I can successfully produce a list of optimal candidate sites. However, I am interested in a secondary list of optimal candidate sites ...
1
vote
0answers
43 views

Hyperparameter Tuning using Bayesian Techniques

I've been looking into Bayesian optimization for hyperparameter tuning and trying to compare the results I get to those I get using different methods (random grid search). I came across this site, ...
0
votes
0answers
8 views

Sample the transaction set with close lift or/and confidence estimate with original set[association rules]

In frequency set mining, for large sets, we can use sample to reduce the calculation while not miss too much for the support using formula: ...
0
votes
0answers
12 views

Detect positive and negative changes

Having a dataset like this: What model change I use to show positive and negative transitions between the the 5 variables and correlate them? ...
1
vote
1answer
32 views

How do you Show a Difference between Two Groups (Clustering)

I am approaching a data problem. My data set consists of observations of (X,Y) coordinates indicating a position on some grid. There are two groups based on a variable Z. Group A is all the points ...
0
votes
0answers
9 views

How to encode factor predictors in prediction models

The response variable as well as all predictor variables in my dataset are factors. I want to build a model for predicting the response variable. As I understand I have to first encode my predictor ...
0
votes
0answers
22 views

How to apply bootstrap to knn model in r

I have test data and train data in test.csv and train.csv respectively. train$X are volt to current ratio and train$y are the ...
0
votes
3answers
36 views

What is the better to pre-process data, MS-Excel or Python/R [closed]

While handling data, many anomalies occur that might change the results. For example, outliers, missing values, etc. So in this context, what is the better tool to pre process data? A visual tool like ...
0
votes
0answers
10 views

Error in the train function

I'm building a model and i want to re preocess the data using PCA but i have an error in the train function : ...
1
vote
1answer
45 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. ...
0
votes
0answers
8 views

Labelling through Markov Switching models

I am new to machine learning, in the past I have worked with time series techniques. I have a database composed by the financial time series of SPX, its Exponential Moving average 20days, BBB ...
0
votes
0answers
14 views

Structure learning for numerical type of data

Bellow I have some code, where the code works with categorical data but produces the error (for the numerical data): Error in data.type(x) : variable chas is not supported in bnlearn (type: integer)...
0
votes
0answers
12 views

thermal images in R

I have a large set of thermal images to process in R. Taken with Infratec IRBIS camera. Is there an R package to import the images directly in R? What are some other ways to get temperature data ...
0
votes
0answers
10 views

Extra Alignment Error with KableExtra in R-markdown

I am relitively new to R and R-Markdown. I am receiving an error message of ! Extra alignment tab has been changed to \cr. \endtemplate In Table 4. I do not know what the error is telling me, ...
4
votes
2answers
96 views

R has {drake} which makes it easy to make reproducible data pipelines. Does Python have a similar package?

See R's {drake}. It allows you to define a reproducible pipeline ...
1
vote
1answer
25 views

xgboost in R have different results compared to boosted decision tree in Azure ML

I have a small data set (4000 records with 10 features) and I used XGBOOST in R as well as Boosted Decision Tree model in Azure ML studio. Unfortunately the results are different. I like to optimize ...
0
votes
1answer
38 views

SQL and JSON database - R

I have a database (PostgresSQL) which looks like this: ""results"": {""WEBS"": {""WEBS_4"": [{""ip"": ""XXXXX"", ""value"": ""YYYY""}]}} I would ...
0
votes
0answers
13 views

POS extraction using CoreNLP

I have a corpus of windows related documents, for which I need to extract nouns and verbs. However, it is required that I keep certain windows specific words such as "inline hooking", "instruction ...
1
vote
2answers
53 views

Turning R scripts into a “data science tool”

I have R scripts that process a client's datasets (make figures, summary tables, etc). I'd like to package these scripts into a standalone program, aka data science tool, that I can give to the client ...