Questions tagged [prediction]

For questions related to statistical prediction, especially for programming tasks.

In science, a prediction is a rigorous, often quantitative, statement, forecasting what will happen under specific conditions; for example, if an apple falls from a tree it will be attracted towards the center of the earth by gravity with a specified and constant acceleration. The scientific method is built on testing assertions that are logical consequences of scientific theories. This is done through repeatable experiments or observational studies.

Mathematical equations and models, and computer models (e.g., ), are frequently used to describe the past and future behaviour of a process within the boundaries of that model.

In microprocessors, permits avoidance of pipeline emptying at branch instructions. In engineering, possible failure modes are predicted and avoided by correcting the mechanism causing the failure.

2846 questions
9
votes
7 answers

Predict function error for probabilities in glmnet?

I am trying to predict probabilities in a dataset using glmnet. My code reads: bank <- read.table("http://www.stat.columbia.edu/~madigan/W2025/data/BankSortedMissing.TXT",header=TRUE) bank$rich<-sample(c(0:1), 233, replace=TRUE) …
Kasia Danilczuk
9
votes
1 answer

Setting an upper bound of 0 on a 3d loess smoothing with negative values in R

I have a bit of a bizarre question, but hoping someone can help me. I am attempting to create a surface plot of the bottom of a lake and then add some points showing plant frequency for a visual of where aquatic plants are occurring throughout the…
9
votes
1 answer

Difference between predict(model) and predict(model$finalModel) using caret for classification in R

Whats the difference between predict(rf, newdata=testSet) and predict(rf$finalModel, newdata=testSet) i train the model with preProcess=c("center", "scale") tc <- trainControl("repeatedcv", number=10, repeats=10, classProbs=TRUE, savePred=T) rf…
Frank
  • 1,113
  • 3
  • 14
  • 27
9
votes
2 answers

GBM multinomial distribution, how to use predict() to get predicted class?

I am using the multinomial distribution from the gbm package in R. When I use the predict function, I get a series of values: 5.086328 -4.738346 -8.492738 -5.980720 -4.351102 -4.738044 -3.220387 -4.732654 but I want to get the probability of each…
Jim Johnson
  • 93
  • 1
  • 4
9
votes
3 answers

Circle-Circle Collision Prediction

I'm aware of how to check if two circles are intersecting one another. However, sometimes the circles move too fast and end up avoiding collision on the next frame. My current solution to the problem is to check circle-circle collision an arbitrary…
Bojo
  • 313
  • 4
  • 7
8
votes
1 answer

Hidden Markov Model predicting next observation

I have a sequence of 500 observations of the movements of a bird. I want to predict what the 501st movement of the bird would be. I searched the web and I guess this can be done by using HMM, however I do not have any experience on that subject. Can…
user975733
  • 107
  • 1
  • 3
8
votes
1 answer

Batch prediction using a trained Object Detection APIs model and TF 2

I successfully trained a model using Object Detection APIs for TF 2 on TPUs which is saved as a .pb (SavedModel format). I then load it back using tf.saved_model.load and it works fine when predicting boxes using a single image converted to a tensor…
Alberto
  • 467
  • 3
  • 16
8
votes
9 answers

sklearn cross_val_score() returns NaN values

i'm trying to predict next customer purchase to my job. I followed a guide, but when i tried to use cross_val_score() function, it returns NaN values.Google Colab notebook screenshot Variables: X_train is a dataframe X_test is a dataframe y_train…
Tomás Ortiz
  • 111
  • 1
  • 1
  • 8
8
votes
3 answers

Calculating MAPE in H2o: Error: Provided column type POSIXct is unknown

Following my answered question: R or Python - loop the test data - Prediction validation next 24 hours (96 values each day) I want to predict the next day using H2o Package. You can find detail explanation for my dataset in the same above link. The…
King Julien
  • 159
  • 17
8
votes
2 answers

Keras Extremely High Loss

I'm trying to predict price by characteristics. I chose a pretty simple model, but it works very strange. Loss function is extremely high and I can't see where the problem is. Here is my model: # define base model def baseline_model(): # create…
8
votes
0 answers

keras: predict_proba(), predict() and predict_classes() issues

During the predicting phase of my keras model, when I print out predicted values and classes, I'm given different probabilities in predict_proba() and predict(). Also, output for predict_classes() doesn't correspond to the probabilities. Example of…
8
votes
2 answers

Using SlopeOne algorithm to predict if a gamer can complete a level in a Game?

I am planning to use SlopeOne algorithm to predict if a gamer can complete a given level in a Game or not? Here is the scenario: Lots of Gamers play and try to complete 100 levels in the game. Each gamer can play a level as many times as they want…
8
votes
3 answers

What is the difference between inferential analysis and predictive analysis?

Objective To clarify by having what traits or attributes, I can say an analysis is inferential or predictive. Background Taking a data science course which touches on analyses of Inferential and Predictive. The explanations (what I understood)…
mon
  • 18,789
  • 22
  • 112
  • 205
8
votes
3 answers

Predict.glm not predicting missing values in response

For some reason, when I specify glms (and lm's too, it turns out), R is not predicting missing values of the data. Here is an example: y = round(runif(50)) y = c(y,rep(NA,50)) x = rnorm(100) m = glm(y~x, family=binomial(link="logit")) p =…
generic_user
  • 3,430
  • 3
  • 32
  • 56
8
votes
1 answer

Time series prediction using support vector regression

I've been trying to implement time series prediction tool using support vector regression in python language. I use SVR module from scikit-learn for non-linear Support vector regression. But I have serious problem with prediction of future events.…
Tom Marek
  • 378
  • 3
  • 7