WO2021208774A1 - 辅助机器学习模型上线的方法及装置 - Google Patents

辅助机器学习模型上线的方法及装置 Download PDF

Info

Publication number
WO2021208774A1
WO2021208774A1 PCT/CN2021/085620 CN2021085620W WO2021208774A1 WO 2021208774 A1 WO2021208774 A1 WO 2021208774A1 CN 2021085620 W CN2021085620 W CN 2021085620W WO 2021208774 A1 WO2021208774 A1 WO 2021208774A1
Authority
WO
WIPO (PCT)
Prior art keywords
prediction
online
model
service
data
Prior art date
Application number
PCT/CN2021/085620
Other languages
English (en)
French (fr)
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 第四范式(北京)技术有限公司
Priority to EP21789192.8A priority Critical patent/EP4138004A4/en
Publication of WO2021208774A1 publication Critical patent/WO2021208774A1/zh
Priority to US17/967,169 priority patent/US20230043882A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N20/00Machine learning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/10Interfaces, programming languages or software development kits, e.g. for simulating neural networks
    • G06N3/105Shells for specifying net layout
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2282Tablespace storage structures; Management thereof
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • G06N3/09Supervised learning

Definitions

  • the present disclosure generally relates to the field of artificial intelligence, and more specifically, to a method and device for assisting machine learning models to go online.
  • Machine learning is an inevitable product of the development of artificial intelligence research to a certain stage. It is committed to improving the performance of the system itself through computational means and using experience.
  • experience usually exists in the form of "data”.
  • a "model” can be generated from data. That is to say, by providing empirical data to the machine learning algorithm, it can be generated based on these empirical data The model, when faced with a new situation, the model will provide the corresponding judgment, that is, the prediction result.
  • the exemplary embodiments of the present disclosure aim to provide an auxiliary solution for the online launch of the machine learning model, so as to provide support for the online launch of the machine learning model.
  • a method for assisting machine learning models to go online includes: obtaining model files obtained by offline training machine learning models; analyzing the model files to determine the training data table used in the model training process ; Create an online data table consistent with the table information of the training data table in the online database; import at least part of the offline data into the online data table.
  • a device for assisting machine learning models to go online which includes: an acquisition module for acquiring model files obtained by offline training of the machine learning model; and a first determining module for evaluating the model
  • the file is analyzed to determine the training data table used in the model training process;
  • the creation module is used to create an online data table consistent with the table information of the training data table in the online database;
  • the import module is used to import at least part of the offline data Online data sheet.
  • a system including at least one computing device and at least one storage device storing instructions is also proposed, wherein when the instructions are executed by the at least one computing device, the at least one A computing device executes the method described in the first aspect of the present disclosure.
  • a computer-readable storage medium storing instructions is also provided, wherein when the instructions are executed by at least one computing device, the at least one computing device is prompted to execute the The method described in each aspect.
  • a computing device including a processor and a memory, and a set of computer-executable instructions is stored in the memory, and when the set of computer-executable instructions is executed by the processor , Make the processor execute the following steps: obtain the model file obtained by training the machine learning model offline; parse the model file to determine the training data table used in the model training process; create the training data in the online database An online data table with consistent table information; at least part of the offline data is imported into the online data table.
  • an online data table consistent with the table information of the training data table is created, and offline training data of a certain time range is imported
  • the online data table created can realize the cold start of online data and provide support for the online model.
  • Fig. 1 shows a flowchart of a method for assisting a machine learning model to go online according to an exemplary embodiment of the present disclosure
  • Figure 2 shows a DAG (directed acyclic graph) of a model training process
  • Figure 3 shows a schematic diagram of part of the information carried by the model file
  • Figure 4 shows a schematic diagram of a graphical interface presented to the user
  • Figure 5 shows a schematic diagram of a service detail page displayed to users
  • Figure 6 shows a schematic diagram of the consistency verification process
  • Figure 7 shows a schematic diagram of the model online process
  • Fig. 8 shows a structural block diagram of an apparatus for assisting machine learning model online according to an exemplary embodiment of the present disclosure.
  • Fig. 1 shows a flowchart of a method for assisting a machine learning model to go online according to an exemplary embodiment of the present disclosure.
  • the method shown in FIG. 1 can be completely implemented in software through a computer program, and the method shown in FIG. 1 can also be executed by a specially configured computing device.
  • step S110 a model file obtained by offline training a machine learning model is obtained.
  • a model file obtained by training a machine learning model offline that is, a model file obtained by performing model training in an offline environment.
  • the training process of the machine learning model is not the focus of this disclosure, and will not be repeated here.
  • the model file may include, but is not limited to, model structure information, training process configuration information, and other information related to model training.
  • step S120 the model file is analyzed to determine the training data table used in the model training process.
  • the training data table refers to the input table corresponding to the feature processing step in the model training process, that is, the input table before the feature processing.
  • a preprocessing operation is performed on the original data table before the feature processing is performed, so that the preprocessed data table is a data table that meets the training requirements.
  • the training data table refers to the preprocessed input table for feature processing.
  • the model training process information can be obtained by analyzing the model file, and according to the model training process information, the input table corresponding to the feature processing step is used as the training data table used in the model training process.
  • the model training process information may include, but is not limited to, one or more of the processing nodes in the model training process, the input tables corresponding to the processing nodes, and the output tables corresponding to the processing nodes.
  • the processing node can be regarded as a specific machine learning step in the model training process, and the processing node can also include a corresponding processing method.
  • the processing method can be, but is not limited to, a processing script or an operator.
  • a feature processing script (such as a feature construction script) may be included in the model file.
  • Feature processing scripts can be written based on a specific description language.
  • the training data table can be determined by analyzing the feature processing script. The present disclosure does not limit the specific structure of the feature processing script.
  • FIG. 2 shows a DAG (directed acyclic graph) of a model training process.
  • DAG includes data table A, data table B, data preprocessing, feature processing, feature signature, and model training.
  • data table A does not directly perform feature processing, but requires data preprocessing. Therefore, data table A does not meet the definition of a training data table.
  • the model file finally produced by training according to the DAG shown in FIG. 2 may carry the information shown in FIG. 3.
  • the information shown in FIG. 3 can be obtained by analyzing the model file.
  • the information shown in Figure 3 shows the relationship between the operator nodes (that is, the processing nodes mentioned above), the input table of the operator node, the output table of the operator node, the feature processing script and so on.
  • the present disclosure can filter the input table before feature processing (ie, training data table) based on the above content.
  • the input table obtained after preprocessing the data table A and the data table B can be used as the training data table, and the training data can be obtained.
  • Table organization structure (schema) and table name and other table information can be used as the training data table.
  • the model file may be a script file based on a programming language.
  • the programming language-based information shown in FIG. 3 can be obtained, that is, the information shown in FIG. 3 may be Part of the script taken from the model file.
  • “nodes” in Figure 3 is used to represent operator nodes
  • "script” is used to represent feature processing scripts
  • "inutTables” is used to represent input tables
  • "outputTables” are used to represent output tables.
  • “Uuid” and “cols” are used to indicate the data table structure and table name information, such as but not limited to the table name, the field name in the table, the field type, etc.
  • an online data table consistent with the table information of the training data table is created in the online database.
  • Table information may refer to information such as the organization structure (schema) and table name of the training data table, and may include, but is not limited to, information such as field names and field types in the training data table.
  • Online database refers to a database used to store online data. Online databases can use KV storage databases (such as Redis or other real-time feature storage engines RtiDB, etc.) to ensure high read and write performance, high data availability and other requirements. And when storing data in an online database, you need to set a reasonable key value in combination with the logic of feature construction. For example, when feature construction uses the name field as the key for feature calculation, then you need to set name as the storage key when creating an online data table. Key-value.
  • KV storage databases such as Redis or other real-time feature storage engines RtiDB, etc.
  • the present disclosure can also store the data in the online data table with the field name key in the online database according to the field names involved in the feature processing steps determined when the model file is parsed, so as to ensure that online data reads and writes are high. performance. That is, the feature processing steps determined by parsing the model file can also include field names and feature processing methods for the field names.
  • the present disclosure can store the online database as a key in the online database according to the field names involved in the feature processing steps. The data in the data sheet.
  • step S140 at least part of the offline data is imported into the online data table.
  • the online data has a cold start, that is, there may not be enough online data for model prediction in the online data table at the initial moment.
  • the online data table is created, at least part of the offline data can be imported into the online data table to solve the data cold start problem.
  • the present disclosure can also determine the data range targeted by the feature processing step by analyzing the model file, and import offline data corresponding to the determined data range into the online data table. For example, if the maximum time interval for feature construction is 30 days, you only need to ensure that offline data with a data range of 30 days is imported into the online data table. Therefore, while solving the data cold start problem, the storage pressure of the online database can be reduced, and the resource cost can be reduced. In one embodiment, it can support user-defined import data, and provide certain flexibility to suit actual scenarios.
  • the present disclosure creates an online data table consistent with the table information of the training data table by analyzing the model file, and importing offline training data of a certain time range into the created online data table, which can realize the cold start of online data and bring the model online provide support. And for users, they only need to start the online data creation process, select the model file that they want to go online, and then the system can automatically parse the model file, and automatically import offline data into it after creating the relevant online data table, which can reduce user manual Failed to create or guide the meter.
  • the pre-launch prediction service for realizing the prediction function of the machine learning model (that is, the online prediction function) can also be deployed.
  • the consistency check of the prediction effect of the pre-launch prediction service can also be performed to ensure the reliability of the pre-launch prediction service.
  • the consistency verification refers to the verification of the consistency between the online prediction results of the pre-launch prediction service and the offline prediction results in the offline environment.
  • the pre-online prediction service can be used to predict the data to be predicted to obtain the first prediction result; to predict the data to be predicted in the offline environment to obtain the second prediction result; compare the first prediction result with the second prediction result; according to the first prediction The difference between the result and the second prediction result determines whether to launch the pre-launch prediction service.
  • the difference between the first prediction result and the second prediction result is greater than the first threshold, it indicates that the online prediction effect of the pre-launch prediction service is poor, and the pre-launch prediction service can be corrected, and the consistency check should be performed again after the correction; If the difference between the first prediction result and the second prediction result is less than the second threshold, it indicates that the online prediction effect of the pre-launch prediction service is consistent with the offline prediction effect, and the pre-launch prediction service can be deployed online.
  • the first threshold is greater than or equal to the second threshold.
  • the data to be predicted may be sample data specified by the user, or data in an online database, or data from other sources, which is not limited in the present disclosure.
  • Predict the data to be predicted in the offline environment that is, use the machine learning model obtained by offline training to predict the data to be predicted in the offline environment.
  • the downstream execution operator and model prediction operator can be determined by parsing the model file.
  • the downstream execution operator is used to characterize the operation that the data to be predicted needs to perform before the model prediction; input the data to be predicted into the downstream execution operator ; Input the output of the downstream execution operator into the model prediction operator, and the output of the model prediction operator is the second prediction result obtained by predicting the data to be predicted.
  • Applying machine learning models to online predictions can process real-time request data and improve model prediction effects.
  • the online cost of the model is higher, and more customized development is required in the actual application process.
  • the method for assisting the online launch of the machine learning model proposed in the present disclosure can realize the cold start of online data, the online evaluation and verification of the model, and provide support for the online launch of the machine learning model.
  • the method for assisting the online launch of a machine learning model of the present disclosure can be executed by a machine learning platform for realizing machine learning related services.
  • the machine learning platform can provide users with model online services in a visual way.
  • the machine learning platform may provide users with a graphical interface for setting online prediction services, and receive pre-launch prediction services selected by the user through the graphical interface.
  • the machine learning platform can provide users with multiple pre-launch prediction services to choose from.
  • Each pre-launch prediction service has a corresponding model file.
  • the model file can be stored in the back-end server and can be based on the pre-launch prediction service selected by the user. To obtain the model file corresponding to the pre-launched prediction service stored on the server side.
  • users can also upload model files to the machine learning platform when selecting the pre-launch prediction service.
  • the machine learning platform can be based on the model file, by executing the method shown above in conjunction with Figure 1, to achieve online data cold start, model online evaluation and verification, and provide support for the online machine learning model.
  • Figure 4 shows a schematic diagram of a graphical interface presented to the user.
  • the pre-launch application shown in Figure 4 is the pre-launch prediction service mentioned above.
  • the model effect can be displayed in the graphical interface; and the created online data table (that is, the online dynamic table shown in the figure) can also be displayed in the graphical interface.
  • the model effect may include, but is not limited to, model evaluation indicators such as accuracy rate and loss function.
  • Users can be provided with the option of whether to simulate going online or not, and users can choose whether to simulate going online or not according to their needs. If you choose to go online directly, you also need to configure the module and perform environmental verification, but no subsequent consistency verification will be done. This will make it difficult to ensure the reliability of the online prediction effect. If there is an inconsistency, the reverse positioning cost is high, so It is recommended that users choose to simulate online.
  • users can view the effects of the included models and the existence of corresponding online data tables to assist users in judging whether they need to simulate online application deployment (such as poor results, abnormal online data tables, users can cancel the deployment , To avoid waste of resources).
  • At least one of the following operations may also be performed: displaying resource configuration information recommended to the user in the graphical interface; receiving resource configuration information set by the user through the graphical interface.
  • resource configuration information recommended to the user For example, users can be provided with two options: “Enable system recommendation” and “Custom resource parameters”. When the user selects “Enable system recommendation”, the system recommended resource configuration can be used. When the user selects "Custom resource parameters" At the time, the resource configuration input by the user can be received.
  • environment verification can be started to verify whether the current environment of the pre-launch prediction service meets the online requirements.
  • the verification mentioned here may include, but is not limited to, verifying whether the online database is available, whether the online data is cold-started, and so on.
  • the service details page can be used to display at least one of the following service information of the pre-launch prediction service: basic parameters, model parameters, consistency verification results, and service status information.
  • the basic parameters may include but are not limited to at least one of the following: service name, service type, operating status, deployment time, running time, resource parameters; model parameters may include but not limited to at least one of the following: model name, model type, Model accuracy, logarithmic loss value; consistency verification results can include but not limited to one or more prediction data in the online environment and the scoring results in the offline environment; service status information can include but not limited to At least one of the following: performance indicators, log information, and running status monitoring information.
  • Figure 5 shows a schematic diagram of a service detail page displayed to a user.
  • the service details page can present basic parameters of the current service, module parameters (including included models, online databases), consistency verification, service status (including performance indicators, logs, and resources), etc.
  • consistency verification refers to further verifying whether the prediction performance of the pre-launch prediction service is consistent with the prediction performance of the machine learning model in the offline environment; the prediction performance of the pre-launch prediction service is consistent with the prediction of the machine learning model in the offline environment
  • the pre-launch forecast service can be converted to an online forecast service.
  • the implementation process of verifying whether the prediction performance of the pre-launch prediction service is consistent with the prediction performance of the machine learning model in the offline environment can be referred to the relevant description above.
  • the sample data that comes with the model can be used as the data to be predicted, or the sample data uploaded by the user can be obtained, and the sample data specified by the user can be used as the data to be predicted.
  • the user can also specify the output field.
  • the offline estimation task for simulating the offline operating environment and the simulation estimation task for simulating the online operating environment can be started, and the sample data can be predicted respectively. Finally, it is possible to compare whether the output results of the offline estimation task and the simulation estimation task for the output field are consistent.
  • Figure 6 shows a schematic diagram of the consistency verification process.
  • offline estimation results and simulation estimation results for output fields can be presented on the page.
  • the results of the offline estimation service and the simulation estimation service will be presented in the form of a table.
  • the user can click the "Result Consistency Check” button to compare the two results, and the inconsistent results can be displayed, or they can be manually compared one by one. If the result meets the user's expectations (exactly the same or there is a tolerable deviation), it indicates that the pre-launch prediction service meets the online requirements and can be deployed online.
  • the present disclosure may also perform at least one of the following steps: provide users with a service address (such as an API service address) for online prediction services; and show users one or Online prediction results of multiple prediction data.
  • a service address such as an API service address
  • the present disclosure may also perform at least one of the following steps: provide users with a service address (such as an API service address) for online prediction services; and show users one or Online prediction results of multiple prediction data.
  • the prediction data may be data generated online in real time.
  • the present disclosure can be implemented as a set of model launch procedures, including online data cold start, simulated launch, and application launch.
  • the entire process can be guided through a visualized page to reduce user operating costs.
  • Simulated launching refers to the environmental verification and consistency verification before the application is launched.
  • the application supports direct deployment and launch.
  • Environmental verification includes verifying whether the online database is available, whether online data is cold-started, etc.
  • the consistency verification includes obtaining sample data, performing offline estimation and scoring for sample data, and performing simulation estimation and scoring for sample data. , Check whether the scoring results are consistent.
  • Figure 7 shows a schematic diagram of the model online process. Among them, online data cold start and simulated online as the main points of the present disclosure have been described in detail above, and other related modules as default component capabilities are not described in detail.
  • users can perform model training in an offline environment and produce model files.
  • a user needs to deploy a real-time application for the currently trained model to go online, he can enter the application management page to create a real-time estimated application template, and select the current training model information.
  • the application template will automatically parse the model file to obtain the data needed during the model training process Table information and feature build script.
  • the page can guide the user to perform a cold start of online data based on the analysis results, including data table creation and derivative, and the related processes will be unified on the data management page.
  • the user needs to configure supplementary information, such as resource information, log information, etc., and then package the real-time estimation application module into a pre-launch application, and enter the simulated launch process.
  • the system will automatically verify whether the current environment meets the online requirements, including whether the online database is available, whether the online data is cold-started, and then the user can customize the sample data or select the sample data provided by the system, respectively Perform the estimated scoring of the offline model and the simulated scoring of the pre-launch model, and determine whether the current pre-launch application meets the online requirements by comparing the two data API to complete the whole process.
  • the model online process please refer to the relevant description above, which will not be repeated here.
  • the machine learning model (such as a neural network model) in the embodiments of the present disclosure can be used to predict image categories, text categories, voice emotions, fraudulent transactions, advertisement click-through rates, and so on.
  • the machine learning model (such as a neural network model) aims to predict problems related to objects or events in related scenes. For example, it can be used to predict image categories, predict text in images, predict text categories, predict voice emotion categories, predict fraudulent transactions, predict advertising click-through rates, predict commodity prices, etc., so that the prediction results can be directly used as a basis for decision-making or further combined with other rules And become the basis for decision-making.
  • the scenarios in which the machine learning model (such as the neural network model) in the embodiments of the present disclosure can be used include but are not limited to the following scenarios:
  • Image processing scenarios including: optical character recognition OCR, face recognition, object recognition, and image classification; more specifically, for example, OCR can be applied to bill (such as invoice) recognition, handwriting recognition, etc., face recognition can be applied to security
  • OCR optical character recognition
  • face recognition can be applied to security
  • object recognition can be applied to traffic sign recognition in autonomous driving scenes
  • image classification can be applied to “purchase photos” and “find the same money” on e-commerce platforms.
  • Voice recognition scenarios including products that can perform human-computer interaction through voice, such as mobile phone voice assistants (such as Apple mobile phone Siri), smart speakers, etc.;
  • Natural language processing scenarios including: review text (such as contracts, legal documents, customer service records, etc.), spam identification (such as spam SMS identification), and text classification (emotions, intentions, and topics, etc.);
  • Automatic control scenarios including: mine group adjustment operation prediction, wind turbine adjustment operation prediction, and air conditioning system adjustment operation prediction; specifically, a group of adjustment operations that can predict a high mining rate for mine groups, and predict high power generation efficiency for wind turbines
  • a set of adjustment operations can be predicted to meet demand while saving energy consumption;
  • Intelligent Q&A scenarios including: chat robots and intelligent customer service;
  • Business decision-making scenarios include: scenarios in the financial technology, medical, and municipal fields, including:
  • the field of financial technology includes: marketing (such as coupon usage prediction, advertising click behavior prediction, user portrait mining, etc.) and customer acquisition, anti-fraud, anti-money laundering, underwriting and credit scoring, and commodity price prediction;
  • the medical field includes: disease screening and prevention, personalized health management and auxiliary diagnosis;
  • Municipal areas include: social governance and supervision and law enforcement, resource environment and facility management, industrial development and economic analysis, public services and people's death protection, smart cities (the deployment and management of various urban resources such as public transportation, online car-hailing, shared bicycles, etc.);
  • Search scenarios including: web search, image search, text search, video search, etc.;
  • Abnormal behavior detection scenarios including: abnormal behavior detection of electricity consumption by State Grid customers, network malicious traffic detection, abnormal behavior detection in operation logs, etc.
  • the method for assisting machine learning model launching of the present disclosure can also be implemented as a device for creating a machine learning solution template.
  • Fig. 8 shows a structural block diagram of an apparatus for assisting machine learning model online according to an exemplary embodiment of the present disclosure.
  • the functional unit of the device that assists the machine learning model to go online can be implemented by hardware, software, or a combination of hardware and software that implements the principles of the present disclosure.
  • the functional units described in FIG. 8 can be combined or divided into sub-units to realize the principles disclosed above. Therefore, the description herein may support any possible combination, or division, or further limitation of the functional units described herein.
  • the device 800 for assisting the online machine learning model includes an acquiring module 810, a first determining module 820, a creating module 830, and an importing module 840.
  • the obtaining module 810 is configured to obtain a model file obtained by training the machine learning model offline.
  • the first determining module 820 is configured to parse the model file and determine the training data table used in the model training process.
  • the first determining module 80 may obtain model training process information by analyzing the model file, and use the input table corresponding to the feature processing step as the training data table used in the model training process according to the model training process information.
  • the model training process information may include but is not limited to at least one of the following: processing nodes in the model training process, input tables corresponding to the processing nodes, and output tables corresponding to the processing nodes.
  • the feature processing steps include field names and feature processing methods for the field names.
  • the device 800 for assisting the online machine learning model may also include a storage module configured to store the field names in the online database as a key according to the field names involved in the feature processing steps. The data in the online data sheet.
  • the creation module 830 is configured to create an online data table consistent with the table information of the training data table in the online database.
  • the import module 840 is configured to import at least part of the offline data into the online data table.
  • the device 800 for assisting machine learning models to go online may also include a second determining module configured to determine the data range targeted by the feature processing step by analyzing the model file.
  • the import module 840 may download the offline data corresponding to the data range. The data is imported into the online data table.
  • the device 800 for assisting the online launch of the machine learning model may further include a deployment module, a first prediction module, a second prediction module, and a first online module.
  • the deployment module is configured to deploy a pre-launch prediction service for realizing the prediction function of the machine learning model; the first prediction module is configured to use the pre-launch prediction service to predict the data to be predicted to obtain the first prediction result; the second prediction module is configured To predict the data to be predicted in the offline environment to obtain the second prediction result; the comparison module is configured to compare the first prediction result with the second prediction result; the first online module is configured to obtain the second prediction result according to the first prediction result and the second prediction result To determine whether to launch the pre-launch forecast service.
  • the second prediction module can analyze the model file to determine the downstream execution operator and the model prediction operator.
  • the downstream execution operator is used to characterize the operation that the data to be predicted needs to perform before the model prediction; input the data to be predicted into the downstream execution calculation Sub:
  • the output of the downstream execution operator is input to the model prediction operator, and the output of the model prediction operator is the second prediction result obtained by predicting the data to be predicted.
  • the device 800 for assisting the online machine learning model may further include a presentation module and a receiving module.
  • the presentation module is configured to provide the user with a graphical interface for setting the online prediction service;
  • the receiving module is configured to receive the pre-launch prediction service selected by the user through the graphical interface; wherein, the acquisition module 810 can perform at least one of the following operations: Obtain the model file corresponding to the pre-launched prediction service stored on the server side; receive the model file uploaded by the user.
  • the presentation module may also be configured to perform at least one of the following operations: displaying the model effect in the graphical interface; displaying the online data table in the graphical interface.
  • the presentation module may also display the resource configuration information recommended to the user in the graphical interface.
  • the receiving module may also receive resource configuration information set by the user through a graphical interface.
  • the device 800 for assisting the online of the machine learning model may further include a first verification module configured to verify whether the current environment of the pre-launch prediction service meets the online requirements after the pre-launch prediction service setting is completed.
  • the device 800 for assisting the online of the machine learning model may further include a second verification module and a second online module.
  • the second verification module is configured to verify whether the prediction performance of the pre-launch prediction service is consistent with the prediction performance of the machine learning model in the offline environment when the current environment meets the online requirements;
  • the second online module is configured to pre-launch When the prediction performance of the online prediction service is the same or basically the same as the prediction performance of the machine learning model in the offline environment, the pre-launch prediction service is converted to an online prediction service.
  • the second verification module can be configured to: obtain sample data and output fields specified by the user; start an offline estimation task for simulating an offline operating environment and a simulation estimation task for simulating an online operating environment , Respectively predict the sample data; compare whether the output results of the offline estimation task and the simulation estimation task for the output field are consistent.
  • the presentation module also provides users with a service detail page, which is used to display at least one of the following service information of the pre-launch prediction service: basic parameters, model parameters, consistency verification results, and service status information.
  • service information of the pre-launch prediction service basic parameters, model parameters, consistency verification results, and service status information.
  • the device 800 for assisting the online of the machine learning model may further include a providing module.
  • the providing module is configured to perform at least one of the following operations in the case of converting the pre-launch prediction service to the online prediction service: provide the user with the service address of the online prediction service; and show the user one or more lines of prediction data The forecast results.
  • the receiving module may also receive the user's modification of one or more field values in the prediction data; the presentation module may also display the online prediction result of the modified prediction data.
  • the above method can be implemented by a program recorded on a computer-readable medium.
  • a computer-readable storage medium storing instructions can be provided, wherein the computer can be The read storage medium records a computer program for executing the method of assisting the online machine learning model of the present disclosure (for example, as shown in FIG. 1).
  • the computer program in the above-mentioned computer-readable storage medium can be run in an environment deployed in computer equipment such as a client, a host, an agent device, a server, etc. It should be noted that the computer program can be used to perform steps other than those shown in FIG. 1 In addition, it can also be used to perform additional steps in addition to the above steps or perform more specific processing when performing the above steps. The content of these additional steps and further processing has been described with reference to Figure 1, and will not be repeated here in order to avoid repetition. Go ahead and repeat.
  • the device for assisting the online machine learning model can completely rely on the operation of the computer program to realize the corresponding function, that is, the functional architecture of each device and the computer program corresponds to each step, so that the entire The device is called through a special software package (for example, lib library) to realize the corresponding function.
  • lib library for example, lib library
  • each device shown in FIG. 8 can also be implemented by hardware, software, firmware, middleware, microcode, or any combination thereof.
  • the program code or code segment used to perform the corresponding operation can be stored in a computer-readable storage medium such as a storage medium, so that the processor can read and run the corresponding Program code or code segment to perform the corresponding operation.
  • the exemplary embodiments of the present disclosure may also be implemented as a computing device including a storage component and a processor.
  • the storage component stores a set of computer-executable instructions. When the set of computer-executable instructions is used by the processor When executing, execute the method to assist the machine learning model to go online.
  • the storage component is also the memory.
  • the step of determining the training data table used in the model training process may include: obtaining model training process information by analyzing the model file; and using the input table corresponding to the feature processing step as the model training process according to the model training process information Training data table.
  • the model training process information may include at least one of the following: a processing node in the model training process, an input table corresponding to the processing node, and an output table corresponding to the processing node.
  • the feature processing step may include a field name and a feature processing method for the field name, and the step executed by the processor may also include the following step: According to the field name involved in the feature processing step, use the field name in the online database The named key stores the data in the online data table.
  • the steps executed by the processor may further include the following steps: determining the data range targeted by the feature processing step by analyzing the model file, wherein the step of importing at least part of the offline data into the online data table may include: The offline data corresponding to the data range is imported into the online data table.
  • the steps executed by the processor may also include the following steps: deploying a pre-launch prediction service for realizing the prediction function of the machine learning model; using the pre-launch prediction service to predict the data to be predicted to obtain the first prediction result; offline environment Predict the data to be predicted to obtain a second prediction result; compare the first prediction result and the second prediction result; determine according to the difference between the first prediction result and the second prediction result Whether to launch the pre-launch forecast service.
  • the step of predicting the data to be predicted in an offline environment to obtain a second prediction result may include: determining a downstream execution operator and a model prediction operator by analyzing the model file, and the downstream execution operator is used for Characterize the operation that the data to be predicted needs to perform before model prediction; input the data to be predicted into the downstream execution operator; input the output of the downstream execution operator into the model prediction operator, and the model predicts The output of the operator is the second prediction result obtained by predicting the data to be predicted.
  • the steps executed by the processor may further include: providing a user with a graphical interface for setting online prediction services; receiving a pre-launch prediction service selected by the user through the graphical interface; wherein, obtaining a model file obtained by training the machine learning model offline
  • the step includes at least one of the following steps: obtaining a model file corresponding to the pre-online prediction service stored on the server side; and receiving a model file uploaded by a user.
  • the steps executed by the processor may further include at least one of the following steps: displaying the model effect in the graphical interface; displaying the online data table in the graphical interface.
  • the steps executed by the processor may further include at least one of the following steps: displaying resource configuration information recommended to the user in the graphical interface; and receiving resource configuration information set by the user through the graphical interface.
  • the steps executed by the processor may further include: after the setting is completed, verifying whether the current environment of the pre-launch prediction service meets the online requirements.
  • the steps performed by the processor may further include: in the case that the current environment meets the online requirements, verifying whether the prediction performance of the pre-launch prediction service is consistent with the prediction performance of the machine learning model in the offline environment; When the prediction performance of the online prediction service is consistent or substantially consistent with the prediction performance of the machine learning model in the offline environment, the pre-launch prediction service is converted to an online prediction service.
  • the step of verifying whether the prediction performance of the pre-launch prediction service is consistent with the prediction performance of the machine learning model in the offline environment may include: obtaining sample data and output fields specified by the user; and starting offline for simulating the offline operating environment
  • the estimation task and the simulation estimation task used to simulate the online operating environment respectively predict the sample data; compare whether the output result of the offline estimation task and the simulation estimation task for the output field is Unanimous.
  • the steps executed by the processor may further include: providing a service detail page to the user, the service detail page being used to display at least one of the following service information of the pre-launch prediction service: basic parameters, model parameters, consistency check results, Service status information.
  • the basic parameters may include at least one of the following: service name, service type, running status, deployment time, running time, and resource parameters.
  • the model parameters may include at least one of the following: model name, model type, model accuracy rate, and log loss value.
  • the consistency check result may include one or more pieces of prediction data, respectively, the prediction result in the online environment and the scoring result in the offline environment.
  • the service status information may include at least one of the following: performance indicators, log information, and running status monitoring information.
  • the steps performed by the processor may further include: providing a service address of the online prediction service to the user in the case of converting the pre-launch prediction service to an online prediction service.
  • the steps performed by the processor may further include: in the case of converting the pre-launch prediction service to an online prediction service, presenting the online prediction result of one or more pieces of prediction data to the user.
  • the steps performed by the processor may further include: receiving a user's modification of one or more field values in the prediction data; and displaying an online prediction result of the modified prediction data.
  • the computing device can be deployed in a server or a client, and can also be deployed on a node device in a distributed network environment.
  • the computing device may be a PC computer, a tablet device, a personal digital assistant, a smart phone, a web application, or other devices capable of executing the above set of instructions.
  • the computing device does not have to be a single computing device, and may also be any device or a collection of circuits that can execute the above-mentioned instructions (or instruction sets) individually or jointly.
  • the computing device may also be a part of an integrated control system or a system manager, or may be configured as a portable electronic device interconnected with a local or remote (e.g., via wireless transmission) interface.
  • the processor may include a central processing unit (CPU), a graphics processing unit (GPU), a programmable logic device, a dedicated processor system, a microcontroller, or a microprocessor.
  • the processor may also include an analog processor, a digital processor, a microprocessor, a multi-core processor, a processor array, a network processor, and the like.
  • Some operations described in the method for assisting machine learning model online can be implemented by software, some operations can be implemented by hardware, and in addition, it can also be implemented by a combination of software and hardware. Implement these operations.
  • the processor can run instructions or codes stored in one of the storage components, where the storage component can also store data. Instructions and data can also be sent and received via a network via a network interface device, wherein the network interface device can use any known transmission protocol.
  • the storage component can be integrated with the processor, for example, RAM or flash memory is arranged in an integrated circuit microprocessor or the like.
  • the storage component may include an independent device, such as an external disk drive, a storage array, or any other storage device that can be used by a database system.
  • the storage component and the processor may be operatively coupled, or may communicate with each other, for example, through an I/O port, a network connection, or the like, so that the processor can read files stored in the storage component.
  • the computing device may also include a video display (such as a liquid crystal display) and a user interaction interface (such as a keyboard, a mouse, a touch input device, etc.). All components of the computing device can be connected to each other via at least one of a bus and a network.
  • a video display such as a liquid crystal display
  • a user interaction interface such as a keyboard, a mouse, a touch input device, etc.
  • the device for assisting the online machine learning model may include a storage component and a processor, wherein the storage component stores a set of computer-executable instructions.
  • the method of assisting the online machine learning model mentioned above is executed.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Computing Systems (AREA)
  • Artificial Intelligence (AREA)
  • Evolutionary Computation (AREA)
  • Mathematical Physics (AREA)
  • Medical Informatics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Computational Linguistics (AREA)
  • Molecular Biology (AREA)
  • Health & Medical Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Biophysics (AREA)
  • Biomedical Technology (AREA)
  • Databases & Information Systems (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)
  • Stored Programmes (AREA)

