Questions tagged [predict]

Prediction of values based on model objects.

Predictive models are statistical or algorithmic models for use in prediction tasks. These tend to arise in data-intensive contexts, hence there is a strong association with statistics and machine learning.

Tag Usage

Questions on tag should be about implementation and programming problems, not about the statistical or theoretical properties of the technique. Consider whether your question might be better suited to Cross Validated, the StackExchange site for statistics, machine learning and data analysis.

1574 questions
8
votes
2 answers

How to do parallel GPU inferencing in Tensorflow 2.0 + Keras?

Let's begin with the premise that I'm newly approaching to TensorFlow and deep learning in general. I have TF 2.0 Keras-style model trained using tf.Model.train(), two available GPUs and I'm looking to scale down inference times. I trained the model…
8
votes
2 answers

Visualising a three way interaction between two continuous variables and one categorical variable in R

I have a model in R that includes a significant three-way interaction between two continuous independent variables IVContinuousA, IVContinuousB, IVCategorical and one categorical variable (with two levels: Control and Treatment). The dependent…
Sarah
  • 789
  • 3
  • 12
  • 29
8
votes
1 answer

R predict warning

Doing: predictions <- predict(lm.sqrtFlatprices, interval='prediction', level = 0.68) ^ 2 I get: predictions on current data refer to _future_ responses Why is this warning exist, and how can i suppress it?
galah92
  • 3,621
  • 2
  • 29
  • 55
8
votes
1 answer

Convert predicted probabilities after downsampling to actual probabilities in classification (using mlr)

If I use undersampling in case of an unbalanced binary target variable to train a model, the prediction method calculates probabilities under the assumption of a balanced data set. How can I convert these probabilities to actual probabilities for…
tover
  • 535
  • 4
  • 11
8
votes
2 answers

Bizarre behaviour of lm() and predict.lm() depending on use of explicit namespace accessor

I am interested in some disturbing behaviour of the lm function and the associated predict.lm function in R. The splines base package provides the function bs to generate b-spline expansions, which can then be used to fit a spline model using lm, a…
mb7744
  • 390
  • 2
  • 12
8
votes
0 answers

Error in R: no applicable method for 'predict' applied to an object of class "regsubsets"

I was trying to run codes from textbook ISLR. It is about Best Subset Selection: library(ISLR) #contain data Hitters library(leaps) #use regsubsets regfit.full=regsubsets(Salary~.,Hitters) predict(regfit.full) Then R showed error: Error in…
Jason
  • 81
  • 1
  • 1
  • 5
8
votes
1 answer

How to predict terms of merMod objects (lme4)?

For simple glm objects, I can use predict(fit, type = "terms") to retrieve a matrix with fitted values for each term. What is the equivalent for lmer resp. glmer fitted models? As far as I can see, the predict.merMod function does not support type =…
Daniel
  • 7,252
  • 6
  • 26
  • 38
8
votes
1 answer

How to predict with multinom() in R

I'm trying to calculate predicted probabilities using specific values, but R shows the following error: Error in model.frame.default(Terms, newdata, na.action = na.omit, xlev = object$xlevels) : variable lengths differ (found for 'x') In…
user1172558
  • 655
  • 4
  • 12
  • 18
7
votes
0 answers

am I using the wrong data type with predict.nnet() in R

My lack of understanding of R is causing me to grind to a halt in my work and seek your help. I'm looking to build a neural network from some time series data and then build a prediction using separate data and the model returned by the trained…
tfb
  • 267
  • 2
  • 11
7
votes
1 answer

How do I manually plot SE/CI around a model estimate

I am trying to manually plot model estimates on top of data. My real problem is far more complicated than this, so I want to avoid using predict if I can, and would prefer to understand how these predictions would be calculated rather than relying…
Dylan_Gomes
  • 2,066
  • 14
  • 29
7
votes
3 answers

How to load a model with tf.saved_model and call the predict function [TENSORFLOW 2.0 API]

I'm very new to tensorflow and especially the 2.0 since there's not enough examples about that API but it seems much handy than the 1.x So far I managed to train a linear model using the tf.estimator api, and then managed to save it using the…
elhoudev
  • 91
  • 1
  • 4
7
votes
1 answer

Predict in Tensorflow estimator using input fn

I use the tutorial code from https://github.com/tensorflow/tensorflow/blob/r1.3/tensorflow/examples/learn/wide_n_deep_tutorial.py and the code works fine until I tried to make a prediction instead of just evaluate it. I tried to make another…
Gregorius Edwadr
  • 399
  • 1
  • 3
  • 14
7
votes
4 answers

Error when predicting new fitted values from R gamlss object

I have a gamlss model that I'd like to use to make new y predictions (and confidence intervals) from in order to visualize how well the model fits the real data. I'd like to make predictions from a new data set of randomized predictor values…
BonnieM
  • 191
  • 1
  • 13
7
votes
1 answer

How to predict random and fixed effect models?

I just recently made a change from STATA to R and have some troubles implementing the R equivalent of the STATA commands xtlogit,fe or reand predict. May I ask for some assistance to adjust the following scenario: data <-…
Googme
  • 914
  • 7
  • 27
7
votes
1 answer

Parallel predict

I am trying to run predict() in parallel on my Windows machine. This works on smaller dataset, but does not scale well as for each process new copy of data frame is created. Is there a way how to run in parallel without making temporary copies? My…
Tomas Greif
  • 21,685
  • 23
  • 106
  • 155