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
1
vote
2answers
32 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 ...
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 ...
0
votes
1answer
191 views

Setting input shape for an NLP task in R(Rstudio) using keras 1D convolution layer, when it expects 3 dimensional input (a tensor)

I am using R programming language and using Keras API to build a functional 1D CNN. I have a matrix of my dataset of the following shape rows*features (6000*1024). The input layer is set using the ...
2
votes
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 (...
0
votes
1answer
697 views

Naive Bayes Predict type = 'raw' returning NA

I have build a naive bayes model for text classification.It is predicting correctly.But it is returning 'NA' in prediction results if i put 'type = raw'.i have seen some results in stackoverflow to ...
1
vote
2answers
42 views

Riskscore creation on Numerical Data

I am working to create a Risk score on a data where I have variables - Invested_amount, Profit Amount, Age of Account in days, Total Trading Transactions,Profit per Transaction & Investment per ...
0
votes
0answers
15 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
1answer
226 views

How do I calculate a similarity matrix with a Student-t kernel?

As the title says, how do I calculate a similarity matrix with an un-normalized Student-t kernel? I'm attempting to calculate Kullback-Leibler divergence for different t-SNE runs, but need a Q-matrix ...
0
votes
1answer
36 views

Append and replacing data in r

I am writing a few lines of codes to create a data table full of NAs but don't know how to append the data of results into the data table I created while replacing the position of NAs. Here is my data ...
0
votes
1answer
69 views

sagemath: compared to r.quantile, what is a faster way to find boundaries for a boxplot?

I was using the r.quantile method in sagemath to find boundaries for a box plot. The plot was taking a long time using r.quantile. r.quantile took more than 20 seconds to find the quartiles for a ...
2
votes
1answer
40 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 ...
0
votes
1answer
29 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 ...
0
votes
1answer
30 views

How to interpret two continous variables output using GAM?

I am sort of new in R and learning day by day. 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 ...
3
votes
2answers
1k 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 ...
2
votes
1answer
83 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 ...
1
vote
1answer
66 views

Importing Excel format data into R/R Studio and using glmnet package?

I have no problem importing Excel formatted data into R/R Studio and use all other R packages that I use. But, when I want to use the glmnet package to develop a regularization model, I invariably ...
0
votes
3answers
54 views

Why does changing the cluster number change the plot in Kmeans?

This might be a dumb questions but I can't find the answer to it. I don't have the perfect mathematical understanding of kmeans, so apologies if it is. I'm just wondering why I see a different plot ...
1
vote
2answers
31 views

Merge columns of coordinates and construct sequence

I have to following data frame. ...
1
vote
1answer
172 views

Hierarchical Clustering and Variable Selection

I am using "Single linkage" hierarchical algorithm to cluster my data points with Gower Distance as my data have both qualitative and quantitative variables. After applying this for the full ...
2
votes
2answers
272 views

Analysis of Time Series data

The below graph is a scatterplot of daily stock price. My aim is to predict future stock price of the company. From the scatterplot it seems that it is a multiplicative model, so I tried to "...
0
votes
1answer
40 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
0answers
15 views

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

running the below R code to perform analysis on RoomOccupancy dataset ...
1
vote
2answers
171 views

Xgboost in R: Dealing with extreme class imbalance

My data has an extreme class imbalance - 99.7% is 0's and 0.2% is 1's and almost all the predictor variables (6 out of 7) are categorical. I trained an xgboost classifier after performing an ...
0
votes
0answers
24 views
2
votes
1answer
33 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 ...
0
votes
1answer
26 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
2answers
1k views

How to plot using facet_wrap, over multiple pages as a .pdf files in r cran

I am using ggplot, to compare 114 unique studies for a particular variable I'm interested in. This is what I have used. ggplot(steps, aes(x=factor(edu))) + geom_bar(aes(y = (..count..), group = ...
1
vote
0answers
32 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 ...
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 ...
1
vote
1answer
2k 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 ...
1
vote
1answer
34 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 ...
1
vote
1answer
86 views

Regression model for continuous dependent variable and count independent variables

I am currently learning R and I am relatively inexperienced in the field. Hope I can get some advice from you guys! I am working on a project where I have to estimate the average processing time of ...
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 ...
1
vote
1answer
58 views

generate a report in R where the value in each Column is to be derived from different tables in sybase databasea

I work in a stress testing team. my boss has asked me to generate an interactive report every day using different tables in a Sybase database. I know the table structure and sql queries, but can't get ...
3
votes
1answer
276 views

Understanding Spikeslab Output

I'm using spikeslab for the first time, but don't understand what the output means. It was suggested to me that I use it to tell which variables my dependent variable is most correlated to, in a ...
0
votes
2answers
89 views

Replace Values in Vector on Specific Place in R

I want to make $5^{th}$,$10^{th}$,$15^{th}$,$20^{th}$ and $25^{th}$ values of vector an outlier in all xs by using x1 [5]+OT1,...
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
15 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
1answer
52 views

Misclassification Rate for Random Forest Plateauing too Early

Using R, I have created 5 different random forest models using 5 different numbers of trees (3,10,30,100,300). My intention was to compute the misclassification rates of each of these models and plot ...
2
votes
1answer
80 views

Evaluating the performance of a random forest classifier

I'm using a random forest classifier (in R) to impute missing data in a dataset. Basically, I have a bunch of objects (companies) and I want to guess an attribute (...
0
votes
2answers
74 views

Dataset Merging

I have several datasets (All looks like this). The Problem is, that the same user is on several datasets. I need to merge the different sets in a way, that if the username is the same, the frequencies ...
1
vote
0answers
12 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
22 views
0
votes
1answer
117 views

Spliting training data into multiple variables using R

So right now I am trying to create multiple variables with training data, and in the process I have reached an error Error in eval(predvars, data, env) : object '1.band1' not found which is a ...
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
40 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 ...
1
vote
1answer
155 views

Can you reuse observations from your train data in your final test data?

For an employee population, I am trying to determine who among the employees are likely to get injured in the future based on 2 years worth of data. Unlike in most machine learning problems where you ...
0
votes
2answers
34 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 ...