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

How to do Multivariate Adaptive Regression Splines feature selection in python? Specifically, I need the python equivalent of the earth function in R

This is the code in R: marsModel <- earth(eval(parse(text=paste(ResponseVariable,"~."))), data = data) #build model ev <- evimp (marsModel) Response ...
1
vote
0answers
16 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 ...
1
vote
0answers
8 views

Can I use LSTM models to evaluate multiple, independent time series?

Let's say that I would like to predict the temperature tomorrow. I could use the approach whereby I train a model based on a time-series dataset collected from a single location (for example, see this ...
0
votes
1answer
25 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 ...
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. ...
0
votes
1answer
25 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
2answers
271 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
18 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 ...
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
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?
1
vote
1answer
63 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
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: ...
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
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: ...
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 ...
2
votes
0answers
20 views

How to find transictions and group variables

Having a dataset like this: ...
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 ...
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 ...
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 ...
1
vote
0answers
39 views

Select the right distribution

I have a dataset like: ...
2
votes
2answers
42 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. ...
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 ...
1
vote
0answers
28 views

Finding optimal threshold in extreme value theory - Peak Over Threshold-method (POT)

I am using r and doing a project with extreme values. Now I need to find optimal threshold based on charts outputs but I can't find any information how to interprete them. I am using ...
1
vote
1answer
27 views

R: Error when using Aggregate function to compile monthly means into yearly means

Disclaimer: I'm extremely new to R and have been getting by with using google as my professor. I have a somewhat large collection of monthly values over a period of several years from several ...
2
votes
1answer
17 views

Testing for gender composition between groups

I did kmeans with k=4 and I would like to find out if there are any differences in the composition of gender between the 4 clusters. Do I use Fisher's Exact Test of Independence? Is there any ...
2
votes
0answers
15 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: ...
1
vote
0answers
23 views

R, optimal return level from output chart, gpd.fitrange (ismev)

For purpose of project I must find optimal return level using gpd.fitrange from ismev library. Can anyone tell me how to interprete the chart it outputs? What is the optimal return level here?
3
votes
2answers
287 views

How do tech-companies employ Random Forest on large data sets?

The algorithm takes quite a long time to train on large data sets with a moderate number of parameters: https://stats.stackexchange.com/questions/37370/random-forest-computing-time-in-r https://...
1
vote
0answers
32 views

How to convert this forumal to a proper code?

I have the following formula [1] that I attempted to transform in to a function via R. However, my initial outputs are disconcerting. Before I go through many blocks (images), I am hoping to get ...
1
vote
1answer
15 views

How can I combine two datasets and assign factors to each?

I have a very basic question (just starting with R). I have two datasets (xlsx files) with one variable (x) and 11 observations. I need to combine these two tables to one table with the variable x (...
2
votes
2answers
38 views

can't install gRain package

I am new to R and trying to install the gRain package. However, I am getting the error: dependency ‘gRbase’ is not available Then, when trying to install gRbase ...
0
votes
0answers
16 views

Improve processing speed of clusterboot function in R

I want to validate my clustering scheme using the clusterboot procedure of the fpc package in R (using RStudio). However, I have a dataset of nearly 5,000 cases and my code does not complete running. ...
0
votes
0answers
15 views

R language - text.tree()'s pretty parameter

running the below R code to perform analysis on RoomOccupancy dataset ...
1
vote
1answer
34 views

How can I compare the contribution of two predictors in two different sorts for machine learning algorithms?

I'm new to machine learning and try to clarify my problem in research. I just wonder if I can compare the importance of two different variables in two different sorts. For example, A and B are two ...
1
vote
0answers
33 views

Is copying parameter considered as plagarism?

So my friends and i are writing a kaggle assignment and the base code is written by me. One of my friend use my base code(feature engineering, labeling, etc.) and put it into a loop to find the best ...
0
votes
1answer
17 views

What is RFormula in simple English?

Question Is R Forumula is to train a linear regression model? If a response value "cancel probability" is a function of (age, height), then R Formula is to generate a model (w-age, w-height, w-bias)...
1
vote
1answer
98 views

How to split train/test data 50% by class and grouping by Object ID in R?

I get pixel values ​​from it using reference polygons. Extracted pixel values are in data frame, but one row represent extracted values for single pixel. In the classification I need to split the ...
0
votes
0answers
24 views

Need help with method=“leapSeq”

Here is my code: ...
1
vote
1answer
28 views

ML in R (caret-package) missing hyperparameters

I have a pretty specific question regarding the caret package however I still hope to finde help here. I recently worked with the caret package and trained a multilayer perceptron with ...
2
votes
0answers
18 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 ...
0
votes
0answers
16 views

Bradley-Terry for pairwise comparison with confidence levels

For a scientific study that I'm currently working on, I will evaluate three different configurations (A - B - C). These configurations will be evaluated in a pairwise comparison fashion (A-B, A-C, B-C,...
1
vote
0answers
13 views

Keras Embedding layer weights

I am trying to analyze the weights in a trained Keras embedding layer. The goal is to understand how well (or how poorly) we're capturing relationships between some specific tokens in our texts, ...
1
vote
0answers
13 views

Does the R hts-Package work with time series of different units?

currently I'm having a look at the wonderful hts-Package. Its idea is to forecast hierarchical time series (like described here). In this example the unit of measurement across all time series is the ...
0
votes
0answers
23 views

Changing objective functions with penalty term in XGboost in R

I basically have something like: ...
2
votes
0answers
17 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 ...
0
votes
1answer
43 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
37 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 ...