This article explains the application of stacking (two layers!) in Kaggle's TItanic entry contest.
The number of rows of data: train.csv has 890 lines, which is 890 people, and test.csv has 418 lines (418 people).
The number of columns in the data depends on how many features you have retained, which varies from person to person. My own train retains 7+1 (1 is the predicted column).
In the few stacking content on the Internet, I believe you have seen this picture early:
This picture, if you can understand it all at once, then OK.
If you don't understand it at once, you will be in trouble. In the next period of time, you will continue to struggle in the trough. . . . . . .
Because this picture is extremely misleading. (Attention! I didn't say that this picture is wrong, even though it is wrong!!! But it is not bad to have a no-code picture on the Internet for a small number of teachings, thanksgiving, my little weak chicken).
I changed the picture a bit:
For each round of 5-fold, Model 1 has to do 5 training sessions and predictions.
TItanic:
Train Data has 890 lines. (Please correspond to the upper part of the figure)
Every 1 fold, it will generate 713 lines of small train, 178 lines of small test. We used Model 1 to train a small train of 713 lines, and then predicted 178 lines of small test. The predicted result is a predicted value of length 178.
This action goes 5 times! The predicted value of length 178 is X 5 = 890 predicted value, which coincides with the length of the Train data. This 890 predictor is generated by Model 1, and we will save it first, because it will make it the source of training for the second layer model.
Key point: The predicted value produced by this step can be converted to 890 X 1 (890 rows, 1 column), denoted as P1 (uppercase P)
Then say Test Data has 418 lines. (Please correspond to the lower part of the figure, the right pair, the green and green ones)
Every 1 fold, 713 lines of small train training Model 1 to predict all of our Test Data (all! Because Test Data does not join 5-fold, so every time is all!). At this time, the predicted result of Model 1 is the predicted value of length 418.
This action goes 5 times! We can get a 5 X 418 predictor matrix. Then we take the average based on the row and finally get an average forecast of 1 X 418.
Key point: The predicted value produced by this step can be converted into 418 X 1 (418 rows, 1 column), denoted as p1 (lowercase p)
Come here, your first level of Model 1 completes its mission.
The first layer will also have other Models, such as Model 2, and the same goes, we can get the predicted values ​​of 890 X 1 (P2) and 418 X 1 (p2) columns.
So, let's say you have 3 models on the first level, so you get:
From the 5-fold predictor matrix 890 X 3, (P1, P2, P3) and from the Test Data predictor matrix 418 X 3, (p1, p2, p3).
To the second floor
From the 5-fold predictor matrix 890 X 3 as your Train Data, train the second layer of the model
From the Test Data predictor matrix 418 X 3 is your Test Data, use the trained model to predict them.
Finally, let's release a Python Code. In the few stacking content on the Internet, you have already seen the code of this line. I have been stuck here before. Now add a little comment, I hope it will be for you. helpful:
Lithium Battery For Electric Transport Trolley
Why do Lithium batteries last longer than Lead-acid?
The nature of Lithium and the integrated Battery Management System (BMS), allow Lithium batteries to last five times longer than Lead-acid.
If you opened the casing (which we definitely don't recommend!), you would see that a Lithium battery consists of a number of individual power cells which are joined together to offer the required capacity (number of holes you can play). The Battery Management system is a really clever piece of kit (think of it as a mini computer), which performs a vital role in keeping the battery components safe, while allowing each power cell to discharge at an even rate. This system spreads the 'load' on the cells and reduces cell damage to maintain capacity for as long as possible.
Can I top-up my battery between rounds?
Another benefit of Lithium batteries is that they can take a 'top-up' charge. What does this mean? In practical terms, it means that it does not need a full charging cycle to 'top-up' the capacity (number of holes you can play). A common scenario would be a golfer who is playing 36 holes in a single day and decides to put their battery on charge between rounds. The capacity will be topped up for as long as the battery is on charge, which might come in VERY handy after a long and tiring day out on the links! This is very different from a traditional Lead-acid battery, which is only worth charging for a full cycle - that's a minimum of eight hours! In addition to this, a Lithium battery takes a speedy 4-5 hours to fully charge from empty - that's got to be good for your electricity bill!
Should I leave my battery on charge all the time?
No is the simple answer, because you really don't need to and it is always safer (plus greener) to leave appliances unplugged if possible!
Don't worry though - your Lithium battery and its dedicated charger are designed to 'switch off' once fully-charged to reduce the risk of continual charging and the potential for overheating. We therefore recommend waiting for the charger light to change from red to green, before switching off at the wall and unplugging the battery from the charger. This doesn't damage the battery and the battery will hold its charge until you next play.
Battery For Electric Transport Trolley,Lithium Battery For Electric Trolley,Electric Golf Trolley Lithium Battery,Go Kart Golf Trolley Lithium Battery
Shenzhen Sunbeam New Energy Co., Ltd , https://www.sunbeambattery.com