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
3
votes
1answer
25 views

Why do Isolation Forest implementations turn it into a supervised learning problem (with random values for the target?) [closed]

I am looking at various implementations of the Isolation Forest in python and R. Both sklearn in python and solitude in R use a y variable with the ExtraTrees regressor. Since, Isolation Forest is ...
0
votes
0answers
7 views

Elastic net in R - error whilst prediciting [closed]

I have no idea how to fix the following code to remove an error: ...
0
votes
0answers
16 views

K-means clustering for east west airline marketing data. Confused in choosing the optimal clusters

Ques: The file EastWestAirlines contains information on passengers who belong to an airline’s frequent flier program. For each passenger the data include information on their mileage history and on ...
0
votes
0answers
15 views

String manipulation in R [closed]

I have a vector called "condition" and I want to change the value of condition to number of hours left for all the records. What is the best way to do it ? condition <- c("10 days ...
1
vote
0answers
35 views
+50

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: ...
0
votes
0answers
11 views

How can the forecast accuracy of three models for a categorical time series be compared?

This is a general question. Can anybody please point me in the direction of how I can compare the forecasts of a 3 level categorical time series by three competing models? I would like to compare the ...
0
votes
0answers
13 views

Error in predictions using glmnet() function in R

I've got a problem with my code, whilst making predictions using glmnet() Here is my code plus an error which occurs: ...
0
votes
1answer
28 views

Replace values that starts with “<” in a data frame in r [closed]

I am new to R and would like some assistance on replacing multiple values in a large dataset with many variables to NA at once in r. I want all the cells with "<0.01, <0.02, and many others ...
0
votes
0answers
9 views

Endogenous and exogenous ordinal variables in R studio Lavaan

I am new to using R studio, so apologies for the basic question. I have run a number of Confirmatory Factor Analyses using the Lavaan package. Each questionnaire item is on a 4 point Likert scale 0 = ...
0
votes
0answers
32 views

Odd results on bias-variance tradeoff assessment

I am running a bias-variance tradeoff assessment on ten regression models of increasing complexity (linear to x^10), but my results do not satisfy the MSE = Bias^2 + Variance + True Error relationship....
0
votes
0answers
9 views

R - using heatmaply for a 2d histogram / density

I have a rather long series of x, y coordinates representing a character in 2d space. Let's say that space is 200 x 400. I want to represent the amount of time the character is in each x, y coordinate ...
3
votes
0answers
32 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 ...
0
votes
0answers
12 views

python equivalent of doParallell in R

I have a code written in R which uses doParallel and makeCluster libraries. I try to convert that into Python and send it to a ...
0
votes
0answers
22 views

Trying to plot REC curve and calculate AUC in R but getting error

I am working on regression machine learning techniques and calculating AUC (plotting REC) by using below paper link: http://homepages.rpi.edu/~bennek/papers/rec.pdf My Code; REC <- function(y_val , ...
2
votes
0answers
31 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 ...
1
vote
0answers
18 views

Stabilize Neural network prediction for class probability

I could not carry my question from stackoverflow I ve been trying to fit a neural network for binary setting using library(keras) and I am interested in class ...
-1
votes
0answers
9 views

Cannot differentiate lines in R [migrated]

I'm learning how to use R. I'm running a competing risk analysis with the cmprsk package. ...
0
votes
0answers
14 views

Error when comparing testset with training set in ARIMA R

I am working on a monthly dataset (timeseries) using R. The dataset consists of 159 rows starts from Feb 1996 to March 2004. I set aside the last 12 months of data (Apr 2003- March 2004). Performed ...
0
votes
1answer
53 views

Removing constant from the regression model

I am trying to calibrate two variables $(X,Y)$ of different measuring techniques from two instruments, the result of the linear regression analysis appears as shown in the image. The result shows the ...
1
vote
0answers
21 views

How do I test and validate a Markov Model in RStudio?

I've created a Markov Model in RStudio using the seqHMM library. I'm new to R and would usually do this kind of thing in Python, but I wanted to use seqHMM. I can see the model has been created and it ...
1
vote
0answers
52 views

The Merits of Feature Reduction Routines

I am interested in learning what routine others use (if any) for Feature Reduction/Selection. For example, If my data has several thousand features, I typically try {2,3,4} things right away depending ...
0
votes
0answers
11 views

How to highlight text from text search output with includeHTML without using data frame or data table?

I created a working text search app but to ease user experience, I want to highlight text which is outputted in HTML file . Most of the information available is for converting into ...
2
votes
3answers
102 views

Significance of Object-Oriented Programming (OOP) in Data Science [closed]

Can someone please explain to me the role of Object-Oriented Programming (OOP) and Object-Oriented Design (OOD) in Data Science? I am from a non-computer science background. Do I need to learn these ...
2
votes
1answer
30 views

Question about scaling in (R) Principal Components Regression

I'm reding Introduction to Statistical Learning (ISL), Ch. 6 Principle Component Regression. When I look at the Labs, I wonder how scaling is handled in R in this ...
0
votes
0answers
12 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
0answers
12 views

Similarity matching between two distinct datasets (marketing case study)

I am working for a company that sells different products to customers. My objective is to find customers that are likely to purchase product X based on the profiles of customers that already purchased ...
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
32 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? ...
0
votes
1answer
25 views

How to output my uploaded text in Shiny in R at the position of the screenshot?

I would like to position a long text on the right side of this Shiny app, as shown on the screenshot below. ...
0
votes
1answer
35 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 ...
0
votes
1answer
24 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 ...
0
votes
0answers
42 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 ...
2
votes
2answers
42 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: ...
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
3answers
79 views

How do I interpret the output of linear regression model in R?

I have the following linear regression model and its analysis. There are a few errors, but I am not very sure about the errors. I have not succeeded in finding them so far. First, the 95% confidence ...
0
votes
1answer
20 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
33 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+...
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. ...
0
votes
0answers
16 views

Using deep learning or statistical tools to complete physical equation

I need to predict a continuous variable Y in a regression setting. Theory in the field tells me it should follow an equation of the form: $$Y=g_0(X)-f_1(X)g_1(X)-f_2(X)g_2(X)$$ Where X is a vector of ...
2
votes
1answer
51 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: ...
1
vote
1answer
13 views
1
vote
1answer
17 views

Covert R dataframe column to Date

I have a R dataframe having a column with dates in multiple formats. I want to convert this column to date format. While some formats are converted others are not. Why is the second date not converted?...
3
votes
1answer
31 views
0
votes
0answers
17 views

Supervised Text Classification

I need to create a summarized report showing how many containers are being imported by each company. This report needs to be generated on monthly basis. The company names are entered in a way that ...
1
vote
2answers
51 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 ...
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 ...
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 ...
1
vote
0answers
14 views

Factor Analysis with Mixed Data Concurrent Approach with PCAmixdata in R

I am trying to perform Factor Analysis over Mixed Data using R with PCAmixdata package. My dataset is huge with almost 115000 records and almost 40 features of both categorical and continuous. When I ...
5
votes
2answers
104 views

Data visualization with extreme far away points

I want to show points across two groups. However, for both groups, there are some points which are far away from most of the other points within each group, shown below. Any suggestions for this ...
25
votes
7answers
6k views

Is Python a viable language to do statistical analysis in?

I originally came from R, but Python seems to be the more common language these days. Ideally, I would do all my coding in Python as the syntax is easier and I've had more real life experience using ...

1
2 3 4 5
25