Abstract

公开了一种辅助机器学习模型上线的方法及装置。获取线下训练机器学习模型得到的模型文件;对所述模型文件进行解析,确定模型训练过程使用的训练数据表;在线上数据库中创建与所述训练数据表的表信息一致的线上数据表;将至少部分线下数据导入所述线上数据表。由此,在将离线训练的机器学习模型部署到线上时,利用本公开可以实现线上数据冷启动,为模型上线提供支持。

Description

辅助机器学习模型上线的方法及装置
本公开要求申请日为2020年4月17日、申请号为202010307148.5、发明名称为“辅助机器学习模型上线的方法及装置”的中国专利申请的优先权。
技术领域
本公开总体说来涉及人工智能领域,更具体地说,涉及一种辅助机器学习模型上线的方法及装置。
背景技术
机器学习是人工智能研究发展到一定阶段的必然产物,其致力于通过计算的手段,利用经验来改善系统自身的性能。在计算机系统中,“经验”通常以“数据”形式存在,通过机器学习算法,可从数据中产生“模型”,也就是说,将经验数据提供给机器学习算法,就能基于这些经验数据产生模型,在面对新的情况时,模型会提供相应的判断,即,预测结果。
目前机器学习应用场景大多是离线场景,比如营销名单产出、事后行为追踪等。在离线场景中,用户实际发生行为的时间要提前于当前模型预估决策的时间,使得这一时间间隔内发生的行为变化将无法被感知,模型预估效果会产生损失。
而随着业务迭代和决策节奏的加快,市场对于数据的时效价值越发关注,将机器学习模型上线以对线上数据进行实时预测,也就显得尤为重要。
发明内容
本公开的示例性实施例旨在提供一种机器学习模型上线的辅助方案,以为机器学习模型的上线提供支持。
根据本公开的第一个方面,提出了一种辅助机器学习模型上线的方法,包括:获取线下训练机器学习模型得到的模型文件;对模型文件进行解析,确定模型训练过程使用的训练数据表;在线上数据库中创建与训练数据表的表信息一致的线上数据表;将至少部分线下数据导入线上数据表。
根据本公开的第二个方面,还提出了一种辅助机器学习模型上线的装置,包括:获取模块,用于获取线下训练机器学习模型得到的模型文件;第一确定模块,用于对模型文件进行解析,确定模型训练过程使用的训练数据表;创建模块,用于在线上数据库中创建与训练数据表的表信息一致的线上数据表;导入模块,用于将至少部分线下数据导入线上数据表。
根据本公开的第三个方面,还提出了一种包括至少一个计算装置和至少一个存储指令的存储装置的系统,其中,所述指令在被所述至少一个计算装置运行时,促使所述至少一个计算装置执行如本公开第一个方面所述的方法。
根据本公开的第四个方面,还提出了一种存储指令的计算机可读存储介质,其中,当所述指令被至少一个计算装置运行时,促使所述至少一个计算装置执行如本公开第一个方面所述的方法。
根据本公开的第五个方面,还提出了一种计算装置,包括处理器和存储器,所述存储器中存储有计算机可执行指令集合,当所述计算机可执行指令集合被所述处理器执行时,使所述处理器执行如下步骤:获取线下训练机器学习模型得到的模型文件;对所述模型文件进行解析,确定模型训练过程使用的训练数据表;在线上数据库中创建与所述训练数据表的表信息一致的线上数据表;将至少部分线下数据导入所述线上数据表。
在根据本公开示例性实施例的辅助机器学习模型上线的方法及装置中,通过解析模型文件,创建与训练数据表的表信息一致的线上数据表,并将一定时间范围的离线训练数据导入创建的线上数据表,可以实现线上数据冷启动,为模型上线提供支持。
附图说明
从下面结合附图对本公开实施例的详细描述中,本公开的这些方面和优点、其他方面和优点中的至少一个将变得更加清楚并更容易理解,其中:
图1示出了根据本公开示例性实施例的辅助机器学习模型上线的方法的流程图;
图2示出了一种模型训练过程的DAG(有向无环图);
图3示出了模型文件携带的部分信息示意图
图4示出了向用户展示的图形界面的示意图;
图5示出了向用户展示的服务详情页的示意图;
图6示出了一致性校验过程的示意图;
图7示出了模型上线流程示意性图;
图8示出了根据本公开示例性实施例的辅助机器学习模型上线的装置的结构框图。
具体实施方式
为了使本领域技术人员更好地理解本公开,下面结合附图和具体实施方式对本公开的示例性实施例作进一步详细说明。
图1示出了根据本公开示例性实施例的辅助机器学习模型上线的方法的流程图。图1所示的方法可完全通过计算机程序以软件方式实现,还可通过特定配置的计算装置来执行图1所示的方法。
参见图1,在步骤S110,获取线下训练机器学习模型得到的模型文件。
线下训练机器学习模型得到的模型文件,也即在离线环境中进行模型训练所得到的模型文件。机器学习模型的训练过程不是本公开的侧重点,不再赘述。模型文件中可以包括但不限于模型结构信息、训练过程配置信息等与模型训练相关的信息。
在步骤S120,对模型文件进行解析,确定模型训练过程使用的训练数据表。训练数据表是指模型训练过程中的特征处理步骤所对应的输入表,也即特征处理前的输入表。一般来说,在进行特征处理前会对原始的数据表执行预处理操作,以使得经过预处理后的数据表为符合训练需求的数据表。其中,训练数据表就是指经过预处理后的用于进行特征处理的输入表。
可以通过对模型文件进行解析,得到模型训练过程信息,并根据模型训练过程信息,将特征处理步骤对应的输入表作为模型训练过程使用的训练数据表。模型训练过程信息可以包括但不限于模型训练过程中的处理节点、处理节点对应的输入表、处理节点对应的输出表中的一项或多项。其中,处理节点可以视为模型训练过程中某个特定的机器学习步骤,处理节点处还可以包括对应的处理方法,处理方法可以是但不限于处理脚本或算子。
作为示例,模型文件中可以包括特征处理脚本(如特征构建脚本)。特征处理脚本可以是基于特定描述语言编写的。本公开可以通过对特征处理脚本进行解析,确定训练数据表。关于特征处理脚本的具体结构本公开不做限定。
图2示出了一种模型训练过程的DAG(有向无环图)。如图2所示,DAG包括数据表A、数据表B、数据预处理、特征处理、特征签名、模型训练。其中,数据表A并不直接进行特征处理,而是需要经过数据预处理,因此数据表A不满足训练数据表的定义。
作为示例,按照图2所示的DAG进行训练最终产出的模型文件可以携带图3所示的信息。本公开可以通过对模型文件进行解析,获取图3所示信息。其中图3所示的信息展示了算子节点(即上文述及的处理节点)之间的关系、算子节点的输入表、算子节点的输 出表、特征处理脚本等内容。本公开可以根据上述内容从中筛选出特征处理前的输入表(即训练数据表),例如可以将对数据表A进行预处理后得到的输入表以及数据表B作为训练数据表,并获取训练数据表的组织结构(schema)以及表名等表信息。在本实施例中,模型文件可以是基于编程语言的脚本文件,可以通过对脚本文件形式的模型文件进行筛选,得到图3所示的基于编程语言的信息,即图3所示的信息可以是取自模型文件的部分脚本。其中,图3中的“nodes”用于表征算子节点,“script”用于表示特征处理脚本,“inutTables”用于表示输入表,“outputTables”用于表示输出表。“uuid”、“cols”用于表示数据表结构及表名信息,如可以包括但不限于表名、表中字段名、字段类型等等。
在步骤S130,在线上数据库中创建与训练数据表的表信息一致的线上数据表。表信息可以是指训练数据表的组织结构(schema)以及表名等信息,如可以包括但不限于训练数据表中的字段名、字段类型等信息。在创建好线上数据表后,线上实时生成的数据(也即线上数据)就可以导入线上数据表。
线上数据库是指用于存储线上数据的数据库。线上数据库可以采用KV存储数据库(比如Redis或其他实时特征存储引擎RtiDB等),以保证读写高性能、数据高可用等要求。并且在线上数据库中存储数据时需要结合特征构建的逻辑设置合理的key键值,比如特征构建的时候采用以name字段为key进行特征计算,那么创建线上数据表的时候需要设置name为存储key键值。
为此本公开还可以根据对模型文件进行解析时所确定的特征处理步骤涉及的字段名,在线上数据库中以字段名为键存储线上数据表中的数据,以确保线上数据读写高性能。即,对模型文件进行解析所确定的特征处理步骤还可以包括字段名和针对字段名的特征处理方法,本公开可以根据特征处理步骤涉及的字段名,在线上数据库中以字段名为键存储线上数据表中的数据。
在步骤S140,将至少部分线下数据导入线上数据表。
考虑到线上数据存在冷启动,即初始时刻线上数据表中可能没有足够用于进行模型预测的线上数据。在创建好线上数据表后,还可以将至少部分线下数据导入线上数据表,以解决数据冷启动问题。
考虑到线上数据库往往会采用内存存储的方式,若存储过多的数据会消耗机器资源以及线上性能。本公开还可以通过对模型文件进行解析,确定特征处理步骤针对的数据范围,并将对应于所确定的数据范围的线下数据导入线上数据表。例如,特征构建最大的时间区间是30天,那么只需要保证将数据范围为30天的线下数据导入线上数据表。由此在解决数据冷启动问题的同时,可以降低线上数据库的存储压力,降低资源成本。在一个实施例中,可以支持用户自定义导入数据,提供一定的灵活性以切合实际场景。
本公开通过解析模型文件,创建与训练数据表的表信息一致的线上数据表,并将一定时间范围的离线训练数据导入创建的线上数据表,可以实现线上数据冷启动,为模型上线提供支持。并且对于用户而言,只需要启动线上数据创建流程,选择期望上线的模型文件,后续可以由系统自动解析模型文件,创建相关线上数据表后自动将离线数据导入其中,从而可以减少用户手动创表、导表失败的情况发生。
在创建好线上数据表后,还可以部署用于实现机器学习模型的预测功能(也即线上预测功能)的预上线预测服务。并且在将预上线预测服务上线前,还可以对预上线预测服务的预测效果进行一致性校验,以确保预上线预测服务的可靠性。其中,一致性校验是指对预上线预测服务的线上预测结果与线下环境中的线下预测结果的一致性进行校验。
作为示例,可以利用预上线预测服务对待预测数据进行预测得到第一预测结果;在线下环境中对待预测数据进行预测得到第二预测结果;比较第一预测结果和第二预测结果;根据第一预测结果和第二预测结果之间的差异,确定是否上线预上线预测服务。若第一预测结果和第二预测结果之间的差异大于第一阈值,表明预上线预测服务的在线预测效果较差,可以对预上线预测服务进行修正,在修正后再次进行一致性校验;若第一预测结果和 第二预测结果之间的差异小于第二阈值,表明预上线预测服务的线上预测效果与线下预测效果一致,可以将预上线预测服务部署到线上。其中,第一阈值大于等于第二阈值。待预测数据可以是用户指定的样例数据,也可以是线上数据库中的数据,还可以是其他来源的数据,对此本公开不做限定。
在线下环境中对待预测数据进行预测,也即利用线下训练得到的机器学习模型在线下环境中对待预测数据进行预测。作为示例,可以通过对模型文件进行解析,确定下游执行算子和模型预测算子,下游执行算子用于表征待预测数据在模型预测之前需要执行的操作;将待预测数据输入下游执行算子;将下游执行算子的输出输入模型预测算子,模型预测算子的输出即为对待预测数据进行预测得到的第二预测结果。
将机器学习模型应用于线上预测,可以处理实时请求数据,提高模型预估效果,但模型上线成本较高,在实际运用过程中需要较多定制化开发。本公开提出的辅助机器学习模型上线的方法,可以实现线上数据冷启动、模型上线评估校验,为机器学习模型的上线提供支持。
本公开的辅助机器学习模型上线的方法可以由用于实现机器学习相关业务的机器学习平台执行。机器学习平台可以通过可视化的方式为用户提供模型上线服务。例如,可以由机器学习平台向用户提供用于设置线上预测服务的图形界面,并接收用户通过图形界面选择的预上线预测服务。其中,机器学习平台可以向用户提供多个可供选择的预上线预测服务,每个预上线预测服务具有对应的模型文件,模型文件可以存储在后台服务端,可以根据用户选择的预上线预测服务,获取服务器端存储的与预上线预测服务对应的模型文件。另外用户也可以在选择预上线预测服务时,向机器学习平台上传模型文件。机器学习平台可以基于模型文件,通过执行上文结合图1所示的方法,实现线上数据冷启动、模型上线评估校验,为机器学习模型的上线提供支持。
图4示出了向用户展示的图形界面的示意图。
图4中示出的预上线应用即为上文述及的预上线预测服务。如图4所示,可以在图形界面中展示模型效果;也可以在图形界面中展示创建好的线上数据表(即图中示出的线上动态表)。其中,模型效果可以包括但不限于准确率、损失函数等模型评价指标。
可以向用户提供是否模拟上线的选项,用户可以根据需求选择是否模拟上线。若选择直接上线,也需要模块配置并进行环境校验,但不会做后续的一致性校验,如此将难以确保线上预测效果的可靠性,若出现不一致问题,反向定位成本高,因此建议用户选择模拟上线。此外用户在部署服务过程中,可以查看所含模型效果、对应线上数据表的存在情况,以辅助用户判断是否需要进行模拟上线应用部署(比如效果差、线上数据表异常,用户可以取消部署,避免资源浪费)。
还可以执行如下操作中的至少一个:在图形界面中展示向用户推荐的资源配置信息;接收用户通过图形界面设置的资源配置信息。例如,可以为用户提供“启用系统推荐”和“自定义资源参数”两个选择项,当用户选中“启用系统推荐”时,可以使用系统推荐的资源配置,当用户选中“自定义资源参数”时,可以接收用户输入的资源配置。
在设置完成后,可以启动环境校验,校验预上线预测服务的当前环境是否满足上线要求。此处述及的校验可以包括但不限于校验线上数据库是否可用、线上数据是否冷启动等。
若当前环境不满足上线要求,可以定位并修正问题。
若当前环境满足上线要求,可以完成预上线预测服务的部署,并向用户提供服务详情页。服务详情页可以用于展示预上线预测服务的以下至少一项服务信息:基本参数、模型参数、一致性校验结果、服务状态信息。其中,基本参数可以包括但不限于以下至少一项:服务名称、服务类型、运行状态、部署时间、运行时间、资源参数;模型参数可以包括但不限于以下至少一项:模型名称、模型类型、模型准确率、对数损失值;一致性校验结果可以包括但不限于一条或多条预测数据分别在线上环境中的预测结果和线下环境中的打分结果;服务状态信息可以包括但不限于以下至少一项:性能指标、日志信息和运行状态 监控信息。
图5示出了向用户展示的服务详情页的示意图。
如图5所示,服务详情页面中可以呈现当前服务的基本参数、模块参数(包括所含模型、线上数据库)、一致性校验、服务状态(包括性能指标、日志和资源)等。其中,一致性校验是指进一步校验预上线预测服务的预测性能与线下环境中机器学习模型的预测性能是否一致;在预上线预测服务的预测性能与线下环境中机器学习模型的预测性能一致或基本一致的情况下,可以将预上线预测服务转为线上预测服务。
校验预上线预测服务的预测性能与线下环境中机器学习模型的预测性能是否一致的实现过程可以参见上文相关描述。作为示例,可以将模型自带样例数据作为待预测数据,也可以获取用户上传的样例数据,将用户指定的样例数据作为待预测数据。其中,用户还可以指定输出字段。然后可以启动用于模拟线下运行环境的离线预估任务和用于模拟线上运行环境的模拟预估任务,分别对样例数据进行预测。最后可以比较离线预估任务和模拟预估任务针对输出字段的输出结果是否一致。
图6示出了一致性校验过程的示意图。
如图6所示,可以在页面中呈现针对输出字段的离线预估结果和模拟预估结果。其中,离线预估服务和模拟预估服务的结果均会通过表格的方式呈现,用户可以点击“结果一致性校验”按钮对比两者结果,并呈现不一致的结果,也可以通过人工逐条对比,若结果满足用户期望(完全相同或者存在可容忍的偏差),表明该预上线预测服务满足上线要求,可以部署到线上。
在将预上线预测服务转为线上预测服务的情况下,本公开还可以执行如下步骤中的至少一个:向用户提供线上预测服务的服务地址(如API服务地址);向用户展示一条或多条预测数据的线上预测结果。其中,在向用户展示一条或多条预测数据的线上预测结果的情况下,还可以接收用户对预测数据中一个或多个字段值的修改,并展示修改后的预测数据的线上预测结果。其中,预测数据可以是线上实时生成的数据。
综上,本公开可以实现为一套模型上线流程,包括线上数据冷启动、模拟上线及应用上线,整个流程中可以通过可视化页面进行引导,降低用户操作成本。模拟上线是指在应用上线前进行环境校验及一致性校验,当满足系统约定的校验条件后,该应用支持直接部署上线。环境校验包括校验线上数据库是否可用、线上数据是否冷启动等,一致性校验则包括获取样例数据、针对样例数据进行离线预估打分、针对样例数据进行模拟预估打分、校验打分结果是否一致。
图7示出了模型上线流程示意性图。其中,线上数据冷启动和模拟上线作为本公开的要点已在上文做了详细描述,其他相关模块作为默认的组件能力不做详细描述。
如图7所示,用户可以在离线环境下进行模型训练,产出模型文件。当用户需要针对当前训练的模型部署实时应用上线时,可以进入应用管理页面创建实时预估应用模板,并选择当前训练的模型信息,应用模板会自动解析模型文件,获取模型训练过程中需要的数据表信息和特征构建脚本。
可以由页面引导用户根据解析结果进行线上数据冷启动,包括数据表创建和导数,相关流程会在数据管理页面统一进行。接着,用户需要配置补充补充信息,比如资源信息、日志信息等,然后将实时预估应用模块打包成预上线应用,并进入模拟上线流程。在模拟上线流程中,系统会自动校验当前环境是否满足上线要求,包括线上数据库是否可用、线上数据是否冷启动,然后用户可以自定义样例数据或选择系统提供的样例数据,分别进行离线模型的预估打分和预上线模型的模拟打分,通过对比两者数据是否一致来判定当前预上线应用是否满足上线要求,若满足用户可以直接进行上线,产生上线应用并提供外部可调用的API,从而完成全流程。关于模型上线流程的实现细节可以参见上文相关描述,此处不再赘述。
需要说明的是,本公开实施例中的所述的机器学习模型(如神经网络模型)可被用 于预测图像类别、文本类别、语音情感、欺诈交易、广告点击率等。所述机器学习模型(如神经网络模型)旨在针对相关场景中的对象或事件有关的问题进行预测。例如,可用于预测图像类别、预测图像中文字、预测文本类别、预测语音情感类别、预测欺诈交易、预测广告点击率、预测商品价格等等,使得预测结果可直接作为决策依据或进一步结合其他规则而成为决策依据。
更进一步来说,本公开实施例中的机器学习模型(如神经网络模型)可被用于的场景包括但不限于以下场景:
图像处理场景,包括:光学字符识别OCR、人脸识别、物体识别和图片分类;更具体地举例来说,OCR可应用于票据(如发票)识别、手写字识别等,人脸识别可应用安防等领域,物体识别可应用于自动驾驶场景中的交通标志识别,图片分类可应用于电商平台的“拍照购”、“找同款”等。
语音识别场景,包括可通过语音进行人机交互的产品,如手机的语音助手(如苹果手机的Siri)、智能音箱等;
自然语言处理场景,包括:审查文本(如合同、法律文书和客服记录等)、垃圾内容识别(如垃圾短信识别)和文本分类(情感、意图和主题等);
自动控制场景,包括:矿井组调节操作预测、风力发电机组调节操作预测和空调系统调节操作预测;具体的对于矿井组可预测开采率高的一组调节操作,对于风力发电机组可预测发电效率高的一组调节操作,对于空调系统,可以预测满足需求的同时节省能耗的一组调节操作;
智能问答场景,包括:聊天机器人和智能客服;
业务决策场景,包括:金融科技领域、医疗领域和市政领域的场景,其中:
金融科技领域包括:营销(如优惠券使用预测、广告点击行为预测、用户画像挖掘等)与获客、反欺诈、反洗钱、承保和信用评分、商品价格预测;
医疗领域包括:疾病筛查和预防、个性化健康管理和辅助诊断;
市政领域包括:社会治理与监管执法、资源环境和设施管理、产业发展和经济分析、公众服务和民生保障、智慧城市(公交、网约车、共享单车等各类城市资源的调配和管理);
推荐业务场景,包括:新闻、广告、音乐、咨询、视频和金融产品(如理财、保险等)的推荐;
搜索场景,包括:网页搜索、图像搜索、文本搜索、视频搜索等;
异常行为检测场景,包括:国家电网客户用电异常行为检测、网络恶意流量检测、操作日志中的异常行为检测等。
本公开的辅助机器学习模型上线的方法,还可以实现为一种用于创建机器学习方案模板的装置。图8示出了根据本公开示例性实施例的辅助机器学习模型上线的装置的结构框图。其中,辅助机器学习模型上线的装置的功能单元可以由实现本公开原理的硬件、软件或硬件和软件的结合来实现。本领域技术人员可以理解的是,图8所描述的功能单元可以组合起来或者划分成子单元,从而实现上述公开的原理。因此,本文的描述可以支持对本文描述的功能单元的任何可能的组合、或者划分、或者更进一步的限定。
下面就辅助机器学习模型上线的装置可以具有的功能单元以及各功能单元可以执行的操作做简要说明,对于其中涉及的细节部分可以参见上文相关描述,这里不再赘述。
参见图8,辅助机器学习模型上线的装置800包括获取模块810、第一确定模块820、创建模块830以及导入模块840。
获取模块810被配置为获取线下训练机器学习模型得到的模型文件。
第一确定模块820被配置为对模型文件进行解析,确定模型训练过程使用的训练数据表。作为示例,第一确定模块80可以通过对模型文件进行解析,得到模型训练过程信息,并根据模型训练过程信息,将特征处理步骤对应的输入表作为模型训练过程使用的训 练数据表。模型训练过程信息可以包括但不限于以下至少一项:模型训练过程中的处理节点、处理节点对应的输入表、处理节点对应的输出表。
特征处理步骤包括字段名和针对字段名的特征处理方法,辅助机器学习模型上线的装置800还可以包括存储模块,被配置为根据特征处理步骤涉及的字段名,在线上数据库中以字段名为键存储线上数据表中的数据。
创建模块830被配置为在线上数据库中创建与训练数据表的表信息一致的线上数据表。
导入模块840被配置为将至少部分线下数据导入线上数据表。作为示例,辅助机器学习模型上线的装置800还可以包括第二确定模块,被配置为通过对模型文件进行解析,确定特征处理步骤针对的数据范围,导入模块840可以将对应于数据范围的线下数据导入线上数据表。
辅助机器学习模型上线的装置800还可以包括部署模块、第一预测模块、第二预测模块以及第一上线模块。部署模块被配置为部署用于实现机器学习模型的预测功能的预上线预测服务;第一预测模块被配置为利用预上线预测服务对待预测数据进行预测得到第一预测结果;第二预测模块被配置为在线下环境中对待预测数据进行预测得到第二预测结果;比较模块被配置为比较第一预测结果和第二预测结果;第一上线模块被配置为根据第一预测结果和第二预测结果之间的差异,确定是否上线预上线预测服务。
第二预测模块可以通过对模型文件进行解析,确定下游执行算子和模型预测算子,下游执行算子用于表征待预测数据在模型预测之前需要执行的操作;将待预测数据输入下游执行算子;将下游执行算子的输出输入模型预测算子,模型预测算子的输出即为对待预测数据进行预测得到的第二预测结果。
作为示例,辅助机器学习模型上线的装置800还可以包括呈现模块和接收模块。呈现模块被配置为向用户提供用于设置线上预测服务的图形界面;接收模块被配置为接收用户通过图形界面选择的预上线预测服务;其中,获取模块810可以执行如下操作中的至少一个:获取服务器端存储的与预上线预测服务对应的模型文件;接收用户上传的模型文件。
在一个实施例中,呈现模块还可以被配置为执行如下操作中的至少一个:在图形界面中展示模型效果;在图形界面中展示线上数据表。
在一个实施例中,呈现模块还可以在图形界面中展示向用户推荐的资源配置信息。
在一个实施例中,接收模块还可以接收用户通过图形界面设置的资源配置信息。
辅助机器学习模型上线的装置800还可以包括第一校验模块,被配置为在预上线预测服务设置完成后,校验预上线预测服务的当前环境是否满足上线要求。
辅助机器学习模型上线的装置800还可以包括第二校验模块和第二上线模块。第二校验模块被配置为在当前环境满足上线要求的情况下,校验预上线预测服务的预测性能与线下环境中机器学习模型的预测性能是否一致;第二上线模块被配置为在预上线预测服务的预测性能与线下环境中机器学习模型的预测性能一致或基本一致的情况下,将预上线预测服务转为线上预测服务。
作为示例,第二校验模块可以被配置为:获取用户指定的样例数据以及输出字段;启动用于模拟线下运行环境的离线预估任务和用于模拟线上运行环境的模拟预估任务,分别对样例数据进行预测;比较离线预估任务和模拟预估任务针对输出字段的输出结果是否一致。
呈现模块还向用户提供服务详情页,服务详情页用于展示预上线预测服务的以下至少一项服务信息:基本参数、模型参数、一致性校验结果、服务状态信息。关于各项服务信息的具体内容可以参见上文相关描述。
作为示例,辅助机器学习模型上线的装置800还可以包括提供模块。提供模块被配置为在将预上线预测服务转为线上预测服务的情况下执行如下操作中的至少一个:向用户提供线上预测服务的服务地址;向用户展示一条或多条预测数据的线上预测结果。其中, 接收模块还可以接收用户对预测数据中一个或多个字段值的修改;呈现模块还可以展示修改后的预测数据的线上预测结果。
应该理解,根据本公开示例性实施例的辅助机器学习模型上线的装置800的具体实现方式可参照上文结合图1至图7针对辅助机器学习模型上线的方法的相关描述来实现,在此不再赘述。
以上参照图1到图8描述了根据本公开示例性实施例的辅助机器学习模型上线的方法及装置。应理解,上述方法可通过记录在计算可读介质上的程序来实现,例如,根据本公开的示例性实施例,可提供一种存储指令的计算机可读存储介质,其中,在所述计算机可读存储介质上记录有用于执行本公开的辅助机器学习模型上线的方法(例如图1所示)的计算机程序。
上述计算机可读存储介质中的计算机程序可在诸如客户端、主机、代理装置、服务器等计算机设备中部署的环境中运行,应注意,所述计算机程序除了可用于执行除了图1示出的步骤之外,还可用于执行除了上述步骤以外的附加步骤或者在执行上述步骤时执行更为具体的处理,这些附加步骤和进一步处理的内容已经参照图1进行了描述,这里为了避免重复将不再进行赘述。
应注意,根据本公开示例性实施例的辅助机器学习模型上线的装置,可完全依赖计算机程序的运行来实现相应的功能,即,各个装置与计算机程序的功能架构中与各步骤相应,使得整个装置通过专门的软件包(例如,lib库)而被调用,以实现相应的功能。
另一方面,图8所示的各个装置也可以通过硬件、软件、固件、中间件、微代码或其任意组合来实现。当以软件、固件、中间件或微代码实现时,用于执行相应操作的程序代码或者代码段可以存储在诸如存储介质的计算机可读存储介质中,使得处理器可通过读取并运行相应的程序代码或者代码段来执行相应的操作。
例如,本公开的示例性实施例还可以实现为计算装置,该计算装置包括存储部件和处理器,存储部件中存储有计算机可执行指令集合,当所述计算机可执行指令集合被所述处理器执行时,执行辅助机器学习模型上线的方法。
存储部件也即存储器。使处理器执行上文述及的辅助机器学习模型上线的方法,也即使处理器执行如下步骤:获取线下训练机器学习模型得到的模型文件;对所述模型文件进行解析,确定模型训练过程使用的训练数据表;在线上数据库中创建与所述训练数据表的表信息一致的线上数据表;将至少部分线下数据导入所述线上数据表。
确定模型训练过程使用的训练数据表的步骤可以包括:通过对所述模型文件进行解析,得到模型训练过程信息;根据所述模型训练过程信息,将特征处理步骤对应的输入表作为模型训练过程使用的训练数据表。
所述模型训练过程信息可以包括以下至少一项:模型训练过程中的处理节点、所述处理节点对应的输入表、所述处理节点对应的输出表。
所述特征处理步骤可以包括字段名和针对所述字段名的特征处理方法,使处理器执行的步骤还可以包括以下步骤:根据所述特征处理步骤涉及的字段名,在线上数据库中以所述字段名为键存储所述线上数据表中的数据。
处理器执行的步骤还可以包括如下步骤:通过对所述模型文件进行解析,确定特征处理步骤针对的数据范围,其中,将至少部分线下数据导入所述线上数据表的步骤可以包括:将对应于所述数据范围的线下数据导入所述线上数据表。
处理器执行的步骤还可以包括如下步骤:部署用于实现所述机器学习模型的预测功能的预上线预测服务;利用所述预上线预测服务对待预测数据进行预测得到第一预测结果;在线下环境中对所述待预测数据进行预测得到第二预测结果;比较所述第一预测结果和所述第二预测结果;根据所述第一预测结果和所述第二预测结果之间的差异,确定是否上线所述预上线预测服务。
在线下环境中对所述待预测数据进行预测得到第二预测结果的步骤可以包括:通过 对所述模型文件进行解析,确定下游执行算子和模型预测算子,所述下游执行算子用于表征所述待预测数据在模型预测之前需要执行的操作;将所述待预测数据输入所述下游执行算子;将所述下游执行算子的输出输入所述模型预测算子,所述模型预测算子的输出即为对所述待预测数据进行预测得到的第二预测结果。
处理器执行的步骤还可以包括:向用户提供用于设置线上预测服务的图形界面;接收用户通过所述图形界面选择的预上线预测服务;其中,获取线下训练机器学习模型得到的模型文件的步骤包括如下步骤中的至少一个:获取服务器端存储的与所述预上线预测服务对应的模型文件;接收用户上传的模型文件。
处理器执行的步骤还可以包括如下步骤中的至少一个:在所述图形界面中展示模型效果;在所述图形界面中展示所述线上数据表。
处理器执行的步骤还可以包括如下步骤中的至少一个:在所述图形界面中展示向用户推荐的资源配置信息;接收用户通过所述图形界面设置的资源配置信息。
处理器执行的步骤还可以包括:在设置完成后,校验所述预上线预测服务的当前环境是否满足上线要求。
处理器执行的步骤还可以包括:在所述当前环境满足上线要求的情况下,校验所述预上线预测服务的预测性能与线下环境中机器学习模型的预测性能是否一致;在所述预上线预测服务的预测性能与线下环境中机器学习模型的预测性能一致或基本一致的情况下,将所述预上线预测服务转为线上预测服务。
校验所述预上线预测服务的预测性能与线下环境中机器学习模型的预测性能是否一致的步骤可以包括:获取用户指定的样例数据以及输出字段;启动用于模拟线下运行环境的离线预估任务和用于模拟线上运行环境的模拟预估任务,分别对所述样例数据进行预测;比较所述离线预估任务和所述模拟预估任务针对所述输出字段的输出结果是否一致。
处理器执行的步骤还可以包括:向用户提供服务详情页,所述服务详情页用于展示所述预上线预测服务的以下至少一项服务信息:基本参数、模型参数、一致性校验结果、服务状态信息。
所述基本参数可以包括以下至少一项:服务名称、服务类型、运行状态、部署时间、运行时间、资源参数。
所述模型参数可以包括以下至少一项:模型名称、模型类型、模型准确率、对数损失值。
所述一致性校验结果可以包括一条或多条预测数据分别在线上环境中的预测结果和线下环境中的打分结果。
所述服务状态信息可以包括以下至少一项:性能指标、日志信息和运行状态监控信息。
处理器执行的步骤还可以包括:在将所述预上线预测服务转为线上预测服务的情况下,向用户提供线上预测服务的服务地址。
处理器执行的步骤还可以包括:在将所述预上线预测服务转为线上预测服务的情况下,向用户展示一条或多条预测数据的线上预测结果。
处理器执行的步骤还可以包括:接收用户对所述预测数据中一个或多个字段值的修改;以及展示修改后的预测数据的线上预测结果。
具体说来,所述计算装置可以部署在服务器或客户端中,也可以部署在分布式网络环境中的节点装置上。此外,所述计算装置可以是PC计算机、平板装置、个人数字助理、智能手机、web应用或其他能够执行上述指令集合的装置。
这里,所述计算装置并非必须是单个的计算装置,还可以是任何能够单独或联合执行上述指令(或指令集)的装置或电路的集合体。计算装置还可以是集成控制系统或系统管理器的一部分,或者可被配置为与本地或远程(例如,经由无线传输)以接口互联的便携式电子装置。
在所述计算装置中,处理器可包括中央处理器(CPU)、图形处理器(GPU)、可编程逻辑装置、专用处理器系统、微控制器或微处理器。作为示例而非限制,处理器还可包括模拟处理器、数字处理器、微处理器、多核处理器、处理器阵列、网络处理器等。
根据本公开示例性实施例的辅助机器学习模型上线的方法中所描述的某些操作可通过软件方式来实现,某些操作可通过硬件方式来实现,此外,还可通过软硬件结合的方式来实现这些操作。
处理器可运行存储在存储部件之一中的指令或代码,其中,所述存储部件还可以存储数据。指令和数据还可经由网络接口装置而通过网络被发送和接收,其中,所述网络接口装置可采用任何已知的传输协议。
存储部件可与处理器集成为一体,例如,将RAM或闪存布置在集成电路微处理器等之内。此外,存储部件可包括独立的装置,诸如,外部盘驱动、存储阵列或任何数据库系统可使用的其他存储装置。存储部件和处理器可在操作上进行耦合,或者可例如通过I/O端口、网络连接等互相通信,使得处理器能够读取存储在存储部件中的文件。
此外,所述计算装置还可包括视频显示器(诸如,液晶显示器)和用户交互接口(诸如,键盘、鼠标、触摸输入装置等)。计算装置的所有组件可经由总线、网络中的至少一个而彼此连接。
根据本公开示例性实施例的辅助机器学习模型上线的方法所涉及的操作可被描述为各种互联或耦合的功能块或功能示图。然而,这些功能块或功能示图可被均等地集成为单个的逻辑装置或按照非确切的边界进行操作。
例如,如上所述,根据本公开示例性实施例的辅助机器学习模型上线的的装置可包括存储部件和处理器,其中,存储部件中存储有计算机可执行指令集合,当所述计算机可执行指令集合被所述处理器执行时,执行上文述及的辅助机器学习模型上线的方法。
以上描述了本公开的各示例性实施例,应理解,上述描述仅是示例性的,并非穷尽性的,本公开不限于所披露的各示例性实施例。在不偏离本公开的范围和精神的情况下,对于本技术领域的普通技术人员来说许多修改和变更都是显而易见的。因此,本公开的保护范围应该以权利要求的范围为准。

