आकार और स्थिति से घर की कीमत का अनुमान

Tidyverse में डेटा के साथ Modeling

Albert Y. Kim

Assistant Professor of Statistical and Data Sciences

दोहराएँ: समानांतर ढालें

Tidyverse में डेटा के साथ Modeling

एक प्रेडिक्शन बनाना

Tidyverse में डेटा के साथ Modeling

प्रेडिक्शन का विज़ुअलाइज़ेशन

Tidyverse में डेटा के साथ Modeling

संख्यात्मक प्रेडिक्शन

नीचे दी गई regression तालिका में estimate के मानों का उपयोग करते हुए:

  • पहला घर: $\hat{y} = 2.88 + 0.032 + 0.837 \cdot 2.90 = 5.34$
  • दूसरा घर: $\hat{y} = 2.88 + 0.044 + 0.837 \cdot 3.60 = 5.94$
# Fit regression model and get regression table
model_price_3 <- lm(log10_price ~ log10_size + condition,
                    data = house_prices)
get_regression_table(model_price_3)
# A tibble: 6 x 7
  term       estimate std_error statistic p_value lower_ci...
  <chr>         <dbl>     <dbl>     <dbl>   <dbl>    <dbl>...
1 intercept     2.88      0.036     80.0    0        2.81...
2 log10_size    0.837     0.006    134.     0        0.825...
...
Tidyverse में डेटा के साथ Modeling

"नए" डेटा को परिभाषित करना

# Create data frame of "new" houses
new_houses <- data_frame(
  log10_size = c(2.9, 3.6),
  condition = factor(c(3, 4))
)
new_houses
# A tibble: 2 x 2
  log10_size condition
       <dbl> <fct>    
1        2.9 3        
2        3.6 4
Tidyverse में डेटा के साथ Modeling

नए डेटा से प्रेडिक्शन बनाना

# Make predictions on new data
get_regression_points(model_price_3,
                      newdata = new_houses)
# A tibble: 2 x 4
     ID log10_size condition log10_price_hat
  <int>      <dbl> <fct>               <dbl>
1     1        2.9 3                    5.34
2     2        3.6 4                    5.94
Tidyverse में डेटा के साथ Modeling

नए डेटा से प्रेडिक्शन बनाना

# Make predictions in original units by undoing log10()
get_regression_points(model_price_3,
                      newdata = new_houses) %>% 
  mutate(price_hat = 10^log10_price_hat)
# A tibble: 2 x 5
     ID log10_size condition log10_price_hat price_hat
  <int>      <dbl> <fct>               <dbl>     <dbl>
1     1        2.9 3                    5.34   219786.
2     2        3.6 4                    5.94   870964.
Tidyverse में डेटा के साथ Modeling

अभ्यास करते हैं!

Tidyverse में डेटा के साथ Modeling

Preparing Video For Download...