kopia lustrzana https://github.com/animator/learn-python
Update xgboost.md
rodzic
995c7c6581
commit
bc20d105b7
|
@ -1,8 +1,8 @@
|
|||
# XGBoost
|
||||
XGBoost is an implementation of gradient boosted decision trees designed for speed and performance.
|
||||
|
||||
## Introduction to Gradient Boosting
|
||||
Gradient boosting is a powerful technique for building predictive models that has seen widespread success in various applications.
|
||||
|
||||
- **Boosting Concept**: Boosting originated from the idea of modifying weak learners to improve their predictive capability.
|
||||
- **AdaBoost**: The first successful boosting algorithm was Adaptive Boosting (AdaBoost), which utilizes decision stumps as weak learners.
|
||||
- **Gradient Boosting Machines (GBM)**: AdaBoost and related algorithms were later reformulated as Gradient Boosting Machines, casting boosting as a numerical optimization problem.
|
||||
|
@ -10,11 +10,10 @@ Gradient boosting is a powerful technique for building predictive models that ha
|
|||
- _Loss function_: Determines the objective to minimize (e.g., cross-entropy for classification, mean squared error for regression).
|
||||
- _Weak learner_: Typically, decision trees are used as weak learners.
|
||||
- _Additive model_: New weak learners are added iteratively to minimize the loss function, correcting the errors of previous models.
|
||||
|
||||
## Introduction to XGBoost
|
||||
- eXtreme Gradient Boosting (XBGoost): a more **regularized form** of Gradient Boosting, as it uses **advanced regularization (L1&L2)**, improving the model’s **generalization capabilities.**
|
||||
- It’s suitable when there is **a large number of training samples and a small number of features**; or when there is **a mixture of categorical and numerical features**.
|
||||
|
||||
|
||||
- **Development**: Created by Tianqi Chen, XGBoost is designed for computational speed and model performance.
|
||||
- **Key Features**:
|
||||
- _Speed_: Achieved through careful engineering, including parallelization of tree construction, distributed computing, and cache optimization.
|
||||
|
@ -32,16 +31,15 @@ Gradient boosting is a powerful technique for building predictive models that ha
|
|||
3. Data is split into left and right child nodes after finding the split point.
|
||||
4. Pre-sorting allows for accurate split point determination.
|
||||
- **Limitations**:
|
||||
|
||||
1. Iterative Traversal: Each iteration requires traversing the entire training data multiple times.
|
||||
2. Memory Consumption: Loading the entire training data into memory limits size, while not loading it leads to time-consuming read/write operations.
|
||||
3. Space Consumption: Pre-sorting consumes space, storing feature sorting results and split gain calculations.
|
||||
|
||||
XGBoosting:
|
||||
3. Space Consumption: Pre-sorting consumes space, storing feature sorting results and split gain calculations.
|
||||
XGBoosting:
|
||||

|
||||
|
||||
## Develop Your First XGBoost Model
|
||||
This code uses the XGBoost library to train a model on the Iris dataset, splitting the data, setting hyperparameters, training the model, making predictions, and evaluating accuracy, achieving an accuracy score of X on the testing set.
|
||||
|
||||
|
||||
```python
|
||||
# XGBoost with Iris Dataset
|
||||
# Importing necessary libraries
|
||||
|
@ -88,9 +86,7 @@ print("Accuracy:", accuracy)
|
|||
Accuracy: 1.0
|
||||
|
||||
## **Conclusion**
|
||||
|
||||
XGBoost's focus on speed, performance, and scalability has made it one of the most widely used and powerful predictive modeling algorithms available. Its ability to handle large datasets efficiently, along with its advanced features and optimizations, makes it a valuable tool in machine learning and data science.
|
||||
|
||||
|
||||
## Reference
|
||||
- [Machine Learning Prediction of Turning Precision Using Optimized XGBoost Model](https://www.mdpi.com/2076-3417/12/15/7739)
|
||||
- [Machine Learning Prediction of Turning Precision Using Optimized XGBoost Model](https://www.mdpi.com/2076-3417/12/15/7739)
|
||||
|
|
Ładowanie…
Reference in New Issue