Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
XGBoost for Regression Predictive Modeling and Time Series Analysis

You're reading from   XGBoost for Regression Predictive Modeling and Time Series Analysis Learn how to build, evaluate, and deploy predictive models with expert guidance

Arrow left icon
Product type Paperback
Published in Dec 2024
Publisher Packt
ISBN-13 9781805123057
Length 308 pages
Edition 1st Edition
Arrow right icon
Authors (2):
Arrow left icon
Joyce Weiner Joyce Weiner
Author Profile Icon Joyce Weiner
Joyce Weiner
Partha Pritam Deka Partha Pritam Deka
Author Profile Icon Partha Pritam Deka
Partha Pritam Deka
Arrow right icon
View More author details
Toc

Table of Contents (19) Chapters Close

Preface 1. Part 1:Introduction to Machine Learning and XGBoost with Case Studies
2. Chapter 1: An Overview of Machine Learning, Classification, and Regression FREE CHAPTER 3. Chapter 2: XGBoost Quick Start Guide with an Iris Data Case Study 4. Chapter 3: Demystifying the XGBoost Paper 5. Chapter 4: Adding on to the Quick Start – Switching out the Dataset with a Housing Data Case Study 6. Part 2: Practical Applications – Data, Features, and Hyperparameters
7. Chapter 5: Classification and Regression Trees, Ensembles, and Deep Learning Models – What’s Best for Your Data? 8. Chapter 6: Data Cleaning, Imbalanced Data, and Other Data Problems 9. Chapter 7: Feature Engineering 10. Chapter 8: Encoding Techniques for Categorical Features 11. Chapter 9: Using XGBoost for Time Series Forecasting 12. Chapter 10: Model Interpretability, Explainability, and Feature Importance with XGBoost 13. Part 3: Model Evaluation Metrics and Putting Your Model into Production
14. Chapter 11: Metrics for Model Evaluations and Comparisons 15. Chapter 12: Managing a Feature Engineering Pipeline in Training and Inference 16. Chapter 13: Deploying Your XGBoost Model 17. Index 18. Other Books You May Enjoy

Using XGBoost to make a prediction

At this point, you have a trained model, ready to be used to classify which type of iris you have based on the measurements of the sepals and petals on a flower. Let’s test out how well it does on your test dataset. To do so, you’ll need to use the predict method and pass it the X_test data:

  1. Make a prediction (classify) based on the test dataset inputs and put the answers into an array called y_score:
    y_score = iris_classifier.predict(X_test)

    That’s it – just one line of code to use the model! You can pass any measurement to the model, so long as you provide values for all columns: sepal length, sepal width, petal length, and petal width. Say, for example, you’ve measured an iris and it has a sepal length of 4.5 cm, a sepal width of 3.0 cm, a petal length of 1.5 cm, and a petal width of 0.25 cm. Which type of iris is it?

  2. Next, make a prediction (classify) based on example measurements.

    To use the model to...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image