Claims (65)

  1. 一种辅助机器学习模型上线的方法,包括:
    获取线下训练机器学习模型得到的模型文件;
    对所述模型文件进行解析,确定模型训练过程使用的训练数据表;
    在线上数据库中创建与所述训练数据表的表信息一致的线上数据表;
    将至少部分线下数据导入所述线上数据表。
  2. 根据权利要求1所述的方法,其中,确定模型训练过程使用的训练数据表的步骤包括:
    通过对所述模型文件进行解析,得到模型训练过程信息;
    根据所述模型训练过程信息,将特征处理步骤对应的输入表作为模型训练过程使用的训练数据表。
  3. 根据权利要求2所述的方法,其中,所述模型训练过程信息包括以下至少一项:模型训练过程中的处理节点、所述处理节点对应的输入表、所述处理节点对应的输出表。
  4. 根据权利要求2所述的方法,其中,所述特征处理步骤包括字段名和针对所述字段名的特征处理方法,该方法还包括:
    根据所述特征处理步骤涉及的字段名,在线上数据库中以所述字段名为键存储所述线上数据表中的数据。
  5. 根据权利要求1所述的方法,还包括:
    通过对所述模型文件进行解析,确定特征处理步骤针对的数据范围,
    其中,将至少部分线下数据导入所述线上数据表的步骤包括:将对应于所述数据范围的线下数据导入所述线上数据表。
  6. 根据权利要求1所述的方法,还包括:
    部署用于实现所述机器学习模型的预测功能的预上线预测服务;
    利用所述预上线预测服务对待预测数据进行预测得到第一预测结果;
    在线下环境中对所述待预测数据进行预测得到第二预测结果;
    比较所述第一预测结果和所述第二预测结果;
    根据所述第一预测结果和所述第二预测结果之间的差异,确定是否上线所述预上线预测服务。
  7. 根据权利要求6所述的方法,其中,在线下环境中对所述待预测数据进行预测得到第二预测结果的步骤包括:
    通过对所述模型文件进行解析,确定下游执行算子和模型预测算子,所述下游执行算子用于表征所述待预测数据在模型预测之前需要执行的操作;
    将所述待预测数据输入所述下游执行算子;
    将所述下游执行算子的输出输入所述模型预测算子,所述模型预测算子的输出即为对所述待预测数据进行预测得到的第二预测结果。
  8. 根据权利要求1所述的方法,还包括:
    向用户提供用于设置线上预测服务的图形界面;
    接收用户通过所述图形界面选择的预上线预测服务;
    其中,获取线下训练机器学习模型得到的模型文件的步骤包括如下步骤中的至少一个:获取服务器端存储的与所述预上线预测服务对应的模型文件;接收用户上传的模型文件。
  9. 根据权利要求8所述的方法,还包括如下步骤中的至少一个:
    在所述图形界面中展示模型效果;
    在所述图形界面中展示所述线上数据表。
  10. 根据权利要求8所述的方法,还包括如下步骤中的至少一个:
    在所述图形界面中展示向用户推荐的资源配置信息;
    接收用户通过所述图形界面设置的资源配置信息。
  11. 根据权利要求8所述的方法,还包括:
    在设置完成后,校验所述预上线预测服务的当前环境是否满足上线要求。
  12. 根据权利要求11所述的方法,还包括:
    在所述当前环境满足上线要求的情况下,校验所述预上线预测服务的预测性能与线下环境中机器学习模型的预测性能是否一致;
    在所述预上线预测服务的预测性能与线下环境中机器学习模型的预测性能一致或基本一致的情况下,将所述预上线预测服务转为线上预测服务。
  13. 根据权利要求12所述的方法,其中,校验所述预上线预测服务的预测性能与线下环境中机器学习模型的预测性能是否一致的步骤包括:
    获取用户指定的样例数据以及输出字段;
    启动用于模拟线下运行环境的离线预估任务和用于模拟线上运行环境的模拟预估任务,分别对所述样例数据进行预测;
    比较所述离线预估任务和所述模拟预估任务针对所述输出字段的输出结果是否一致。
  14. 根据权利要求12所述的方法,还包括:
    向用户提供服务详情页,所述服务详情页用于展示所述预上线预测服务的以下至少一项服务信息:基本参数、模型参数、一致性校验结果、服务状态信息。
  15. 根据权利要求14所述的方法,其中,
    所述基本参数包括以下至少一项:服务名称、服务类型、运行状态、部署时间、运行时间、资源参数。
  16. 根据权利要求14所述的方法,其中,
    所述模型参数包括以下至少一项:模型名称、模型类型、模型准确率、对数损失值。
  17. 根据权利要求14所述的方法,其中,
    所述一致性校验结果包括一条或多条预测数据分别在线上环境中的预测结果和线下环境中的打分结果。
  18. 根据权利要求14所述的方法,其中,
    所述服务状态信息包括以下至少一项:性能指标、日志信息和运行状态监控信息。
  19. 根据权利要求12所述的方法,还包括:
    在将所述预上线预测服务转为线上预测服务的情况下,向用户提供线上预测服务的服务地址。
  20. 根据权利要求12所述的方法,还包括:
    在将所述预上线预测服务转为线上预测服务的情况下,向用户展示一条或多条预测数据的线上预测结果。
  21. 根据权利要求19所述的方法,还包括:
    接收用户对所述预测数据中一个或多个字段值的修改;以及
    展示修改后的预测数据的线上预测结果。
  22. 一种辅助机器学习模型上线的装置,包括:
    获取模块,被配置为获取线下训练机器学习模型得到的模型文件;
    第一确定模块,被配置为对所述模型文件进行解析,确定模型训练过程使用的训练数据表;
    创建模块,被配置为在线上数据库中创建与所述训练数据表的表信息一致的线上数据表;
    导入模块,被配置为将至少部分线下数据导入所述线上数据表。
  23. 根据权利要求22所述的装置,其中,所述第一确定模块被配置为:
    通过对所述模型文件进行解析,得到模型训练过程信息;
    根据所述模型训练过程信息,将特征处理步骤对应的输入表作为模型训练过程使用的训练数据表。
  24. 根据权利要求23所述的装置,其中,所述模型训练过程信息包括以下至少一项:模型训练过程中的处理节点、所述处理节点对应的输入表、所述处理节点对应的输出表。
  25. 根据权利要求23所述的装置,其中,所述特征处理步骤包括字段名和针对所述字段名的特征处理方法,该装置还包括:
    存储模块,被配置为根据所述特征处理步骤涉及的字段名,在线上数据库中以所述字段名为键存储所述线上数据表中的数据。
  26. 根据权利要求22所述的装置,还包括:
    第二确定模块,被配置为通过对所述模型文件进行解析,确定特征处理步骤针对的数据范围,
    其中,所述导入模块将对应于所述数据范围的线下数据导入所述线上数据表。
  27. 根据权利要求22所述的装置,还包括:
    部署模块,被配置为部署用于实现所述机器学习模型的预测功能的预上线预测服务;
    第一预测模块,被配置为利用所述预上线预测服务对待预测数据进行预测得到第一预测结果;
    第二预测模块,被配置为在线下环境中对所述待预测数据进行预测得到第二预测结果;
    比较模块,被配置为比较所述第一预测结果和所述第二预测结果;
    第一上线模块,被配置为根据所述第一预测结果和所述第二预测结果之间的差异,确定是否上线所述预上线预测服务。
  28. 根据权利要求27所述的装置,其中,所述第二预测模块被配置为:
    通过对所述模型文件进行解析,确定下游执行算子和模型预测算子,所述下游执行算子用于表征所述待预测数据在模型预测之前需要执行的操作;
    将所述待预测数据输入所述下游执行算子;
    将所述下游执行算子的输出输入所述模型预测算子,所述模型预测算子的输出即为对所述待预测数据进行预测得到的第二预测结果。
  29. 根据权利要求22所述的装置,还包括:
    呈现模块,被配置为向用户提供用于设置线上预测服务的图形界面;
    接收模块,被配置为接收用户通过所述图形界面选择的预上线预测服务;
    其中,所述获取模块被配置为执行如下操作中的至少一个:获取服务器端存储的与所述预上线预测服务对应的模型文件;收用户上传的模型文件。
  30. 根据权利要求29所述的装置,其中,所述呈现模块被配置为执行如下操作中的至少一个:
    在所述图形界面中展示模型效果;
    在所述图形界面中展示所述线上数据表。
  31. 根据权利要求29所述的装置,其中,
    所述呈现模块还在所述图形界面中展示向用户推荐的资源配置信息。
  32. 根据权利要求29所述的装置,其中,
    所述接收模块还接收用户通过所述图形界面设置的资源配置信息。
  33. 根据权利要求29所述的装置,还包括:
    第一校验模块,被配置为在预上线预测服务设置完成后,校验所述预上线预测服务的当前环境是否满足上线要求。
  34. 根据权利要求33所述的装置,还包括:
    第二校验模块,被配置为在所述当前环境满足上线要求的情况下,校验所述预上线预 测服务的预测性能与线下环境中机器学习模型的预测性能是否一致;
    第二上线模块,被配置为在所述预上线预测服务的预测性能与线下环境中机器学习模型的预测性能一致或基本一致的情况下,将所述预上线预测服务转为线上预测服务。
  35. 根据权利要求34所述的装置,其中,所述第二校验模块被配置为:
    获取用户指定的样例数据以及输出字段;
    启动用于模拟线下运行环境的离线预估任务和用于模拟线上运行环境的模拟预估任务,分别对所述样例数据进行预测;
    比较所述离线预估任务和所述模拟预估任务针对所述输出字段的输出结果是否一致。
  36. 根据权利要求34所述的装置,其中,
    所述呈现模块还向用户提供服务详情页,所述服务详情页用于展示所述预上线预测服务的以下至少一项服务信息:基本参数、模型参数、一致性校验结果、服务状态信息。
  37. 根据权利要求36所述的装置,其中,
    所述基本参数包括以下至少一项:服务名称、服务类型、运行状态、部署时间、运行时间、资源参数。
  38. 根据权利要求36所述的装置,其中,
    所述模型参数包括以下至少一项:模型名称、模型类型、模型准确率、对数损失值。
  39. 根据权利要求36所述的装置,其中,
    所述一致性校验结果包括一条或多条预测数据分别在线上环境中的预测结果和线下环境中的打分结果。
  40. 根据权利要求36所述的装置,其中,
    所述服务状态信息包括以下至少一项:性能指标、日志信息和运行状态监控信息。
  41. 根据权利要求34所述的装置,还包括:
    提供模块,被配置为在将所述预上线预测服务转为线上预测服务的情况下执行如下操作中的至少一个:向用户提供线上预测服务的服务地址;向用户展示一条或多条预测数据的线上预测结果。
  42. 根据权利要求41所述的装置,其中,
    所述接收模块还接收用户对所述预测数据中一个或多个字段值的修改;
    所述呈现模块还展示修改后的预测数据的线上预测结果。
  43. 一种包括至少一个计算装置和至少一个存储指令的存储装置的系统,其中,所述指令在被所述至少一个计算装置运行时,促使所述至少一个计算装置执行如权利要求1到21中的任一权利要求所述的方法。
  44. 一种存储指令的计算机可读存储介质,其中,当所述指令被至少一个计算装置运行时,促使所述至少一个计算装置执行如权利要求1到21中的任一权利要求所述的方法。
  45. 一种计算装置,包括处理器和存储器,所述存储器中存储有计算机可执行指令集合,当所述计算机可执行指令集合被所述处理器执行时,使所述处理器执行如下步骤:
    获取线下训练机器学习模型得到的模型文件;
    对所述模型文件进行解析,确定模型训练过程使用的训练数据表;
    在线上数据库中创建与所述训练数据表的表信息一致的线上数据表;
    将至少部分线下数据导入所述线上数据表。
  46. 根据权利要求45所述的计算装置,其中,确定模型训练过程使用的训练数据表的步骤包括:
    通过对所述模型文件进行解析,得到模型训练过程信息;
    根据所述模型训练过程信息,将特征处理步骤对应的输入表作为模型训练过程使用的训练数据表。
  47. 根据权利要求46所述的计算装置,其中,所述模型训练过程信息包括以下至少一项:模型训练过程中的处理节点、所述处理节点对应的输入表、所述处理节点对应的输出表。
  48. 根据权利要求46所述的计算装置,其中,所述特征处理步骤包括字段名和针对所述字段名的特征处理方法,还包括以下步骤:
    根据所述特征处理步骤涉及的字段名,在线上数据库中以所述字段名为键存储所述线上数据表中的数据。
  49. 根据权利要求45所述的计算装置,其中,还包括如下步骤:
    通过对所述模型文件进行解析,确定特征处理步骤针对的数据范围,
    其中,将至少部分线下数据导入所述线上数据表的步骤包括:将对应于所述数据范围的线下数据导入所述线上数据表。
  50. 根据权利要求45所述的计算装置,其中,还包括如下步骤:
    部署用于实现所述机器学习模型的预测功能的预上线预测服务;
    利用所述预上线预测服务对待预测数据进行预测得到第一预测结果;
    在线下环境中对所述待预测数据进行预测得到第二预测结果;
    比较所述第一预测结果和所述第二预测结果;
    根据所述第一预测结果和所述第二预测结果之间的差异,确定是否上线所述预上线预测服务。
  51. 根据权利要求50所述的计算装置,其中,在线下环境中对所述待预测数据进行预测得到第二预测结果的步骤包括:
    通过对所述模型文件进行解析,确定下游执行算子和模型预测算子,所述下游执行算子用于表征所述待预测数据在模型预测之前需要执行的操作;
    将所述待预测数据输入所述下游执行算子;
    将所述下游执行算子的输出输入所述模型预测算子,所述模型预测算子的输出即为对所述待预测数据进行预测得到的第二预测结果。
  52. 根据权利要求45所述的计算装置,其中,还包括如下步骤:
    向用户提供用于设置线上预测服务的图形界面;
    接收用户通过所述图形界面选择的预上线预测服务;
    其中,获取线下训练机器学习模型得到的模型文件的步骤包括如下步骤中的至少一个:获取服务器端存储的与所述预上线预测服务对应的模型文件;接收用户上传的模型文件。
  53. 根据权利要求52所述的计算装置,还包括如下步骤中的至少一个:
    在所述图形界面中展示模型效果;
    在所述图形界面中展示所述线上数据表。
  54. 根据权利要求52所述的计算装置,其中,还包括如下步骤中的至少一个:
    在所述图形界面中展示向用户推荐的资源配置信息;
    接收用户通过所述图形界面设置的资源配置信息。
  55. 根据权利要求52所述的计算装置,其中,还包括如下步骤:
    在设置完成后,校验所述预上线预测服务的当前环境是否满足上线要求。
  56. 根据权利要求55所述的计算装置,其中,还包括如下步骤:
    在所述当前环境满足上线要求的情况下,校验所述预上线预测服务的预测性能与线下环境中机器学习模型的预测性能是否一致;
    在所述预上线预测服务的预测性能与线下环境中机器学习模型的预测性能一致或基本一致的情况下,将所述预上线预测服务转为线上预测服务。
  57. 根据权利要求56所述的计算装置,其中,校验所述预上线预测服务的预测性能与线下环境中机器学习模型的预测性能是否一致的步骤包括:
    获取用户指定的样例数据以及输出字段;
    启动用于模拟线下运行环境的离线预估任务和用于模拟线上运行环境的模拟预估任务,分别对所述样例数据进行预测;
    比较所述离线预估任务和所述模拟预估任务针对所述输出字段的输出结果是否一致。
  58. 根据权利要求56所述的计算装置,其中,还包括如下步骤:
    向用户提供服务详情页,所述服务详情页用于展示所述预上线预测服务的以下至少一项服务信息:基本参数、模型参数、一致性校验结果、服务状态信息。
  59. 根据权利要求58所述的计算装置,其中,
    所述基本参数包括以下至少一项:服务名称、服务类型、运行状态、部署时间、运行时间、资源参数。
  60. 根据权利要求58所述的计算装置,其中,
    所述模型参数包括以下至少一项:模型名称、模型类型、模型准确率、对数损失值。
  61. 根据权利要求58所述的计算装置,其中,
    所述一致性校验结果包括一条或多条预测数据分别在线上环境中的预测结果和线下环境中的打分结果。
  62. 根据权利要求58所述的计算装置,其中,
    所述服务状态信息包括以下至少一项:性能指标、日志信息和运行状态监控信息。
  63. 根据权利要求56所述的计算装置,还包括:
    在将所述预上线预测服务转为线上预测服务的情况下,向用户提供线上预测服务的服务地址。
  64. 根据权利要求56所述的计算装置,还包括:
    在将所述预上线预测服务转为线上预测服务的情况下,向用户展示一条或多条预测数据的线上预测结果。
  65. 根据权利要求63所述的计算装置,还包括:
    接收用户对所述预测数据中一个或多个字段值的修改;以及
    展示修改后的预测数据的线上预测结果。
