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
7
votes
3 answers

.NET Neural Network or AI for Future Predictions

I am looking for some kind of intelligent (I was thinking AI or Neural network) library that I can feed a list of historical data and this will predict the next sequence of outputs. As an example I would like to feed the library the following…
SetiSeeker
  • 6,482
  • 9
  • 42
  • 64
7
votes
1 answer

R predict() function returning wrong/too many values

I am trying to convert Absorbance (Abs) values to Concentration (ng/mL), based on an established linear model & standard curve. I planned to do this by using the predict() function. I am having trouble getting predict() to return the desired…
user3658874
  • 77
  • 1
  • 1
  • 4
7
votes
3 answers

predict() with arbitrary coefficients in r

I've got some coefficients for a logit model set by a non-r user. I'd like to import those coefficients into r and generate some goodness of fit estimates on the same dataset (ROC and confusion matrix) vs my own model. My first thought was to coerce…
Stencil
  • 125
  • 1
  • 1
  • 7
7
votes
1 answer

Use Predict on data.table with Linear Regression

Regrad to this Post, I have created an example to play with linear regression on data.table package as follows: ## rm(list=ls()) # anti-social library(data.table) set.seed(1011) DT = data.table(group=c("b","b","b","a","a","a"), …
newbie
  • 917
  • 8
  • 21
7
votes
1 answer

how to solve predict.lm() error: variable 'affinity' was fitted with type "nmatrix.1" but type "numeric" was supplied

I have a simple linear model: mylm = lm(formula = prodRate~affinity, mydf) where mydf is a dataframe which looks like: prodRate affinity 1 2643.5744 0.005164040 2 2347.6923 0.004439970 3 1783.6819 0.003322830 when I use predict.lm() an…
Paul.j
  • 794
  • 2
  • 8
  • 17
7
votes
1 answer

glmer - predict with binomial data (cbind count data)

I am trying to predict values over time (Days in x axis) for a glmer model that was run on my binomial data. Total Alive and Total Dead are count data. This is my model, and the corresponding steps below.…
user3250522
  • 71
  • 1
  • 1
  • 2
7
votes
4 answers

warning when calculating predicted values

working with a data frame x Date Val 1/1/2012 7 2/1/2012 9 3/1/2012 20 4/1/2012 24 5/1/2012 50 a <- seq(as.Date(tail(x, 1)$Date), by="month", length=5) a <- data.frame(a) x.lm <- lm(x$Val ~…
user1471980
  • 10,127
  • 48
  • 136
  • 235
6
votes
1 answer

lm predict won't predict

I have 2 data frames. One is training data (pubs1), the other (pubs2) test data. I can create a linear regression object but am unable to create a prediction. This is not my first time doing this and can't figure out what is going wrong. >…
screechOwl
  • 27,310
  • 61
  • 158
  • 267
6
votes
2 answers

Predicting/imputing the missing values of a Poisson GLM Regression in R?

I'm trying to explore ways of imputing missing values in a data set. My dataset contains the number of counts of an occurance (Unnatural, Natural and the sum Total) for Year(2001-2009), Month(1-12), Gender(M/F) and AgeGroup(4 groups). One of the…
OSlOlSO
  • 441
  • 7
  • 14
6
votes
2 answers

Getting a weird error when trying to run xgboost.predict or xgboost.score

I'm trying to run an xgboost regressor model on a dataset without any missing data. # Run GBM on training dataset # Create xgboost object pts_xgb = xgb.XGBRegressor(objective="reg:squarederror", missing=None, seed=42) # Fit xgboost onto…
jdnbo
  • 63
  • 1
  • 1
  • 4
6
votes
0 answers

Multiple Multivariate Multistep time series forecasting with LSTM

I understand how to create models for a Multivariate time series and also know how to produce a multistep output for that series. But how can I expand this model to work on multiple time series? My data contains a time series for many countries and…
Marcus
  • 289
  • 1
  • 3
  • 19
6
votes
2 answers

Does name and order of Features matter for prediction algorithm

Do the names/order of the columns of my X_test dataframe have to be the same as the X_train I use for fitting? Below is an example I am training my model with: model.fit(X_train,y) where X_train=data['var1','var2'] But then during prediction, when…
Tartaglia
  • 949
  • 14
  • 20
6
votes
2 answers

Manually calculate AUC

How can I obtain the AUC value having fpr and tpr? Fpr and tpr are just 2 floats obtained from these formulas: my_fpr = fp / (fp + tn) my_tpr = tp / (tp + fn) my_roc_auc = auc(my_fpr, my_tpr) I know this can't pe possible, because fpr and tpr are…
user9370613
6
votes
4 answers

cv2.lbphfacerecognizer has no attribute 'load' 'predict'

import cv2 import numpy as…
nisahbhtrap
  • 92
  • 1
  • 1
  • 8
6
votes
2 answers

How to get the class probabilities AND predictions from caret::predict()?

In addition to predicting the class labels, is it possible to return the expectation of each observation in new data when predicting? library(caret) knnFit <- train(Species ~ ., data = iris, method = "knn", trControl =…
Doug Fir
  • 19,971
  • 47
  • 169
  • 299