QuestionQ76

VerifiedScaling and Tuning

A Data Scientist is developing a set of models to predict small IoT-device sensor failures in a large manufacturing plant. Specifically, the task is to predict whether a sensor will fail within the next 7 days based on its current and recent status. Hundreds of these sensors exist across the plant, with distinct profiles that require a model to be trained for each sensor. Each individual sensor dataset is small, but together they constitute big data. Experiments using individual sensor datasets have shown that a simple linear model has excellent predictive power for this task. The Data Scientist must define an efficient, best-practice approach for training and prediction.

Which approach is suitable for this use case?

Explanation

applyInPandas applies a function independently to each Spark group as a pandas DataFrame, making it suitable for fitting a separate model after grouping the training data by sensor. A pandas UDF efficiently applies vectorized pandas logic to Spark columns, which suits production inference using the fitted linear models. mapInPandas processes arbitrary input batches rather than providing the required per-sensor grouping for model training.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!