LoslegenKostenlos loslegen

Visualizing two numeric explanatory variables

The code for visualizing two numeric explanatory variables is the same as you've seen before: create a layer of the actual data points, and add a layer of the prediction points to see how they match. In the case of two numeric explanatory variables, the prediction point layer will look like a grid.

taiwan_real_estate and prediction_data are available with the square-root transformed variable sqrt_dist_to_mrt_m.

Diese Übung ist Teil des Kurses

Intermediate Regression with statsmodels in Python

Kurs anzeigen

Anleitung zur Übung

  • Using taiwan_real_estate, create a scatter plot of sqrt_dist_to_mrt_m versus n_convenience, colored by price_twd_msq.
  • Create an additional scatter plot of prediction_data, without a legend, and with marker set to "s" (for squares).

Interaktive Übung

Versuche dich an dieser Übung, indem du diesen Beispielcode vervollständigst.

# Create scatter plot of taiwan_real_estate
____

# Create scatter plot of prediction_data without legend
____

# Show the plot
plt.show()
Code bearbeiten und ausführen