Get startedGet started for free

Making lazy predictions

The model you trained last time was good, but it could be better if you passed through the training data a few more times. Also, it is a shame to see a good model go to waste, so you should use this one to make some predictions on a separate dataset from the one you train on.

An unfitted version of the model you created in the last exercise is available in your environment as dask_model. Dask DataFrames of training data are available as dask_X and dask_y.

This exercise is part of the course

Parallel Programming with Dask in Python

View Course

Exercise instructions

  • Create a for loop and use it to train dask_model on dask_X and dask_y 5 times.
  • Use the fitted model to make predictions for the input variables dask_X.
  • Compute these predictions using the default scheduler.

Hands-on interactive exercise

Have a go at this exercise by completing this sample code.

# Loop over the training data 5 times
____:
	dask_model.____

# Use your model to make predictions
y_pred_delayed = ____

# Compute the predictions
y_pred_computed = ____

print(y_pred_computed)
Edit and Run Code