From the course: Python for AI Projects: From Data Exploration to Impact

Unlock the full course today

Join today to access over 24,900 courses taught by industry experts.

Training Purchase Prediction Models

Training Purchase Prediction Models

- [Instructor] Next, we'll build two functions for our purchase prediction models, one using logistic regression and another using Optuna-tuned LightGBM as part of our Explore California case study. Unlike our earlier models, we won't need a manual train test split. Our dataset already includes train, validation, and test flags in the period column, which will feed directly into the pipeline. We'll also handle missing values in our pipeline by imputing zeros, which works well for our mix of Booleans and numeric features. This time, we'll use an ROC curve instead of a confusion matrix to visualize performance. The area under the curve, also known as AUC, shows the balance between true positives and false positives, offering a good trade-off between precision and recall. Finally, we'll use our model outputs with SHAP and LIME to explore built-in explainability tools in Python. This field, known as explainable AI, helps…

Contents