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
1answer
70 views

RNN package and problems with “Predictr”

I have two questions about how to use R's RNN package, specifically the trainr and predictr functions. Let's suppose I have a time series of 4000 steps for 5 different variables. How should this be ...
0
votes
2answers
682 views

Fitting an arimax model on out of sample dataset

I have built an arimax model where we have sales data across time as the response variable and price is one of the external variables. I used the below code to build a simple arimax model. I had data ...
2
votes
0answers
16 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
25 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?
2
votes
1answer
969 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 ...
0
votes
0answers
32 views

Linear regression plotting abline()

I have a ufc data set which i got and started cleaning for my own practice This the link to data:-https://www.kaggle.com/rajeevw/ufcdata#raw_fighter_details.csv and using ...
2
votes
2answers
128 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
39 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
265 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 ...
1
vote
1answer
18 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
732 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
21 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
242 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
38 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
78 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
43 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
61 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 ...
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
97 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 ...
0
votes
3answers
65 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
229 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
326 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
21 views

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

running the below R code to perform analysis on RoomOccupancy dataset ...
1
vote
2answers
239 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
34 views
1
vote
1answer
41 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
27 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
2k 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
34 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
114 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
38 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
101 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
32 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
62 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
285 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
113 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
22 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
1answer
56 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
92 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
80 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
15 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
15 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
46 views
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 ...

1 2 3
4
5
24