PCT/CN2021/085620 2020-04-17 2021-04-06 辅助机器学习模型上线的方法及装置 WO2021208774A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
EP21789192.8A EP4138004A4 (en) 2020-04-17 2021-04-06 METHOD AND APPARATUS FOR SUPPORTING A MACHINE LEARNING MODEL FOR ONLINE DRIVING
US17/967,169 US20230043882A1 (en) 2020-04-17 2022-10-17 Method for assisting launch of machine learning model

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010307148.5 2020-04-17
CN202010307148.5A CN111523676B (zh) 2020-04-17 2020-04-17 辅助机器学习模型上线的方法及装置

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US17/967,169 Continuation US20230043882A1 (en) 2020-04-17 2022-10-17 Method for assisting launch of machine learning model

Publications (1)

Publication Number Publication Date
WO2021208774A1 true WO2021208774A1 (zh) 2021-10-21

Family

ID=71901872

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/085620 WO2021208774A1 (zh) 2020-04-17 2021-04-06 辅助机器学习模型上线的方法及装置

Country Status (4)

Country Link
US (1) US20230043882A1 (zh)
EP (1) EP4138004A4 (zh)
CN (1) CN111523676B (zh)
WO (1) WO2021208774A1 (zh)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111523676B (zh) * 2020-04-17 2024-04-12 第四范式(北京)技术有限公司 辅助机器学习模型上线的方法及装置
CN116777606B (zh) * 2023-07-05 2024-01-23 无锡锡商银行股份有限公司 一种基于关系图谱的银行信贷智能反欺诈系统及方法

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108229686A (zh) * 2016-12-14 2018-06-29 阿里巴巴集团控股有限公司 模型训练、预测方法、装置、电子设备及机器学习平台
CN108510082A (zh) * 2018-03-27 2018-09-07 苏宁易购集团股份有限公司 对机器学习模型进行处理的方法及装置
US20180322365A1 (en) * 2017-05-05 2018-11-08 Intel Corporation On the fly deep learning in machine learning for autonomous machines
CN109241033A (zh) * 2018-08-21 2019-01-18 北京京东尚科信息技术有限公司 创建实时数据仓库的方法和装置
CN110083334A (zh) * 2018-01-25 2019-08-02 北京顺智信科技有限公司 模型上线的方法及装置
CN110188910A (zh) * 2018-07-10 2019-08-30 第四范式(北京)技术有限公司 利用机器学习模型提供在线预测服务的方法及系统
CN110766164A (zh) * 2018-07-10 2020-02-07 第四范式(北京)技术有限公司 用于执行机器学习过程的方法和系统
CN110956278A (zh) * 2019-11-26 2020-04-03 支付宝(杭州)信息技术有限公司 重新训练机器学习模型的方法和系统
CN110990053A (zh) * 2019-12-04 2020-04-10 第四范式(北京)技术有限公司 机器学习方案模板的创建方法、使用方法及装置
CN111523676A (zh) * 2020-04-17 2020-08-11 第四范式(北京)技术有限公司 辅助机器学习模型上线的方法及装置

