Ali game Big Data sesson2_rf& GBRT (UP)

Source: Internet
Author: User

----------A small game experience, for less familiar with Xlab RF and GBRT students are called reference, do not like to spray, great God detour, Mimda.

。。

。 ----------


At the beginning of June LR did not go up after 4.9, watching the hot discussion of RF in the group. Instead of using RF, after tossing and turning. At that time, the results of F1, which were very good for LR, were only about 3.5. Disheartened..

。 Then see hot discussion gbrt, and then turn GBRT, just get started. The effect is almost the same as RF. See other students directly from LR to RF and GBRT are good very much, that nasty ah. And then the exam week. Dragged on until late June, and finally decided to do it again. Because the GBRT training time is longer. and RF and GBRT to the characteristics of the equivalent, RF pre-measurement time is relatively short, and then once again do RF. Slowly has the effect, stopped the F1 finally starts to rise: 4.9->5.16->5.66 ... recently started to add features. I believe there will be ascension, and the following is about our RF and GBRT training and prediction methods (mainly to the main)


1, Xlab GBRT to get started


1.1, Training feature table preparation

The Training feature table gbrt_offline_section_one_24 format is : User_id,brand_id,feature1,feature2 ... Label

See:

watermark/2/text/ahr0cdovl2jsb2cuy3nkbi5uzxqvdtaxmdy5mtg5oa==/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma==/ Dissolve/70/gravity/southeast ">


1.2, the establishment of feature sparse table. Prepare for training.

The feature sparse table can be directly converted from the original feature table in the Xlab, for example the following :


After entering the normal table to sparse matrix interface. Fill in the selection column: user_id the corresponding column number (the table starts from 0 columns by default). BRAND_ID the corresponding column number, as well as the number of features you want to use (do not need to fill in the corresponding column number of the label!!!)

) and then fill in the output table with the converted sparse matrix :gbrt_offline_section_one_24_1; For example with



1.3. GBRT Training

using the characteristic table of training gbrt_offline_section_one_24, conduct GBRT training, for example, so


Enter the configuration interface. Tick the Training tab and the sparse matrix name to enter the sparse matrix gbrt_offline_section_one_24_1 you just turned . Fill out the Model output table name at the Model output table. The parameter configuration is configured according to the effect (it is possible to start by default). For example, as seen in:

watermark/2/text/ahr0cdovl2jsb2cuy3nkbi5uzxqvdtaxmdy5mtg5oa==/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma==/ Dissolve/70/gravity/southeast ">


The configuration is only good to be able to train, waiting for training to wait until the GBRT Prediction model:gbrt_offline_section_one_25;


1.4.GBRT pre-measured feature table preparation

the Training Feature table Gbrt_offline_section_two_11 format is the same as the Training feature Table format: user_id, brand_id, Feature1, feature2 ... Label See:


1.5, establish a pre-measured sparse matrix table

features sparse tables can be directly converted from the original feature table in the Xlab, as in the original method. Directly for example the following :


It is important to note that the selection column must be the same as the training time ...

watermark/2/text/ahr0cdovl2jsb2cuy3nkbi5uzxqvdtaxmdy5mtg5oa==/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma==/ Dissolve/70/gravity/southeast ">

1.6. GBRT pre-measured

Pre-measured using a well-gbrt_offline_section_two_11_1, sparse matrix table , for example, as seen in the


Enter the interface such as the following: Model place to fill out just trained GBRT models table:gbrt_offline_section_one_25; the output table name is filled with the pre-measured results output table Gbrt_offline_section_two_ 13, then pre-test. For example, as seen in:


1.7, GBRT Broken read

After the GBRT has been pre-measured. The result is a single-row value of gbrt_offline_section_two_11 one by one corresponding to the original pre-Test table (Y_var), which does not understand why it is not provided with an RF-like prediction result appended to the user_id,brand_id column, for example:

watermark/2/text/ahr0cdovl2jsb2cuy3nkbi5uzxqvdtaxmdy5mtg5oa==/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma==/ Dissolve/70/gravity/southeast ">

So. Additional ID columns have to be added to merge Zxs_gbrt_offline_section_two_13_1 and zxs_gbrt_offline_section_two_11_1 two tables to get similar user_id, Brand_id,y_val the table, take the threshold value to recommend it. Append the ID column code to the script provided in Xlab.



Also: Attach the script implementation code to facilitate testing:

watermark/2/text/ahr0cdovl2jsb2cuy3nkbi5uzxqvdtaxmdy5mtg5oa==/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma==/ Dissolve/70/gravity/southeast ">


-----------__-----------PS---------__----------

Copyright notice: This article blog original article. Blogs, without consent, may not be reproduced.

Ali game Big Data sesson2_rf& GBRT (UP)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.