0
votes

I am currently studying weather prediction using R.

I tried rpart but some of the predictions are removed.

My data contains Weather, Humidity, and Temperature can be found on the link,

Weather Data.

I just want to create ranges for the prediction like:

Haze = Temperature is 27 to 29 & Humidity is 72 to 76

for all the data under weather. What is the best thing to do?

1
I'm trying to know the range to categorize that this temperature and this humidity is a haze.April Capistrano
Can you not just look at the distributions of temp and humidity where your response variable = Haze? I'm not sure why you need to build a model for this.Cleland

1 Answers

0
votes

expand.grid()` for this issue. expand.grid creates all possible combinations from sequences 27:29 and 72 to 76.

See this example

expand.grid("Temperature" = 27:29, "Humidity" = 72:76)

This can handed over the function predict like this:

predict(Yourmodel, newdata = expand.grid(Temperature = 27:29, "Humidity" = 72:76))