Family Cites Families (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8214308B2 (en) * 2007-10-23 2012-07-03 Sas Institute Inc. Computer-implemented systems and methods for updating predictive models
US10649424B2 (en) * 2013-03-04 2020-05-12 Fisher-Rosemount Systems, Inc. Distributed industrial performance monitoring and analytics
CN104680015A (zh) * 2015-03-02 2015-06-03 华南理工大学 一种基于快速相关向量机的污水处理在线软测量方法
US20170185904A1 (en) * 2015-12-29 2017-06-29 24/7 Customer, Inc. Method and apparatus for facilitating on-demand building of predictive models
CN107273979B (zh) * 2017-06-08 2020-12-01 第四范式(北京)技术有限公司 基于服务级别来执行机器学习预测的方法及系统
EP3483797A1 (en) * 2017-11-13 2019-05-15 Accenture Global Solutions Limited Training, validating, and monitoring artificial intelligence and machine learning models
CN109657803B (zh) * 2018-03-23 2020-04-03 新华三大数据技术有限公司 机器学习模型的构建
CN109034394B (zh) * 2018-07-02 2020-12-11 第四范式(北京)技术有限公司 一种机器学习模型的更新方法和装置
CN109242105B (zh) * 2018-08-17 2024-03-15 第四范式(北京)技术有限公司 代码优化方法、装置、设备及介质
CN110895718A (zh) * 2018-09-07 2020-03-20 第四范式(北京)技术有限公司 用于训练机器学习模型的方法及系统
CN109754090A (zh) * 2018-12-27 2019-05-14 第四范式(北京)技术有限公司 支持执行多机器学习模型预测服务的分布式系统及方法
CN110196711B (zh) * 2019-04-10 2023-02-28 杭州实在智能科技有限公司 基于人工智能的插件式工单辅助决策方法及其系统
CN110276668A (zh) * 2019-07-01 2019-09-24 中国工商银行股份有限公司 理财产品智能推送、匹配度确定的方法及系统
CN110956272B (zh) * 2019-11-01 2023-08-08 第四范式(北京)技术有限公司 实现数据处理的方法和系统
CN111008707A (zh) * 2019-12-09 2020-04-14 第四范式(北京)技术有限公司 自动化建模方法、装置及电子设备

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108229686A (zh) * 2016-12-14 2018-06-29 阿里巴巴集团控股有限公司 模型训练、预测方法、装置、电子设备及机器学习平台
US20180322365A1 (en) * 2017-05-05 2018-11-08 Intel Corporation On the fly deep learning in machine learning for autonomous machines
CN110083334A (zh) * 2018-01-25 2019-08-02 北京顺智信科技有限公司 模型上线的方法及装置
CN108510082A (zh) * 2018-03-27 2018-09-07 苏宁易购集团股份有限公司 对机器学习模型进行处理的方法及装置
CN110188910A (zh) * 2018-07-10 2019-08-30 第四范式(北京)技术有限公司 利用机器学习模型提供在线预测服务的方法及系统
CN110766164A (zh) * 2018-07-10 2020-02-07 第四范式(北京)技术有限公司 用于执行机器学习过程的方法和系统
CN109241033A (zh) * 2018-08-21 2019-01-18 北京京东尚科信息技术有限公司 创建实时数据仓库的方法和装置
CN110956278A (zh) * 2019-11-26 2020-04-03 支付宝(杭州)信息技术有限公司 重新训练机器学习模型的方法和系统
CN110990053A (zh) * 2019-12-04 2020-04-10 第四范式(北京)技术有限公司 机器学习方案模板的创建方法、使用方法及装置
CN111523676A (zh) * 2020-04-17 2020-08-11 第四范式(北京)技术有限公司 辅助机器学习模型上线的方法及装置

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP4138004A4 *

Also Published As

Publication number Publication date
EP4138004A1 (en) 2023-02-22
EP4138004A4 (en) 2024-05-29
CN111523676B (zh) 2024-04-12
CN111523676A (zh) 2020-08-11
US20230043882A1 (en) 2023-02-09

Similar Documents

Publication Publication Date Title
WO2020253775A1 (zh) 机器学习建模过程的实现方法和系统
CN111177569B (zh) 基于人工智能的推荐处理方法、装置及设备
US8996452B2 (en) Generating a predictive model from multiple data sources
WO2021190379A1 (zh) 实现自动机器学习的方法及装置
CN111523677B (zh) 实现对机器学习模型的预测结果进行解释的方法及装置
US20230043882A1 (en) Method for assisting launch of machine learning model
WO2021244639A1 (zh) 利用机器学习模型进行线上预测的辅助实现方法及装置
CN110705719A (zh) 执行自动机器学习的方法和装置
US9355371B2 (en) Process model generated using biased process mining
CN112861662B (zh) 基于人脸和交互文本的目标对象行为预测方法及相关设备
CN112085087B (zh) 业务规则生成的方法、装置、计算机设备及存储介质
KR20220103016A (ko) 창업을 위한 정보를 제공하기 위한 전자 장치 및 그 동작 방법
CN117522538A (zh) 招投标信息处理方法、装置、计算机设备及存储介质
CN116661936A (zh) 页面数据的处理方法、装置、计算机设备及存储介质
CN116450723A (zh) 数据提取方法、装置、计算机设备及存储介质
CN114003567A (zh) 数据采集的方法及相关装置
US20230136972A1 (en) Egocentric network entity robustness prediction
US20220207409A1 (en) Timeline reshaping and rescoring
CN114492638A (zh) 一种特征抽取方法及装置、电子设备、存储介质
CN117034230A (zh) 一种数据校验方法、装置、设备及其存储介质
CN117541884A (zh) 样本数据处理方法、装置、存储介质和系统
CN117435378A (zh) 代码修复方法、装置、设备、存储介质和程序产品
CN117234505A (zh) 一种交互页面生成方法、装置、设备及其存储介质
CN117034114A (zh) 基于人工智能的数据预测方法、装置、设备及存储介质
CN114819440A (zh) 基于人工智能的交易处理方法、装置及电子设备

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21789192

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2021789192

Country of ref document: EP

Effective date: 20221117

NENP Non-entry into the national phase

Ref country code: DE