TW201928709A - Method and apparatus for merging model prediction values, and device - Google Patents

Method and apparatus for merging model prediction values, and device Download PDF

Info

Publication number
TW201928709A
TW201928709A TW107135970A TW107135970A TW201928709A TW 201928709 A TW201928709 A TW 201928709A TW 107135970 A TW107135970 A TW 107135970A TW 107135970 A TW107135970 A TW 107135970A TW 201928709 A TW201928709 A TW 201928709A
Authority
TW
Taiwan
Prior art keywords
prediction
model
prediction value
interval
value
Prior art date
Application number
TW107135970A
Other languages
Chinese (zh)
Other versions
TWI718422B (en
Inventor
方文靜
周俊
Original Assignee
香港商阿里巴巴集團服務有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 香港商阿里巴巴集團服務有限公司 filed Critical 香港商阿里巴巴集團服務有限公司
Publication of TW201928709A publication Critical patent/TW201928709A/en
Application granted granted Critical
Publication of TWI718422B publication Critical patent/TWI718422B/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/214Generating training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/25Fusion techniques
    • G06F18/251Fusion techniques of input or preprocessed data

Abstract

Disclosed are a method and apparatus for merging model prediction values, and a device. The method for merging model prediction values comprises: on the basis of a given number of samples, binning a prediction value of an online prediction model and a prediction value of an offline prediction model separately according to a set binning method; according to the binning result, converting the first prediction value of each sample into a first interval feature corresponding to the interval in which the first prediction value is located, and converting the second prediction value of each sample into a second interval feature corresponding to the interval in which the second prediction value is located; and using the first interval feature and the second interval feature corresponding to each sample, and a sample tag to form sample data after the conversion, and using said sample data to train a model, the trained model being used for merging the prediction value of the online prediction model and the prediction value of the offline prediction model to obtain a final prediction value.

Description

對模型預測值進行融合的方法、裝置和設備Method, device and equipment for fusing model prediction values

本說明書涉及機器學習技術領域,尤其涉及一種對模型預測值進行融合的方法、裝置和設備。This specification relates to the field of machine learning technology, and in particular, to a method, a device, and a device for fusing model prediction values.

機器學習演算法是一類能從資料中自動分析獲得規律,並利用規律對未知資料進行預測的演算法,被廣泛應用於諸多領域中。   在實際應用中,包括線上預測模型和離線預測模型,其中,離線預測模型通常以定時任務來實現,其優勢是可以納入維度較高的特徵、並使用較為複雜的演算法,從而達到較為精準的預測效果;然而,由於特徵較多且演算法複雜,預測過程通常較為耗時。相比於離線預測模型,線上預測模型可以使用維度較低的特徵以及較為簡單的演算法來達到更高效的預測,其缺點便是特徵不夠豐富,準確度不高。可見,線上預測模型和離線預測模型各具優勢,如何將兩者進行合理的融合是目前業內極待解決的問題。Machine learning algorithms are a type of algorithms that can automatically analyze patterns from data and use the patterns to predict unknown data. They are widely used in many fields. In practical applications, it includes online prediction models and offline prediction models. Among them, offline prediction models are usually implemented by timing tasks. Its advantages are that it can incorporate higher-dimensional features and use more complex algorithms to achieve more accurate. Prediction effect; however, the prediction process is usually time consuming due to its many features and complex algorithms. Compared with offline prediction models, online prediction models can use lower-dimensional features and simpler algorithms to achieve more efficient predictions. The disadvantages are insufficient features and low accuracy. It can be seen that the online prediction model and the offline prediction model each have their own advantages. How to reasonably integrate the two is an issue to be solved in the industry.

針對上述技術問題,本說明書實施例提供一種對模型預測值進行融合的方法、裝置和設備,技術方案如下:   在一個方面,提出的一種對模型預測值進行融合的方法,包括:   基於給定的若干樣本,按照設定分箱法來分別對線上預測模型的預測值和離線預測模型的預測值進行分箱,其中,所述若干樣本中的每一樣本包括:第一預測值、第二預測值以及樣本的標籤,所述第一預測值由線上預測模型預測得到,第二預測值由離線預測模型預測得到;   根據分箱的結果,將各樣本的第一預測值轉化為與該第一預測值所處的區間對應的第一區間特徵,將各樣本的第二預測值轉化為與該第二預測值所處的區間對應的第二區間特徵;   以每一樣本對應的所述第一區間特徵、所述第二區間特徵以及樣本的標籤構成轉化後的樣本資料,並利用轉化後的樣本資料來訓練模型,該訓練完成的模型用於對線上預測模型的預測值和離線預測模型的預測值進行融合得到最終的預測值。   在一個方面,提出的一種對模型預測值進行融合的方法,包括:   獲取目標使用者在第一時間段內產生的業務資料,根據所述業務資料確定輸入特徵並輸入到線上預測模型,輸出第一預測值;   獲取利用離線預測模型得到的與所述目標使用者對應的第二預測值,其中,所述離線預測模型的輸入特徵是根據所述目標使用者在第二時間段內產生的業務特徵來確定的;   獲取對線上預測模型的第一預測值和離線預測模型的第二預測值進行分箱的結果,分別確定所述第一預測值所處的第一區間和所述第二預測值所處的第二區間;   根據所述第一區間和所述第二區間,利用預先訓練得到的模型來對所述第一預測值和所述第二預測值進行融合,得到最終的融合預測值,所述融合預測值用來確定所述目標使用者的標籤。   在一個方面,提出的一種對模型預測值進行融合的裝置,包括:   分箱單元,基於給定的若干樣本,按照設定分箱法來分別對線上預測模型的預測值和離線預測模型的預測值進行分箱,其中,所述若干樣本中的每一樣本包括:第一預測值、第二預測值以及樣本的標籤,所述第一預測值由線上預測模型預測得到,第二預測值由離線預測模型預測得到;   特徵轉換單元,根據分箱的結果,將各樣本的第一預測值轉化為與該第一預測值所處的區間對應的第一區間特徵,將各樣本的第二預測值轉化為與該第二預測值所處的區間對應的第二區間特徵;   訓練單元,以每一樣本對應的所述第一區間特徵、所述第二區間特徵以及樣本的標籤構成轉化後的樣本資料,並利用轉化後的樣本資料來訓練模型,該訓練完成的模型用於對線上預測模型的預測值和離線預測模型的預測值進行融合得到最終的預測值。   在一個方面,提出的一種對模型預測值進行融合的裝置,包括:   線上分值預測單元,獲取目標使用者在觸發時刻前的第一時間段內產生的業務資料,根據所述業務資料確定輸入特徵並輸入到線上預測模型,輸出第一預測值,所述線上預測模型用於預測使用者的標籤;   離線分值獲得單元,獲取利用離線預測模型得到的與所述目標使用者對應的第二預測值,其中,所述離線預測模型的輸入特徵是根據所述目標使用者在過去的第二時間段內產生的業務特徵來確定的,所述離線預測模型用於預測使用者的標籤;   區間確定單元,根據預先對線上預測模型的預測值和離線預測模型的預測值進行分箱的結果,分別確定所述第一預測值所處的第一區間和所述第二預測值所處的第二區間;   分值融合單元,根據所述第一區間和所述第二區間,利用預先訓練得到的模型來對所述第一預測值和所述第二預測值進行融合,得到最終的融合預測值,所述融合預測值用來確定所述目標使用者的標籤。   在一個方面,提出的一種電腦設備,包括:   處理器;   用於儲存處理器可執行指令的記憶體;   所述處理器被配置為:   基於給定的若干樣本,按照設定分箱法來分別對線上預測模型的預測值和離線預測模型的預測值進行分箱,其中,所述若干樣本中的每一樣本包括:第一預測值、第二預測值以及樣本的標籤,所述第一預測值由線上預測模型預測得到,第二預測值由離線預測模型預測得到;   根據分箱的結果,將各樣本的第一預測值轉化為與該第一預測值所處的區間對應的第一區間特徵,將各樣本的第二預測值轉化為與該第二預測值所處的區間對應的第二區間特徵;   以每一樣本對應的所述第一區間特徵、所述第二區間特徵以及樣本的標籤構成轉化後的樣本資料,並利用轉化後的樣本資料來訓練模型,該訓練完成的模型用於對線上預測模型的預測值和離線預測模型的預測值進行融合得到最終的預測值。   在一個方面,提出的一種電腦設備,包括:   處理器;   用於儲存處理器可執行指令的記憶體;   所述處理器被配置為:   線上分值預測單元,獲取目標使用者在觸發時刻前的第一時間段內產生的業務資料,根據所述業務資料確定輸入特徵並輸入到線上預測模型,輸出第一預測值,所述線上預測模型用於預測使用者的標籤;   離線分值獲得單元,獲取利用離線預測模型得到的與所述目標使用者對應的第二預測值,其中,所述離線預測模型的輸入特徵是根據所述目標使用者在過去的第二時間段內產生的業務特徵來確定的,所述離線預測模型用於預測使用者的標籤;   區間確定單元,根據預先對線上預測模型的預測值和離線預測模型的預測值進行分箱的結果,分別確定所述第一預測值所處的第一區間和所述第二預測值所處的第二區間;   分值融合單元,根據所述第一區間和所述第二區間,利用預先訓練得到的模型來對所述第一預測值和所述第二預測值進行融合,得到最終的融合預測值,所述融合預測值用來確定所述目標使用者的標籤。   本說明書實施例所提供的技術方案所產生的效果包括:   通過機器學習得到的模型來對所述線預測模型的預測值和所述離線預測模型的預測值進行融合,最終利用融合得到的分值來對使用者的標籤進行預測,從而在提高了對使用者的標籤進行預測的準確性的同時,還滿足了業務對低時延的要求。   應當理解的是,以上的一般描述和後文的細節描述僅是示例性和解釋性的,並不能限制本說明書實施例。   此外,本說明書實施例中的任一實施例並不需要達到上述的全部效果。In view of the above technical problems, the embodiments of the present specification provide a method, an apparatus, and a device for fusing model predictions. The technical solution is as follows: In one aspect, a method for fusing model predictions is provided, including: Based on a given For several samples, the predicted values of the online prediction model and the predicted values of the offline prediction model are binned respectively according to a set binning method, wherein each of the plurality of samples includes a first predicted value and a second predicted value. And the label of the sample, the first predicted value is predicted by the online prediction model, and the second predicted value is predicted by the offline prediction model; According to the results of the binning, the first predicted value of each sample is converted to the first prediction. A first interval feature corresponding to the interval in which the value is located, converting the second prediction value of each sample into a second interval feature corresponding to the interval in which the second prediction value is located; the first interval corresponding to each sample Feature, the second interval feature, and the label of the sample constitute the transformed sample data, and The trained sample data is used to train the model. The trained model is used to fuse the prediction value of the online prediction model and the prediction value of the offline prediction model to obtain the final prediction value. In one aspect, a method for fusing model predictions is provided, including: Obtaining business data generated by a target user within a first period of time, determining input features based on the business data and inputting to an online prediction model, and outputting the first A prediction value; obtaining a second prediction value corresponding to the target user obtained by using an offline prediction model, wherein the input characteristics of the offline prediction model are based on the business generated by the target user in the second time period; Determined by characteristics; obtaining a binning result of the first prediction value of the online prediction model and the second prediction value of the offline prediction model, and determining the first interval and the second prediction respectively where the first prediction value is located; The second interval in which the value is located; according to the first interval and the second interval, using a model trained in advance to fuse the first prediction value and the second prediction value to obtain a final fusion prediction Value, the fusion prediction value is used to determine a label of the target user. In one aspect, a device for fusing model predictions is provided, including: a binning unit, based on a given number of samples, according to a set binning method to separately predict the predictions of an online prediction model and the predictions of an offline prediction model Binning is performed, wherein each of the plurality of samples includes: a first prediction value, a second prediction value, and a label of the sample, the first prediction value is predicted by an online prediction model, and the second prediction value is obtained by offline The prediction model is predicted; the feature conversion unit converts the first prediction value of each sample into a first interval feature corresponding to the interval where the first prediction value is located according to the binning result, and converts the second prediction value of each sample Transformed into a second interval feature corresponding to the interval in which the second predicted value is located; a training unit, forming the transformed sample with the first interval feature, the second interval feature, and a label of the sample corresponding to each sample Data, and use the transformed sample data to train the model. The trained model is used for the online prediction model. The predicted value and the measured value of the offline prediction models obtained are fused final prediction value. In one aspect, a device for fusing model predictions is provided, including: Online score prediction unit, which acquires business data generated by a target user within a first time period before a trigger time, and determines an input based on the business data The features are input to an online prediction model, and a first prediction value is output, the online prediction model is used to predict a user's label; an offline score obtaining unit, which obtains a second corresponding to the target user obtained by using the offline prediction model; Prediction value, wherein the input characteristics of the offline prediction model are determined according to the business characteristics of the target user in the past second time period, and the offline prediction model is used to predict the label of the user; The determining unit determines the first interval in which the first prediction value is located and the third position in which the second prediction value is located according to a result of binning the prediction value of the online prediction model and the prediction value of the offline prediction model in advance. Two intervals; score fusion unit, according to the first interval and the second interval Interval, using a model trained in advance to fuse the first prediction value and the second prediction value to obtain a final fusion prediction value, where the fusion prediction value is used to determine a label of the target user. In one aspect, a proposed computer device includes: (i) a processor; (ii) a memory for storing processor-executable instructions; (ii) the processor is configured to: (ii) based on a given number of samples, respectively, according to a set binning method; The prediction value of the online prediction model and the prediction value of the offline prediction model are binned, wherein each of the samples includes: a first prediction value, a second prediction value, and a label of the sample, and the first prediction value Obtained from the online prediction model and the second predicted value from the offline prediction model; According to the results of the binning, convert the first prediction value of each sample into the first interval feature corresponding to the interval where the first prediction value is located. , Converting the second prediction value of each sample into a second interval feature corresponding to the interval in which the second prediction value is located; using the first interval feature, the second interval feature, and the sample's The labels constitute the transformed sample data and the transformed sample data is used to train the model. The training As a model for a prediction value predicted values and off-line prediction model predictive models are fused to give a final prediction value. In one aspect, a proposed computer device includes: a processor; a memory for storing processor-executable instructions; a processor configured to: an online score prediction unit that obtains a target user's Business data generated in the first time period, determining input characteristics according to the business data and inputting it to an online prediction model, and outputting a first prediction value, the online prediction model is used to predict a user's label; an offline score obtaining unit, A second prediction value corresponding to the target user obtained by using an offline prediction model is obtained, wherein the input characteristics of the offline prediction model are based on business characteristics generated by the target user in the past second time period. It is determined that the offline prediction model is used to predict a user's tag; an interval determination unit determines the first prediction value according to a result of binning the prediction value of the online prediction model and the prediction value of the offline prediction model in advance; The first interval and the second prediction A second interval in which it is located; a score fusion unit, based on the first interval and the second interval, using a model trained in advance to fuse the first prediction value and the second prediction value to obtain The final fusion prediction value is used to determine a label of the target user. The effects produced by the technical solutions provided in the embodiments of the present specification include: 融合 Fusion of the prediction value of the line prediction model and the prediction value of the offline prediction model through a model obtained by machine learning, and finally using the fused score To predict the tags of users, while improving the accuracy of predicting the tags of users, it also meets the requirements of the service for low latency. It should be understood that the above general description and the following detailed description are merely exemplary and explanatory, and should not limit the embodiments of the present specification. In addition, any one of the embodiments in this specification does not need to achieve all the effects described above.

為了使本領域技術人員更好地理解本說明書實施例中的技術方案,下面將結合本說明書實施例中的附圖,對本說明書實施例中的技術方案進行詳細地描述,顯然,所描述的實施例僅僅是本說明書的一部分實施例,而不是全部的實施例。基於本說明書中的實施例,本領域中具有通常知識者所獲得的所有其他實施例,都應當屬於保護的範圍。   參見圖1所示,在本說明書一實施例中,一種對模型預測值進行融合的方法,其用來對線上預測模型所得到的分值和離線預測模型所得到的分值進行融合,該方法可以包括下述步驟101~104,其中:   步驟101:獲取目標使用者在第一時間段內產生的業務資料,根據所述業務資料確定輸入特徵並輸入到線上預測模型,輸出第一預測值。   步驟102:獲取利用離線預測模型得到的與所述目標使用者對應的第二預測值,其中,所述離線預測模型的輸入特徵是根據所述目標使用者在第二時間段內產生的業務特徵來確定的。   本文中,所述線上預測模型和所述離線預測模型均為利用機器學習演算法構建的用來對使用者的標籤進行預測的模型。這兩個模型所需預測的使用者標籤可以是與具體業務相關的,比如:對於一種網路支付業務,所需預測的使用者標籤可以分為:“高風險使用者”、“中風險使用者”、“低風險使用者”,等等。對於一種資訊推薦業務,所需預測的使用者標籤可以分為:“體育類”、“教育類”、“財經類”,等等。線上預測模型和離線預測模型都是採用一定數量的訓練樣本來訓練的,這些訓練樣本中的每一樣本可以包括:樣本使用者在參與特定業務(如網路支付業務)的過程中所產生的一種或多種行為資料,以及樣本使用者被確定的標籤。其中,可以採用同一批樣本來對上述線上預測模型和離線預測模型進行訓練,也可以採用兩批不同的樣本來對線上預測模型和離線預測模型進行訓練,本文不作限制。   在本說明書實施例中,離線預測模型可以是通過定時任務來實現的,如:每天在指定時刻或指定時間段執行一次離線的分值預測,該預測過程可以是針對全量使用者的;而線上預測模型可以由特定使用者的操作來觸發,如:使用者點擊某個網頁的行為便可以觸發一次線上預測模型的分值計算過程。   因為離線預測模型相較於線上預測模型,通常採用更高維度的特徵資料,特徵資料的時間幅度也可以更長,且可以採用更加複雜的演算法。如圖1所示,以特定例子來說,在T日,離線預測模型可以獲取每一使用者在T-1日在參與特定業務的過程中所產生的業務資料(特徵A),根據獲得的業務資料(特徵A)進行相應的處理,可以得到輸入特徵並輸入到離線預測模型中,得到各使用者的離線預測分值(即文中的第二預測值)並寫入到資料庫X中。而對於線上預測模型,可以不斷採集使用者的線上特徵資料(特徵B)並寫入到資料庫Y中,其中,所述線上特徵資料可以是使用者在參與特定業務的過程中所產生的準即時的業務資料,例如:線上預測的觸發時刻為t1,則線上特徵資料可以是t0~t1(如3分鐘)這段時間段內所產生的業務資料。可見,在用來發起預測流程的使用者請求到來後,排程器需要做兩個任務,其一是從資料庫X中讀取最近一次由離線預測模型計算獲得的與目標使用者對應的第二預測值;其二是從資料庫Y中讀取該目標使用者的線上特徵資料來進行接下來的線上預測模型的分值預測過程。   至此,對於任何一個目標使用者,都可以通過線上預測模型獲得一個預測分值,和通過離線預測模型獲得一個預測分值。   步驟103:根據預先對線上預測模型的預測值和離線預測模型的預測值進行分箱的結果,分別確定所述第一預測值所處的第一區間和所述第二預測值所處的第二區間。   步驟104:根據所述第一區間和所述第二區間,利用預先訓練得到的模型來對所述第一預測值和所述第二預測值進行融合,得到最終的融合預測值,其中,所述融合預測值用來確定所述目標使用者的標籤。   在一可選的實施例中,步驟104可以具體包括:   步驟1041:基於預先確定的與分箱得到的各區間對應的權重,獲得與所述第一區間對應的第一權重及與所述第二區間對應的第二權重。其中,所述模型的待訓練參數包括與分箱得到的各區間對應的權重。   步驟1042:利用所述第一權重和所述第二權重來確定融合預測值,所述融合預測值用來確定所述目標使用者的標籤。   由於上述步驟103~步驟104需要基於分箱結果和與分箱得到的各區間對應的權重來實現,故,在詳細介紹步驟103~步驟104之前,需要介紹一種確定融合權重的方法。如圖2所示,在一實施例中,該方法包括步驟201~步驟203,其中:   步驟201:基於給定的若干樣本,按照設定分箱法來分別對線上預測模型的預測值和離線預測模型的預測值進行分箱,其中,所述若干樣本中的每一樣本包括:第一預測值、第二預測值以及樣本的標籤,所述第一預測值由線上預測模型預測得到,第二預測值由離線預測模型預測得到。   該步驟201中提及的樣本可以與用來訓練上述離線預測模型及/或線上預測模型的樣本相同,當然,也可以是不同的樣本,對此不作限制。   在一實施例中,所述設定分箱法可以為基於熵的分箱法。基於熵的分箱法是在分箱時考慮因變量的取值,使得分箱後達到最小熵(minimumentropy)。基於熵的分箱法的好處是能夠在高分值區域展示較好的區分性。當然,所述設定分箱法還可以是基於基尼的分箱法、或等頻分箱法等。   步驟202:根據分箱的結果,將各樣本的第一預測值轉化為與該第一預測值所處的區間對應的第一區間特徵,將各樣本的第二預測值轉化為與該第二預測值所處的區間對應的第二區間特徵。   在一個例子中,假設第一預測值和第二預測值都是介於0~1之間,則對線上預測模型的預測值進行分箱後,所得到的分割點包括:0、0.1、0.13、0.15、0.2、0.3、0.5、1;對離線預測模型的預測值進行分箱後,所得到的分割點包括:0、0.03、0.05、0.08、0.09、0.11、0.13、1;也就是說,線上預測模型和離線預測模型的輸出值在分箱後分別得到7個區間。   在一實施例中,可以採用one-hot規則來實現步驟202的特徵轉化。假設一個樣本的第一預測值為0.17,第二預測值為0.12,則由於0.17處於第4個區間(0.15,0.2)內,0.12處於第6個區間(0.11,0.13)內,採用one-hot規則可以將第一預測值:0.17轉換為第一區間特徵:on-bin-0001000(“on-bin”為線上預測模型的標識),將第二預測值:0.12轉換為第二區間特徵:off-bin-0000010(“off-bin”為離線預測模型的標識)。按照同樣的方法,可以逐一對其他樣本中的第一預測值和第二預測值進行特徵轉化。   步驟203:以每一樣本對應的所述第一區間特徵、所述第二區間特徵以及樣本的標籤構成轉化後的樣本資料,並利用轉化後的樣本資料來訓練模型,該訓練完成的模型用於對線上預測模型的預測值和離線預測模型的預測值進行融合得到最終的預測值。   其中,所述轉化後的樣本資料除了所述第一區間特徵、所述第二區間特徵以及樣本的標籤之外,還可以包括其他資料。即,所述“構成”並不是封閉的。   在以上例子中,在特徵轉化前,某條樣本資料例如為:   {0.17,0.12,“中風險使用者”};   在特徵轉化後,得到的新的一條樣本資料例如為:   {0001000,0000010,“中風險使用者”}   本文待訓練的模型可以為線性模型或非線性模型,在採用線性模型的一種實施例中,所述模型的待訓練參數可以包括與分箱得到的各區間對應的權重,所述權重可以用於對線預測模型的預測值和離線預測模型的預測值進行融合得到最終的預測值。待訓練的模型可以是邏輯回歸(Logistic Regression,LR)模型,其中,可以為分箱得到的各區間分別分配一個權重,並將該權重作為LR模型的參數進行訓練,最終可以求解出各個權重值。上述權重可以為相應區間的一個評分,該評分不僅是在不同模型特徵間(線上、離線模型),也是在各個分數區間之間做了一個全域的重要性權衡和學習。   沿用上文提到的例子,最終可以得到以下權重:   區間(0,0.1)的權重on-bin-1=1.054,   ……   區間(0.5,1)的權重on-bin-7=4.439;   區間(0,0.03)的權重off-bin-1=0.604,   ……   區間(0.13,1)的權重off-bin-7=3.237。   接下來,繼續結合以上具體例子來對上述步驟103至步驟104進行說明。假設對於某個目標使用者,通過線上預測模型獲得的第一預測值為0.66,通過離線預測模型獲得的第二預測值為0.25,則結合上述例子,首先在步驟103中,確定所述第一預測值0.4所處的第一區間為:(0.5,1),所述第二預測值0.25所處的第二區間為:(0.13,1)。隨後在步驟1041中,基於預先確定的與分箱得到的各區間對應的權重,可以獲得與所述第一區間:(0.5,1)對應的第一權重是:4.439,與所述第二區間:(0.13,1)對應的第二權重是:3.237。   最終,在步驟1042中,可以根據上述第一權重和第二權重來確定最終的融合預測值,在可選的實施例中,可以將所述第一權重和所述第二權重進行求和,並將求和結果作為融合預測值,即融合預測值=4.439+3.237=7.676。當然,融合的具體方式並不限於求和,如:求平均等。最終,可以根據具體業務來決定如何運用所述融合預測值。   本說明書實施例所提供的技術方案所產生的效果包括:   通過機器學習得到的權重來對所述線預測模型的預測值和所述離線預測模型的預測值進行融合,最終利用融合得到的分值來對使用者的標籤進行預測,從而在提高了對使用者的標籤進行預測的準確性的同時,還滿足了業務對低時延的要求。此外,利用基於熵的分箱和邏輯回歸模型,將線上模型分值和離線模型分值進行有效整合,使得線上離線分值之間的可比性在機器學習過程中得到自適應調整。   相應於上述方法實施例,本說明書實施例還提供一種對模型預測值進行融合的裝置。   參見圖3所示,在一實施例中,在融合權重的訓練階段,一種確定融合權重的裝置300可以包括:   分箱單元301,被配置為:基於給定的若干樣本,按照設定分箱法來分別對線上預測模型的預測值和離線預測模型的預測值進行分箱,其中,所述若干樣本中的每一樣本包括:第一預測值、第二預測值以及樣本的標籤,所述第一預測值由線上預測模型預測得到,第二預測值由離線預測模型預測得到;   特徵轉換單元302,被配置為:根據分箱的結果,將各樣本的第一預測值轉化為與該第一預測值所處的區間對應的第一區間特徵,將各樣本的第二預測值轉化為與該第二預測值所處的區間對應的第二區間特徵;   訓練單元303,被配置為:以每一樣本對應的所述第一區間特徵、所述第二區間特徵以及樣本的標籤構成轉化後的樣本資料,並利用轉化後的樣本資料來訓練模型,該訓練完成的模型用於對線上預測模型的預測值和離線預測模型的預測值進行融合得到最終的預測值。   參見圖4所示,在一實施例中,在分值融合階段,一種對模型預測值進行融合的裝置400可以包括:   線上分值預測單元401,被配置為:獲取目標使用者在觸發時刻前的第一時間段內產生的業務資料,根據所述業務資料確定輸入特徵並輸入到線上預測模型,輸出第一預測值,所述線上預測模型用於預測使用者的標籤;   離線分值獲得單元402,被配置為:獲取利用離線預測模型得到的與所述目標使用者對應的第二預測值,其中,所述離線預測模型的輸入特徵是根據所述目標使用者在過去的第二時間段內產生的業務特徵來確定的,所述離線預測模型用於預測使用者的標籤;   區間確定單元403,被配置為:根據預先對線上預測模型的預測值和離線預測模型的預測值進行分箱的結果,分別確定所述第一預測值所處的第一區間和所述第二預測值所處的第二區間;   權重確定單元404,被配置為:根據所述第一區間和所述第二區間,利用預先訓練得到的模型來對所述第一預測值和所述第二預測值進行融合,得到最終的融合預測值,所述融合預測值用來確定所述目標使用者的標籤。   在一可選實施例中,所述分值融合單元404可包括:   權重確定子單元,基於預先確定的與分箱得到的各區間對應的權重,獲得與所述第一區間對應的第一權重及與所述第二區間對應的第二權重;   融合子單元,利用所述第一權重和所述第二權重來確定融合預測值,所述融合預測值用來確定所述目標使用者的標籤。   在一實施例中,所述融合子單元可以被配置為:   將所述第一權重和所述第二權重進行求和,並將求和結果作為融合預測值。   上述裝置中各個模組的功能和作用的實現過程具體詳見上述方法中對應步驟的實現過程,在此不再贅述。   本說明書實施例還提供一種電腦設備(如伺服器),其至少包括記憶體、處理器及儲存在記憶體上並可在處理器上執行的電腦程式,其中,處理器執行所述程式時實現前述方法。   圖5示出了本說明書實施例所提供的一種更為具體的計算設備硬體結構示意圖,該設備可以包括:處理器1010、記憶體1020、輸入/輸出介面1030、通信介面1040和匯流排1050。其中處理器1010、記憶體1020、輸入/輸出介面1030和通信介面1040通過匯流排1050實現彼此之間在設備內部的通信連接。   處理器1010可以採用通用的CPU(Central Processing Unit,中央處理器)、微處理器、特殊應用積體電路(Application Specific Integrated Circuit,ASIC)、或者一個或多個積體電路等方式實現,用於執行相關程式,以實現本說明書實施例所提供的技術方案。   記憶體1020可以採用ROM(Read Only Memory,唯讀記憶體)、RAM(Random Access Memory,隨機存取記憶體)、靜態儲存設備,動態儲存設備等形式實現。記憶體1020可以儲存作業系統和其他應用程式,在通過軟體或者韌體來實現本說明書實施例所提供的技術方案時,相關的程式碼保存在記憶體1020中,並由處理器1010來調用執行。   輸入/輸出介面1030用於連接輸入/輸出模組,以實現資訊輸入及輸出。輸入輸出/模組可以作為組件配置在設備中(圖中未示出),也可以外接於設備以提供相應功能。其中輸入設備可以包括鍵盤、滑鼠、觸控螢幕、麥克風、各類感測器等,輸出設備可以包括顯示器、喇叭、振動器、指示燈等。   通信介面1040用於連接通信模組(圖中未示出),以實現本設備與其他設備的通信互動。其中通信模組可以通過有線方式(例如USB、網線等)實現通信,也可以通過無線方式(例如行動網路、WIFI、藍牙等)實現通信。   匯流排1050包括一通路,在設備的各個組件(例如處理器1010、記憶體1020、輸入/輸出介面1030和通信介面1040)之間傳輸資訊。   需要說明的是,儘管上述設備僅示出了處理器1010、記憶體1020、輸入/輸出介面1030、通信介面1040以及匯流排1050,但是在具體實施過程中,該設備還可以包括實現正常執行所必需的其他組件。此外,本領域中具有通常知識者可以理解的是,上述設備中也可以僅包含實現本說明書實施例方案所必需的組件,而不必包含圖中所示的全部組件。   通過以上的實施方式的描述可知,本領域中具有通常知識者可以清楚地瞭解到本說明書實施例可借助軟體加必需的通用硬體平臺的方式來實現。基於這樣的理解,本說明書實施例的技術方案本質上或者說對現有技術做出貢獻的部分可以以軟體產品的形式反應出來,該電腦軟體產品可以儲存在儲存媒體中,如ROM/RAM、磁碟、光碟等,包括若干指令用以使得一台電腦設備(可以是個人電腦,伺服器,或者網路設備等)執行本說明書實施例各個實施例或者實施例的某些部分所述的方法。   上述實施例闡明的系統、裝置、模組或單元,具體可以由電腦晶片或實體實現,或者由具有某種功能的產品來實現。一種典型的實現設備為電腦,電腦的具體形式可以是個人電腦、筆記型電腦、行動電話、相機電話、智慧型手機、個人數位助理、媒體播放器、導航設備、電子郵件收發設備、遊戲控制台、平板電腦、可穿戴設備或者這些設備中的任意幾種設備的組合。   本說明書中的各個實施例均採用漸進的方式描述,各個實施例之間相同相似的部分互相參見即可,每個實施例重點說明的都是與其他實施例的不同之處。尤其,對於裝置實施例而言,由於其基本相似於方法實施例,所以描述得比較簡單,相關之處參見方法實施例的部分說明即可。以上所描述的裝置實施例僅僅是示意性的,其中所述作為分離部件說明的模組可以是或者也可以不是物理上分開的,在實施本說明書實施例方案時可以把各模組的功能在同一個或多個軟體及/或硬體中實現。也可以根據實際的需要選擇其中的部分或者全部模組來實現本實施例方案的目的。本領域中具有通常知識者在不付出進步性勞動的情況下,即可以理解並實施。   以上所述僅是本說明書實施例的具體實施方式,應當指出,對於本領域中具有通常知識者來說,在不脫離本說明書實施例原理的前提下,還可以做出若干改進和潤飾,這些改進和潤飾也應視為本說明書實施例的保護範圍。In order to enable those skilled in the art to better understand the technical solutions in the embodiments of the present specification, the technical solutions in the embodiments of the present specification will be described in detail below with reference to the drawings in the embodiments of the present specification. Obviously, the described implementations The examples are only a part of the embodiments of this specification, but not all the examples. Based on the embodiments in this specification, all other embodiments obtained by those with ordinary knowledge in the art should fall within the scope of protection. Referring to FIG. 1, in an embodiment of the present specification, a method for fusing model predictions is used to fuse scores obtained from online prediction models and scores obtained from offline prediction models. The method It may include the following steps 101 to 104, where: Step 101: Obtain business data generated by a target user within a first period of time, determine input characteristics according to the business data and input them to an online prediction model, and output a first prediction value. Step 102: Obtain a second prediction value corresponding to the target user obtained by using an offline prediction model, wherein the input characteristics of the offline prediction model are based on business characteristics generated by the target user within a second time period. To determine. In this paper, both the online prediction model and the offline prediction model are models constructed by using machine learning algorithms to predict user labels. The user tags predicted by these two models can be related to specific services. For example, for an online payment service, the user tags predicted need to be divided into: "high-risk users", "medium-risk use" "," Low-risk users ", and so on. For an information recommendation business, the user labels that need to be predicted can be divided into: "sports", "educational", "financial", and so on. Both the online prediction model and the offline prediction model are trained using a certain number of training samples. Each of these training samples may include: sample users generated in the process of participating in a specific business (such as online payment business) One or more behavioral data, and tags identified by sample users. Among them, the same batch of samples can be used to train the above online prediction model and offline prediction model, or two different batches of samples can be used to train the online prediction model and offline prediction model, which is not limited in this article. In the embodiment of the present specification, the offline prediction model may be implemented by a timing task, such as: performing offline score prediction once a day at a specified time or a specified time period, and the prediction process may be directed to all users; while online The prediction model can be triggered by the operation of a specific user. For example, the behavior of a user clicking a webpage can trigger the score calculation process of the online prediction model. Because offline prediction models generally use higher-dimensional feature data than online prediction models, the time range of feature data can also be longer, and more sophisticated algorithms can be used. As shown in Figure 1, for a specific example, on day T, the offline prediction model can obtain business data (characteristic A) generated by each user during the process of participating in a specific business on day T-1. According to the obtained The business data (feature A) is processed accordingly, and the input features can be obtained and input into the offline prediction model, and the offline prediction scores (that is, the second prediction values in the text) of each user are obtained and written into the database X. As for the online prediction model, the user's online feature data (feature B) can be continuously collected and written into the database Y, where the online feature data can be a standard generated by the user in the process of participating in a specific business Real-time business data, for example: the trigger time of online prediction is t1, then the online characteristic data can be business data generated during the time period from t0 to t1 (such as 3 minutes). It can be seen that after the user request for initiating the prediction process arrives, the scheduler needs to perform two tasks. One is to read from the database X the last time corresponding to the target user calculated by the offline prediction model. The second prediction value; the second is to read the online characteristic data of the target user from the database Y to perform the subsequent value prediction process of the online prediction model. So far, for any target user, a prediction score can be obtained through the online prediction model, and a prediction score can be obtained through the offline prediction model. Step 103: According to the results of binning the prediction values of the online prediction model and the prediction value of the offline prediction model in advance, determine the first interval in which the first prediction value is located and the second interval in which the second prediction value is located. Second interval. Step 104: According to the first interval and the second interval, using a pre-trained model to fuse the first prediction value and the second prediction value to obtain a final fusion prediction value. The fusion prediction value is used to determine a label of the target user. In an optional embodiment, step 104 may specifically include: Step 1041: Obtain a first weight corresponding to the first interval and a first weight corresponding to the first interval based on a predetermined weight corresponding to each interval obtained by binning. The second weight corresponding to the two intervals. The parameters to be trained of the model include weights corresponding to the intervals obtained by binning. Step 1042: Use the first weight and the second weight to determine a fusion prediction value, where the fusion prediction value is used to determine a label of the target user. Because the above steps 103 to 104 need to be implemented based on the binning results and the weights corresponding to the intervals obtained by the binning, before introducing the steps 103 to 104 in detail, a method for determining the fusion weight needs to be introduced. As shown in FIG. 2, in an embodiment, the method includes steps 201 to 203, where: Step 201: Based on a given number of samples, the prediction value of the online prediction model and the offline prediction are respectively set according to a set binning method. The prediction value of the model is binned, wherein each of the plurality of samples includes: a first prediction value, a second prediction value, and a label of the sample, the first prediction value being obtained from the online prediction model prediction, and the second The predicted value is obtained by the offline prediction model.的 The samples mentioned in step 201 may be the same as the samples used to train the offline prediction model and / or the online prediction model. Of course, the samples may also be different samples, which is not limited. In one embodiment, the set binning method may be an entropy-based binning method. The entropy-based binning method considers the value of the dependent variable when binning, so that the minimum entropy (minimumentropy) is reached after binning. The advantage of the entropy-based binning method is that it can show better discrimination in high score areas. Of course, the set binning method may also be a Gini-based binning method, an iso-frequency binning method, or the like. Step 202: According to the binning result, the first prediction value of each sample is converted into a first interval feature corresponding to the interval in which the first prediction value is located, and the second prediction value of each sample is converted into the second prediction value. The second interval feature corresponding to the interval in which the predicted value is located. In an example, assuming that the first prediction value and the second prediction value are both between 0 and 1, after dividing the prediction value of the online prediction model, the obtained segmentation points include: 0, 0.1, 0.13 , 0.15, 0.2, 0.3, 0.5, 1; After binning the prediction values of the offline prediction model, the resulting segmentation points include: 0, 0.03, 0.05, 0.08, 0.09, 0.11, 0.13, 1; that is, The output values of the online prediction model and the offline prediction model are divided into 7 intervals after binning. In one embodiment, the one-hot rule can be used to implement the feature conversion in step 202. Assume that the first prediction value of a sample is 0.17 and the second prediction value is 0.12. Since 0.17 is in the fourth interval (0.15, 0.2) and 0.12 is in the sixth interval (0.11, 0.13), one-hot is used. The rule can convert the first prediction value: 0.17 to the first interval feature: on-bin-0001000 ("on-bin" is the identifier of the online prediction model), and the second prediction value: 0.12 to the second interval feature: off -bin-0000010 ("off-bin" is an identification of the offline prediction model). In the same way, feature conversion can be performed on the first predicted value and the second predicted value in other samples one by one. Step 203: Use the first interval feature, the second interval feature, and the label of the sample to form transformed sample data, and use the transformed sample data to train a model. The trained model is used The final prediction value is obtained by fusing the prediction value of the online prediction model and the prediction value of the offline prediction model. Wherein, the transformed sample data may include other data in addition to the first interval feature, the second interval feature, and a label of the sample. That is, the "composition" is not closed. In the above example, before the feature conversion, a piece of sample data is, for example: {0.17, 0.12, "medium risk user"}; After the feature conversion, a new piece of sample data is, for example: {0001000, 0000010, "Medium-risk users"} 的 The model to be trained in this article can be a linear model or a non-linear model. In an embodiment using a linear model, the parameters to be trained of the model can include weights corresponding to the intervals obtained by binning. The weight may be used to fuse the prediction value of the line prediction model and the prediction value of the offline prediction model to obtain a final prediction value. The model to be trained can be a Logistic Regression (LR) model, in which each interval obtained by binning can be assigned a weight, and the weight is used as a parameter of the LR model for training, and finally each weight value can be solved . The above weight may be a score of the corresponding interval. The score is not only a global importance trade-off and learning between different model features (online or offline models), but also between each score interval. Following the example mentioned above, the following weights can finally be obtained: the weight of the interval (0,0.1) on-bin-1 = 1.054, ... the weight of the interval 0.5 (0.5,1) on-bin-7 = 4.439; the interval (( 0,0.03) weight off-bin-1 = 0.604, ... interval (0.13,1) weight off-bin-7 = 3.237. Next, the above steps 103 to 104 will be described in combination with the above specific examples. Assume that for a target user, the first prediction value obtained through the online prediction model is 0.66, and the second prediction value obtained through the offline prediction model is 0.25. In combination with the above example, first in step 103, determine the first The first interval where the predicted value 0.4 is located is: (0.5, 1), and the second interval where the second predicted value 0.25 is located is: (0.13, 1). Then in step 1041, based on a predetermined weight corresponding to each interval obtained by binning, a first weight corresponding to the first interval: (0.5, 1) is: 4.439, and the second interval : (0.13,1) The corresponding second weight is: 3.237. Finally, in step 1042, the final fusion prediction value may be determined according to the first weight and the second weight. In an optional embodiment, the first weight and the second weight may be summed, The summed result is used as the fusion prediction value, that is, the fusion prediction value = 4.439 + 3.237 = 7.676. Of course, the specific way of fusion is not limited to summation, such as averaging. Finally, how to use the fusion prediction value may be decided according to a specific service. The effects produced by the technical solutions provided in the embodiments of the present specification include: 融合 Fusion of the prediction value of the line prediction model and the prediction value of the offline prediction model through weights obtained by machine learning, and finally using the score obtained by the fusion To predict the tags of users, while improving the accuracy of predicting the tags of users, it also meets the requirements of the service for low latency. In addition, using entropy-based binning and logistic regression models, the online model scores and offline model scores are effectively integrated, so that the comparability between online and offline scores is adaptively adjusted during the machine learning process. Corresponding to the above method embodiment, the embodiment of the present specification also provides a device for fusing model prediction values. Referring to FIG. 3, in an embodiment, in the training phase of fusion weights, a device 300 for determining fusion weights may include: a binning unit 301 configured to: based on a given number of samples, according to a set binning method To bin the prediction value of the online prediction model and the prediction value of the offline prediction model, wherein each of the samples includes: a first prediction value, a second prediction value, and a label of the sample; A prediction value is obtained from the online prediction model, and a second prediction value is obtained from the offline prediction model. The feature conversion unit 302 is configured to convert the first prediction value of each sample into the first prediction value according to the binning result. The first interval feature corresponding to the interval in which the predicted value is located converts the second predicted value of each sample into the second interval feature corresponding to the interval in which the second predicted value is located. The training unit 303 is configured to: The first interval feature, the second interval feature, and the label of the sample corresponding to a sample constitute the transformed sample data, and use the conversion The trained sample data is used to train the model. The trained model is used to fuse the prediction value of the online prediction model and the prediction value of the offline prediction model to obtain the final prediction value. Referring to FIG. 4, in an embodiment, in a score fusion stage, a device 400 for fusing model prediction values may include: an online score prediction unit 401 configured to: obtain a target user before a trigger time Business data generated in the first period of time, determine input characteristics according to the business data and input it to an online prediction model, and output a first prediction value, the online prediction model is used to predict a user's label; an offline score obtaining unit 402, configured to: obtain a second prediction value corresponding to the target user obtained by using an offline prediction model, wherein an input feature of the offline prediction model is based on a second time period of the target user in the past The offline prediction model is used to predict the user's label based on the internally generated business characteristics. The interval determination unit 403 is configured to perform binning according to the prediction value of the online prediction model and the prediction value of the offline prediction model in advance. Results of determining the first interval and the second prediction where the first prediction value is located, respectively A second interval in which the value is located; a weight determining unit 404 is configured to: according to the first interval and the second interval, use a model trained in advance to perform a first prediction on the second prediction and the second prediction Value fusion to obtain a final fusion prediction value, and the fusion prediction value is used to determine a label of the target user. In an optional embodiment, the score fusion unit 404 may include: a weight determination sub-unit that obtains a first weight corresponding to the first interval based on a predetermined weight corresponding to each interval obtained by binning; And a second weight corresponding to the second interval; a fusion subunit, using the first weight and the second weight to determine a fusion prediction value, where the fusion prediction value is used to determine a label of the target user . In an embodiment, the fusion subunit may be configured to: sum the first weight and the second weight, and use the summed result as a fusion prediction value.的 For the implementation process of the functions and functions of each module in the above device, see the implementation process of the corresponding steps in the above method for details. An embodiment of the present specification also provides a computer device (such as a server), which includes at least a memory, a processor, and a computer program stored in the memory and executable on the processor. The processor implements the program when the program is executed. The aforementioned method. FIG. 5 shows a more specific schematic diagram of the hardware structure of a computing device provided by an embodiment of this specification. The device may include a processor 1010, a memory 1020, an input / output interface 1030, a communication interface 1040, and a bus 1050. . The processor 1010, the memory 1020, the input / output interface 1030, and the communication interface 1040 implement a communication connection within the device through a bus 1050. The processor 1010 may be implemented by a general-purpose CPU (Central Processing Unit, central processing unit), a microprocessor, an Application Specific Integrated Circuit (ASIC), or one or more integrated circuits. Relevant programs are executed to implement the technical solutions provided by the embodiments of this specification. Memory 1020 may be implemented in the form of ROM (Read Only Memory), RAM (Random Access Memory), static storage devices, dynamic storage devices, and the like. The memory 1020 may store an operating system and other applications. When the technical solution provided by the embodiment of the present specification is implemented by software or firmware, the relevant code is stored in the memory 1020 and is called and executed by the processor 1010. . The input / output interface 1030 is used to connect input / output modules to realize information input and output. The input / output / module can be configured as a component in the device (not shown in the figure), or it can be externally connected to the device to provide the corresponding function. The input device may include a keyboard, a mouse, a touch screen, a microphone, various sensors, and the like, and the output device may include a display, a speaker, a vibrator, and an indicator light. The communication interface 1040 is used to connect a communication module (not shown in the figure), so as to realize communication interaction between the device and other devices. The communication module can realize communication through a wired method (such as USB, network cable, etc.), and can also realize communication through a wireless method (such as mobile network, WIFI, Bluetooth, etc.). The bus 1050 includes a path for transmitting information between various components of the device (such as the processor 1010, the memory 1020, the input / output interface 1030, and the communication interface 1040). It should be noted that, although the above device only shows the processor 1010, the memory 1020, the input / output interface 1030, the communication interface 1040, and the bus 1050, in the specific implementation process, the device may further include a device that implements normal execution. Required additional components. In addition, it can be understood by those having ordinary knowledge in the art that the above-mentioned device may also include only components necessary to implement the solutions of the embodiments of the present specification, and not necessarily all the components shown in the drawings. From the description of the above embodiments, it can be known that those with ordinary knowledge in the art can clearly understand that the embodiments of this specification can be implemented by means of software plus necessary universal hardware platforms. Based on this understanding, the technical solutions of the embodiments of the present specification can be reflected in the form of software products that are essentially or contribute to the existing technology. The computer software products can be stored in storage media, such as ROM / RAM, magnetic Disks, optical discs, etc. include several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to perform the methods described in various embodiments or portions of the embodiments of this specification.的 The system, device, module, or unit described in the above embodiments may be implemented by a computer chip or entity, or a product with a certain function. A typical implementation device is a computer. The specific form of the computer can be a personal computer, a notebook computer, a mobile phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an e-mail receiving and sending device, and a game console. , Tablet, wearable, or a combination of any of these devices.实施 Each embodiment in this specification is described in a gradual manner, and the same or similar parts between the various embodiments can be referred to each other. Each embodiment focuses on the differences from other embodiments. In particular, as for the device embodiment, since it is basically similar to the method embodiment, it is described relatively simply. For the relevant part, refer to the description of the method embodiment. The device embodiments described above are only schematic, and the modules described as separate components may or may not be physically separated. When implementing the solutions of the embodiments of this specification, the functions of each module may be In one or more software and / or hardware. It is also possible to select some or all of the modules according to actual needs to achieve the purpose of the solution of this embodiment. Those with ordinary knowledge in the field can understand and implement it without paying progressive labor. The above are only specific implementations of the embodiments of the present specification. It should be noted that for those with ordinary knowledge in the art, without departing from the principles of the embodiments of the present specification, several improvements and retouches can be made. These Improvement and retouching should also be regarded as the protection scope of the embodiments of the present specification.

201‧‧‧步驟201‧‧‧ steps

202‧‧‧步驟202‧‧‧step

203‧‧‧步驟203‧‧‧step

300‧‧‧裝置300‧‧‧ device

301‧‧‧分箱單元301‧‧‧dividing unit

302‧‧‧特徵轉換單元302‧‧‧Feature Conversion Unit

303‧‧‧訓練單元303‧‧‧ training unit

400‧‧‧裝置400‧‧‧ device

401‧‧‧線上分值預測單元401‧‧‧online score prediction unit

402‧‧‧離線分值獲得單元402‧‧‧Offline score obtaining unit

403‧‧‧區間確定單元403‧‧‧ interval determination unit

404‧‧‧分值融合單元404‧‧‧point fusion unit

1010‧‧‧處理器1010‧‧‧ processor

1020‧‧‧記憶體1020‧‧‧Memory

1030‧‧‧輸入/輸出介面1030‧‧‧ input / output interface

1040‧‧‧通信介面1040‧‧‧ communication interface

1050‧‧‧匯流排1050‧‧‧Bus

為了更清楚地說明本說明書實施例或現有技術中的技術方案,下面將對實施例或現有技術描述中所需要使用的附圖作簡單地介紹,顯而易見地,下面描述中的附圖僅僅是本說明書實施例中記載的一些實施例,對於本領域中具有通常知識者來講,還可以根據這些附圖獲得其他的附圖。   圖1是本說明書實施例提供的一種對模型預測值進行融合的方法的流程示意圖;   圖2是本說明書實施例提供的一種確定融合權重的過程;   圖3是本說明書實施例提供的一種對模型預測值進行融合的裝置(權重訓練階段)的結構示意圖;   圖4是本說明書實施例提供的一種對模型預測值進行融合的裝置(分值融合階段)的結構示意圖;   圖5是用於配置本說明書實施例裝置的一種設備的結構示意圖。In order to more clearly explain the embodiments of the present specification or the technical solutions in the prior art, the drawings used in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings in the following description are only the present invention. Some of the embodiments described in the description of the specification may be obtained by those with ordinary knowledge in the art based on these drawings. FIG. 1 is a schematic flowchart of a method for fusing model prediction values according to an embodiment of the present specification; FIG. 2 is a process for determining a fusion weight provided by an embodiment of the present specification; FIG. 3 is an example of a model provided by the present specification. Schematic diagram of a device (weight training phase) for fusing predicted values; FIG. 4 is a schematic diagram of a device (score value fusion phase) for fusing model prediction values provided by an embodiment of the present specification; FIG. 5 is used to configure the device. Schematic diagram of the structure of a device in the embodiment of the specification.

Claims (14)

一種對模型預測值進行融合的方法,包括:   基於給定的若干樣本,按照設定分箱法來分別對線上預測模型的預測值和離線預測模型的預測值進行分箱,其中,所述若干樣本中的每一樣本包括:第一預測值、第二預測值以及樣本的標籤,所述第一預測值由線上預測模型預測得到,第二預測值由離線預測模型預測得到;   根據分箱的結果,將各樣本的第一預測值轉化為與該第一預測值所處的區間對應的第一區間特徵,將各樣本的第二預測值轉化為與該第二預測值所處的區間對應的第二區間特徵;   以每一樣本對應的所述第一區間特徵、所述第二區間特徵以及樣本的標籤構成轉化後的樣本資料,並利用轉化後的樣本資料來訓練模型,該訓練完成的模型用於對線上預測模型的預測值和離線預測模型的預測值進行融合得到最終的預測值。A method for fusing model prediction values, including: based on a given number of samples, and binning the prediction values of an online prediction model and the prediction values of an offline prediction model according to a set binning method, wherein the plurality of samples Each of the samples includes a first prediction value, a second prediction value, and a label of the sample. The first prediction value is obtained from an online prediction model, and the second prediction value is obtained from an offline prediction model. According to the results of binning , Converting the first prediction value of each sample into a first interval feature corresponding to the interval in which the first prediction value is located, and converting the second prediction value of each sample into a corresponding interval in which the second prediction value is located Second interval feature; The first interval feature, the second interval feature, and the label of the sample corresponding to each sample constitute the transformed sample data, and the transformed sample data is used to train the model. The model is used to fuse the prediction value of the online prediction model and the prediction value of the offline prediction model to obtain the final prediction value. 根據請求項1所述的方法,所述設定分箱法包括:基於熵的分箱法、或基於基尼的分箱法、或等頻分箱法。According to the method of claim 1, the set binning method includes: an entropy-based binning method, a Gini-based binning method, or an iso-frequency binning method. 根據請求項1所述的方法,所述模型的待訓練參數包括與分箱得到的各區間對應的權重,所述權重用於對線預測模型的預測值和離線預測模型的預測值進行融合得到最終的預測值。According to the method described in claim 1, the parameters to be trained of the model include weights corresponding to each interval obtained by binning, and the weights are used to obtain the fusion of the prediction value of the line prediction model and the prediction value of the offline prediction model. The final predicted value. 一種對模型預測值進行融合的方法,包括:   獲取目標使用者在第一時間段內產生的業務資料,根據所述業務資料確定輸入特徵並輸入到線上預測模型,輸出第一預測值;   獲取利用離線預測模型得到的與所述目標使用者對應的第二預測值,其中,所述離線預測模型的輸入特徵是根據所述目標使用者在第二時間段內產生的業務特徵來確定的;   獲取對線上預測模型的第一預測值和離線預測模型的第二預測值進行分箱的結果,分別確定所述第一預測值所處的第一區間和所述第二預測值所處的第二區間;   根據所述第一區間和所述第二區間,利用預先訓練得到的模型來對所述第一預測值和所述第二預測值進行融合,得到最終的融合預測值,所述融合預測值用來確定所述目標使用者的標籤。A method for fusing model predictions, including: acquiring business data generated by a target user within a first period of time, determining input characteristics based on the business data and inputting them to an online prediction model, and outputting a first prediction value; obtaining utilization A second prediction value corresponding to the target user obtained by the offline prediction model, wherein the input characteristics of the offline prediction model are determined according to the business characteristics generated by the target user in the second time period; Results of binning the first prediction value of the online prediction model and the second prediction value of the offline prediction model, and respectively determining a first interval in which the first prediction value is located and a second interval in which the second prediction value is located. Interval; using a model trained in advance to fuse the first predicted value and the second predicted value according to the first interval and the second interval to obtain a final fusion predicted value, the fusion prediction The value is used to determine the label of the target user. 根據請求項3所述的方法,所述利用預先訓練得到的模型來對所述第一預測值和所述第二預測值進行融合得到最終的融合預測值,包括:   基於預先確定的與分箱得到的各區間對應的權重,獲得與所述第一區間對應的第一權重及與所述第二區間對應的第二權重,所述模型的待訓練參數包括與分箱得到的各區間對應的權重;   利用所述第一權重和所述第二權重來確定融合預測值。According to the method of claim 3, the use of a pre-trained model to fuse the first prediction value and the second prediction value to obtain a final fusion prediction value includes: based on a predetermined determination and binning The weights corresponding to the intervals are obtained, a first weight corresponding to the first interval and a second weight corresponding to the second interval are obtained, and the parameters to be trained of the model include those corresponding to each interval obtained by binning. Weights: (1) Use the first weight and the second weight to determine a fusion prediction value. 根據請求項5所述的方法,所述利用所述第一權重和所述第二權重來確定融合預測值,包括:   將所述第一權重和所述第二權重進行求和,並將求和結果作為融合預測值。According to the method of claim 5, the using the first weight and the second weight to determine a fusion prediction value includes: 求 summing the first weight and the second weight, and And the result is used as the fusion prediction value. 一種對模型預測值進行融合的裝置,包括:   分箱單元,基於給定的若干樣本,按照設定分箱法來分別對線上預測模型的預測值和離線預測模型的預測值進行分箱,其中,所述若干樣本中的每一樣本包括:第一預測值、第二預測值以及樣本的標籤,所述第一預測值由線上預測模型預測得到,第二預測值由離線預測模型預測得到;   特徵轉換單元,根據分箱的結果,將各樣本的第一預測值轉化為與該第一預測值所處的區間對應的第一區間特徵,將各樣本的第二預測值轉化為與該第二預測值所處的區間對應的第二區間特徵;   訓練單元,以每一樣本對應的所述第一區間特徵、所述第二區間特徵以及樣本的標籤構成轉化後的樣本資料,並利用轉化後的樣本資料來訓練模型,該訓練完成的模型用於對線上預測模型的預測值和離線預測模型的預測值進行融合得到最終的預測值。A device for fusing model prediction values, including: (ii) a binning unit, based on a given number of samples, according to a set binning method to bin the prediction values of an online prediction model and the prediction values of an offline prediction model, respectively, Each of the plurality of samples includes: a first prediction value, a second prediction value, and a label of the sample, the first prediction value is obtained by an online prediction model prediction, and the second prediction value is obtained by an offline prediction model prediction; The conversion unit converts the first prediction value of each sample into a first interval feature corresponding to the interval in which the first prediction value is located, and converts the second prediction value of each sample into the second prediction value according to the binning result. The second interval feature corresponding to the interval in which the predicted value is located; The training unit uses the first interval feature, the second interval feature, and the label of the sample to form transformed sample data, and uses the transformed sample data. To train the model using the sample data of the model. The trained model is used to predict the prediction value of the online prediction model and the offline prediction model. Fusion to obtain a final measurement value for the predicted value. 根據請求項7所述的裝置,所述設定分箱法包括:基於熵的分箱法、或基於基尼的分箱法、或等頻分箱法。According to the device of claim 7, the set binning method includes: an entropy-based binning method, a Gini-based binning method, or an iso-frequency binning method. 根據請求項7所述的裝置,所述模型的待訓練參數包括與分箱得到的各區間對應的權重,所述權重用於對線預測模型的預測值和離線預測模型的預測值進行融合得到最終的預測值。According to the apparatus of claim 7, the parameters to be trained of the model include weights corresponding to each interval obtained by binning, and the weights are used to obtain the fusion of the prediction value of the line prediction model and the prediction value of the offline prediction model. The final predicted value. 一種對模型預測值進行融合的裝置,包括:   線上分值預測單元,獲取目標使用者在觸發時刻前的第一時間段內產生的業務資料,根據所述業務資料確定輸入特徵並輸入到線上預測模型,輸出第一預測值,所述線上預測模型用於預測使用者的標籤;   離線分值獲得單元,獲取利用離線預測模型得到的與所述目標使用者對應的第二預測值,其中,所述離線預測模型的輸入特徵是根據所述目標使用者在過去的第二時間段內產生的業務特徵來確定的,所述離線預測模型用於預測使用者的標籤;   區間確定單元,根據預先對線上預測模型的預測值和離線預測模型的預測值進行分箱的結果,分別確定所述第一預測值所處的第一區間和所述第二預測值所處的第二區間;   分值融合單元,根據所述第一區間和所述第二區間,利用預先訓練得到的模型來對所述第一預測值和所述第二預測值進行融合,得到最終的融合預測值,所述融合預測值用來確定所述目標使用者的標籤。A device for fusing model prediction values, comprising: an online score prediction unit, which acquires business data generated by a target user within a first time period before a trigger time, determines input characteristics based on the business data, and inputs the data to online prediction; Model, outputting a first prediction value, the online prediction model is used to predict a user's label; an offline score obtaining unit, obtaining a second prediction value corresponding to the target user obtained by using the offline prediction model, wherein The input characteristics of the offline prediction model are determined according to the business characteristics of the target user in the past second time period, and the offline prediction model is used to predict the user's label; Result of binning the prediction value of the online prediction model and the prediction value of the offline prediction model to determine the first interval in which the first prediction value is located and the second interval in which the second prediction value is located; Score fusion A unit, obtained by using pre-training according to the first interval and the second interval Model to fuse the first prediction value and the second prediction value to obtain a final fusion prediction value, and the fusion prediction value is used to determine a label of the target user. 根據請求項10所述的裝置,所述分值融合單元包括:   權重確定子單元,基於預先確定的與分箱得到的各區間對應的權重,獲得與所述第一區間對應的第一權重及與所述第二區間對應的第二權重;   融合子單元,利用所述第一權重和所述第二權重來確定融合預測值,所述融合預測值用來確定所述目標使用者的標籤。According to the apparatus of claim 10, the score fusion unit includes: a weight determining subunit, which obtains a first weight corresponding to the first interval based on a predetermined weight corresponding to each interval obtained by the binning and A second weight corresponding to the second interval; a fusion subunit, using the first weight and the second weight to determine a fusion prediction value, where the fusion prediction value is used to determine a label of the target user. 根據請求項11所述的裝置,所述融合子單元被配置為:   將所述第一權重和所述第二權重進行求和,並將求和結果作為融合預測值。According to the apparatus of claim 11, the fusion subunit is configured to: sum the first weight and the second weight, and use the summed result as a fusion prediction value. 一種電腦設備,包括:   處理器;   用於儲存處理器可執行指令的記憶體;   所述處理器被配置為:   基於給定的若干樣本,按照設定分箱法來分別對線上預測模型的預測值和離線預測模型的預測值進行分箱,其中,所述若干樣本中的每一樣本包括:第一預測值、第二預測值以及樣本的標籤,所述第一預測值由線上預測模型預測得到,第二預測值由離線預測模型預測得到;   根據分箱的結果,將各樣本的第一預測值轉化為與該第一預測值所處的區間對應的第一區間特徵,將各樣本的第二預測值轉化為與該第二預測值所處的區間對應的第二區間特徵;   以每一樣本對應的所述第一區間特徵、所述第二區間特徵以及樣本的標籤構成轉化後的樣本資料,並利用轉化後的樣本資料來訓練模型,該訓練完成的模型用於對線上預測模型的預測值和離線預測模型的預測值進行融合得到最終的預測值。A computer device, comprising: a processor; a memory for storing processor-executable instructions; a processor configured to: a predicted value of an online prediction model according to a set of binning methods based on a given number of samples Binning with the prediction value of the offline prediction model, wherein each of the several samples includes a first prediction value, a second prediction value, and a label of the sample, and the first prediction value is obtained by prediction by the online prediction model. , The second prediction value is obtained by the offline prediction model; According to the binning result, the first prediction value of each sample is converted into a first interval feature corresponding to the interval in which the first prediction value is located, and the first The two prediction values are converted into a second interval feature corresponding to the interval in which the second prediction value is located; The first interval feature, the second interval feature, and the label of the sample corresponding to each sample constitute a transformed sample. Data, and use the transformed sample data to train the model. The trained model is used to predict online Prediction value of the prediction models and the offline models are fused to give a final prediction value. 一種電腦設備,包括:   處理器;   用於儲存處理器可執行指令的記憶體;   所述處理器被配置為:   獲取目標使用者在第一時間段內產生的業務資料,根據所述業務資料確定輸入特徵並輸入到線上預測模型,輸出第一預測值;   獲取利用離線預測模型得到的與所述目標使用者對應的第二預測值,其中,所述離線預測模型的輸入特徵是根據所述目標使用者在第二時間段內產生的業務特徵來確定的;   獲取對線上預測模型的第一預測值和離線預測模型的第二預測值進行分箱的結果,分別確定所述第一預測值所處的第一區間和所述第二預測值所處的第二區間;   根據所述第一區間和所述第二區間,利用預先訓練得到的模型來對所述第一預測值和所述第二預測值進行融合,得到最終的融合預測值,所述融合預測值用來確定所述目標使用者的標籤。A computer device, comprising: a processor; a memory for storing processor-executable instructions; a processor configured to: obtain a business data generated by a target user within a first time period, and determine based on the business data Input features and input to the online prediction model, and output the first prediction value; obtain a second prediction value corresponding to the target user obtained by using an offline prediction model, wherein the input features of the offline prediction model are based on the target Determined by the user's business characteristics generated in the second time period; Obtaining the results of binning the first prediction value of the online prediction model and the second prediction value of the offline prediction model, and determining the first prediction value. The first interval at the second interval and the second interval at which the second predicted value is located; according to the first interval and the second interval, using a model trained in advance to compare the first predicted value and the first predicted value The two prediction values are fused to obtain a final fusion prediction value, and the fusion prediction value is used to Determining a label of the target user.
TW107135970A 2017-12-15 2018-10-12 Method, device and equipment for fusing model prediction values TWI718422B (en)

Applications Claiming Priority (3)

Application Number Priority Date Filing Date Title
CN201711353984.1 2017-12-15
??201711353984.1 2017-12-15
CN201711353984.1A CN108052979A (en) 2017-12-15 2017-12-15 The method, apparatus and equipment merged to model predication value

Publications (2)

Publication Number Publication Date
TW201928709A true TW201928709A (en) 2019-07-16
TWI718422B TWI718422B (en) 2021-02-11

Family

ID=62132684

Family Applications (1)

Application Number Title Priority Date Filing Date
TW107135970A TWI718422B (en) 2017-12-15 2018-10-12 Method, device and equipment for fusing model prediction values

Country Status (3)

Country Link
CN (1) CN108052979A (en)
TW (1) TWI718422B (en)
WO (1) WO2019114423A1 (en)

Families Citing this family (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108052979A (en) * 2017-12-15 2018-05-18 阿里巴巴集团控股有限公司 The method, apparatus and equipment merged to model predication value
CN108985489B (en) * 2018-06-08 2021-12-31 创新先进技术有限公司 Risk prediction method, risk prediction device and terminal equipment
CN109063886B (en) * 2018-06-12 2022-05-31 创新先进技术有限公司 Anomaly detection method, device and equipment
CN109635990B (en) * 2018-10-12 2022-09-16 创新先进技术有限公司 Training method, prediction method, device, electronic equipment and storage medium
CN112418258A (en) * 2019-08-22 2021-02-26 北京京东振世信息技术有限公司 Feature discretization method and device
CN111242244B (en) * 2020-04-24 2020-09-18 支付宝(杭州)信息技术有限公司 Characteristic value sorting method, system and device
CN111582565A (en) * 2020-04-26 2020-08-25 支付宝(杭州)信息技术有限公司 Data fusion method and device and electronic equipment
CN111767982A (en) * 2020-05-20 2020-10-13 北京大米科技有限公司 Training method and device for user conversion prediction model, storage medium and electronic equipment
CN112288457A (en) * 2020-06-23 2021-01-29 北京沃东天骏信息技术有限公司 Data processing method, device, equipment and medium based on multi-model calculation fusion
CN112711765A (en) * 2020-12-30 2021-04-27 深圳前海微众银行股份有限公司 Sample characteristic information value determination method, terminal, device and storage medium
CN112801358A (en) * 2021-01-21 2021-05-14 上海东普信息科技有限公司 Component prediction method, device, equipment and storage medium based on model fusion
CN113312512B (en) * 2021-06-10 2023-10-31 北京百度网讯科技有限公司 Training method, recommending device, electronic equipment and storage medium
CN116402241B (en) * 2023-06-08 2023-08-18 浙江大学 Multi-model-based supply chain data prediction method and device

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9563855B2 (en) * 2014-06-27 2017-02-07 Intel Corporation Using a generic classifier to train a personalized classifier for wearable devices
CN107025153B (en) * 2016-01-29 2021-02-12 阿里巴巴集团控股有限公司 Disk failure prediction method and device
CN105679021B (en) * 2016-02-02 2018-11-06 招商局重庆交通科研设计院有限公司 Journey time fusion forecasting and querying method based on traffic big data
CN106873571B (en) * 2017-02-10 2019-12-06 泉州装备制造研究所 early warning method based on data and model fusion
CN108052979A (en) * 2017-12-15 2018-05-18 阿里巴巴集团控股有限公司 The method, apparatus and equipment merged to model predication value

Also Published As

Publication number Publication date
TWI718422B (en) 2021-02-11
WO2019114423A1 (en) 2019-06-20
CN108052979A (en) 2018-05-18

Similar Documents

Publication Publication Date Title
TWI718422B (en) Method, device and equipment for fusing model prediction values
US11170392B2 (en) System and method for classifying relevant competitors
US10958748B2 (en) Resource push method and apparatus
US10599449B1 (en) Predictive action modeling to streamline user interface
CN108985830B (en) Recommendation scoring method and device based on heterogeneous information network
CN108829808B (en) Page personalized sorting method and device and electronic equipment
TW201923624A (en) Data sample label processing method and apparatus
CN109902708A (en) A kind of recommended models training method and relevant apparatus
TW201939917A (en) Graph structure model training and junk account identification
CN106251174A (en) Information recommendation method and device
JP2019525309A (en) Method and apparatus for controlling data risk
CN108920665B (en) Recommendation scoring method and device based on network structure and comment text
US11875241B2 (en) Aspect pre-selection using machine learning
JP6911603B2 (en) How to generate predictive models for the categories of facilities visited by users, programs, server equipment, and processing equipment
WO2019169964A1 (en) Resource recommendation method and apparatus, marketing recommendation method and apparatus, and electronic device
JP2013058192A (en) System, method and computer program product for parcel assessment
US20180349476A1 (en) Evaluating theses using tree structures
WO2020155814A1 (en) Damage determination method and apparatus for maintenance object, and an electronic device
CN108021941B (en) Method and device for predicting drug hepatotoxicity
CN111026973B (en) Commodity interest degree prediction method and device and electronic equipment
WO2021135322A1 (en) Automatic question setting method, apparatus and system
US11853948B2 (en) Methods and systems for managing risk with respect to potential customers
CN110830515A (en) Flow detection method and device and electronic equipment
US20170004511A1 (en) Identifying Drivers for a Metric-of-Interest
CN111915339A (en) Data processing method, device and equipment