CN110888857B - Data tag generation method, device, terminal and medium based on neural network - Google Patents
Data tag generation method, device, terminal and medium based on neural network Download PDFInfo
- Publication number
- CN110888857B CN110888857B CN201910974647.7A CN201910974647A CN110888857B CN 110888857 B CN110888857 B CN 110888857B CN 201910974647 A CN201910974647 A CN 201910974647A CN 110888857 B CN110888857 B CN 110888857B
- Authority
- CN
- China
- Prior art keywords
- data
- neural network
- training
- preset
- round
- Prior art date
- Legal status (The legal status 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 status listed.)
- Active
Links
- 238000013528 artificial neural network Methods 0.000 title claims abstract description 183
- 238000000034 method Methods 0.000 title claims abstract description 55
- 238000012549 training Methods 0.000 claims abstract description 138
- 238000003062 neural network model Methods 0.000 claims abstract description 85
- 238000012216 screening Methods 0.000 claims abstract description 24
- 230000015654 memory Effects 0.000 claims description 26
- 238000004364 calculation method Methods 0.000 claims description 8
- 238000007781 pre-processing Methods 0.000 claims description 8
- 238000012795 verification Methods 0.000 claims description 8
- 238000004590 computer program Methods 0.000 claims description 6
- 238000000605 extraction Methods 0.000 claims description 4
- 238000005259 measurement Methods 0.000 claims description 4
- 230000006870 function Effects 0.000 description 18
- 238000012360 testing method Methods 0.000 description 16
- 238000009826 distribution Methods 0.000 description 13
- 230000008569 process Effects 0.000 description 11
- 210000002569 neuron Anatomy 0.000 description 8
- 238000010606 normalization Methods 0.000 description 8
- 230000008901 benefit Effects 0.000 description 7
- 238000012545 processing Methods 0.000 description 7
- 238000013527 convolutional neural network Methods 0.000 description 6
- 239000000284 extract Substances 0.000 description 5
- 238000010586 diagram Methods 0.000 description 4
- 230000009466 transformation Effects 0.000 description 4
- 238000004891 communication Methods 0.000 description 3
- 238000003672 processing method Methods 0.000 description 3
- 238000012935 Averaging Methods 0.000 description 2
- 230000004913 activation Effects 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 2
- 238000010276 construction Methods 0.000 description 2
- 230000003247 decreasing effect Effects 0.000 description 2
- 230000000694 effects Effects 0.000 description 2
- 230000008921 facial expression Effects 0.000 description 2
- 238000011160 research Methods 0.000 description 2
- 238000005070 sampling Methods 0.000 description 2
- 230000006403 short-term memory Effects 0.000 description 2
- 238000000844 transformation Methods 0.000 description 2
- 238000009827 uniform distribution Methods 0.000 description 2
- 238000002759 z-score normalization Methods 0.000 description 2
- 238000013459 approach Methods 0.000 description 1
- 238000001514 detection method Methods 0.000 description 1
- 238000007599 discharging Methods 0.000 description 1
- 230000010365 information processing Effects 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000000638 solvent extraction Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/21—Design, administration or maintenance of databases
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/28—Databases characterised by their database models, e.g. relational or object models
- G06F16/284—Relational databases
- G06F16/285—Clustering or classification
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/21—Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
- G06F18/214—Generating training patterns; Bootstrap methods, e.g. bagging or boosting
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Databases & Information Systems (AREA)
- Data Mining & Analysis (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Evolutionary Computation (AREA)
- Life Sciences & Earth Sciences (AREA)
- Artificial Intelligence (AREA)
- Computational Linguistics (AREA)
- Mathematical Physics (AREA)
- Biomedical Technology (AREA)
- Health & Medical Sciences (AREA)
- General Health & Medical Sciences (AREA)
- Molecular Biology (AREA)
- Computing Systems (AREA)
- Biophysics (AREA)
- Software Systems (AREA)
- Bioinformatics & Cheminformatics (AREA)
- Bioinformatics & Computational Biology (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Evolutionary Biology (AREA)
- Image Analysis (AREA)
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
Abstract
The invention provides a data tag generation method based on a neural network, which comprises the following steps: acquiring historical data; initializing input parameters of a preset neural network; inputting the historical data into the preset neural network for training; after training is finished, extracting the output of a designated layer of the preset neural network as a candidate data tag; calculating the grading result of the candidate data labels; reinitializing the input parameters of the preset neural network according to the scoring result and performing a new round of training based on the new input parameters until a preset exploration period is reached; storing the neural network model obtained by each round of training and the candidate data labels extracted from each round of neural network model; and screening target data labels from the stored candidate data labels according to preset screening conditions. The invention also provides a data tag generating device, a terminal and a medium based on the neural network. The method and the device can quickly and effectively generate a large number of data labels.
Description
Technical Field
The invention relates to the technical field of data processing, in particular to a data tag generation method, device, terminal and medium based on a neural network.
Background
Valuation of financial assets and prediction of future returns have been an important topic in the investment field. Since financial assets have strong effectiveness, the distribution of the tags of the financial assets is often changed continuously with time, and if the financial assets are predicted and a high prediction accuracy is obtained, enough tags of the financial assets are required.
Conventional financial asset tags are typically generated by researchers through logical-relational combinations of known financial asset base data. This approach suffers from the following disadvantages 1) inefficiency in generating labels; 2) The number of labels generated is limited; 3) The generated tags have limited coverage.
Therefore, a new financial asset tag generation scheme is needed to solve the technical problems of small generation quantity and low efficiency of the financial asset tags, thereby improving the prediction accuracy of the financial asset.
Disclosure of Invention
In view of the foregoing, it is necessary to provide a data tag generating method, apparatus, terminal and medium based on a neural network, which can generate a large number of data tags quickly and effectively.
A first aspect of the present invention provides a data tag generation method based on a neural network, the method comprising:
acquiring historical data;
initializing input parameters of a preset neural network;
inputting the historical data into the preset neural network for training;
after training is finished, extracting the output of a designated layer of the preset neural network as a candidate data tag;
calculating the grading result of the candidate data labels;
reinitializing the input parameters of the preset neural network according to the scoring result and performing a new round of training based on the new input parameters until a preset exploration period is reached;
storing the neural network model obtained by each round of training and the candidate data labels extracted from each round of neural network model;
and screening target data labels from the stored candidate data labels according to preset screening conditions.
In an alternative embodiment, the extracting the output of the specified layer of the preset neural network as the candidate data tag includes:
acquiring the type of the preset neural network;
when the type of the preset neural network is a supervised learning network, extracting the output of the last layer as a candidate data tag;
And when the type of the preset neural network is an unsupervised learning network, extracting the output of the middle layer as a candidate data tag.
In an alternative embodiment, the reinitializing the input parameters of the preset neural network according to the scoring result includes:
randomly generating a set of exploration parameters for a next round;
calculating initial input parameters of the next round according to the exploration parameters;
training a neural network model of the next round based on the initial input parameters and calculating scoring results of the next round;
judging whether the scoring result of the next round is larger than the scoring result of the previous round;
if the scoring result of the next round is greater than the scoring result of the previous round, the initial input parameters are reserved;
and if the scoring result of the next round is smaller than or equal to the scoring result of the previous round, the initial input parameter is the initial input parameter of the previous round.
In an alternative embodiment, the initial input parameters for each round are calculated using the following formula:
θ t =αθ t ′+(1-αt)θ t-1 ,1<t<T,
wherein θ t ' is a set of exploration parameters randomly generated in the next round, T represents the round, T is the preset exploration period, and alpha is the attenuation coefficient.
In an alternative embodiment, the calculating the scoring result of the candidate data tag includes:
Calculating the pearson correlation coefficient of the candidate data tag and the target index;
performing net value back measurement on the candidate data labels to obtain a summer ratio;
calculating the accuracy of the neural network model obtained after training;
calculating an AUC value enclosed by the ROC curve and the coordinate axis;
and scoring results are obtained according to the pearson correlation coefficient, the summer ratio, the accuracy and the AUC value.
In an alternative embodiment, before said inputting said history data into said predetermined neural network for training, said method further comprises:
dividing the historical data into a first data part and a second data part, wherein the number of the second data part is smaller than that of the first data part;
disturbing the first data and equally dividing the first data into N data;
and selecting N-1 data in the N data in turn as a training set, and taking the remaining one data as a verification set.
In an alternative embodiment, after said obtaining the history data, the method further comprises:
preprocessing the historical data, wherein the preprocessing comprises the following steps: deleting empty data, removing extremum data, normalizing data, wherein,
the deleting the null data includes: filling 0 into incomplete data in the historical data or filling 0 into non-existing data;
The extremum removal data comprises: removing data positioned in the front K1 row and the rear K2 row in the historical data; and carrying out average calculation on the historical data to obtain average data, reducing the data which is larger than the preset first multiple of the average data in the historical data to the average data, and improving the data which is smaller than the preset second multiple of the average data in the historical data to the average data.
A second aspect of the present invention provides a data tag generation apparatus based on a neural network, the apparatus comprising:
the data acquisition module is used for acquiring historical data;
the parameter initialization module is used for initializing input parameters of a preset neural network;
the model training module is used for inputting the historical data into the preset neural network for training;
the label extraction module is used for extracting the output of the appointed layer of the preset neural network as a candidate data label after training is finished;
the scoring calculation module is used for calculating scoring results of the candidate data labels;
the retraining module is used for reinitializing the input parameters of the preset neural network according to the scoring result and carrying out a new round of training on the basis of the new input parameters until a preset exploration period is reached;
The label storage module is used for storing the neural network model obtained by each round of training and the candidate data labels extracted from each round of neural network model;
and the tag determining module is used for screening target data tags from the stored candidate data tags according to preset screening conditions.
A third aspect of the present invention provides a terminal comprising a processor for implementing the neural network based data tag generation method when executing a computer program stored in a memory.
A fourth aspect of the present invention provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the neural network-based data tag generation method.
In summary, according to the data tag generation method, device, terminal and medium based on the neural network, the input parameters of the preset neural network are initialized, the history data are input into the preset neural network for training, and after training is finished, the output of the appointed layer of the preset neural network is extracted to serve as a candidate data tag; calculating the grading result of the candidate data labels; reinitializing the input parameters of the preset neural network according to the grading result and carrying out a new round of training based on the new input parameters; and storing the neural network model obtained by each round of training and the candidate data labels extracted from the neural network model, and finally screening target data labels from the candidate data labels. Compared with the traditional method, the method can obtain a large number of data labels in a short time, the generation efficiency of the data labels is far higher than that of the traditional processing method, and the technical problems of small quantity and low efficiency of the traditional generated data labels are solved; in addition, due to the nonlinear characteristics of the neural network, the obtained data labels are more diversified; because of the dynamic characteristics of the training neural network model, the generated data label has strong effectiveness and strong practicability.
Drawings
Fig. 1 is a flowchart of a data tag generating method based on a neural network according to an embodiment of the present invention.
Fig. 2 is a block diagram of a data tag generating apparatus based on a neural network according to a second embodiment of the present invention.
Fig. 3 is a schematic structural diagram of a terminal according to a third embodiment of the present invention.
Detailed Description
In order that the above-recited objects, features and advantages of the present invention will be more clearly understood, a more particular description of the invention will be rendered by reference to specific embodiments thereof which are illustrated in the appended drawings. It should be noted that, without conflict, the embodiments of the present invention and features in the embodiments may be combined with each other.
In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present invention, and the described embodiments are merely some, rather than all, embodiments of the present invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs. The terminology used herein in the description of the invention is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention.
Example 1
Fig. 1 is a flowchart of a data tag generating method based on a neural network according to an embodiment of the present invention.
As shown in fig. 1, the data tag generating method based on the neural network specifically includes the following steps, the order of the steps in the flowchart may be changed according to different requirements, and some may be omitted.
S11, historical data is acquired.
In this embodiment, the history data may include: historical financial asset data, historical face image data, historical facial expression data, historical vehicle loss image data and the like are merely examples, and any data that needs to be predicted now or later can be applied thereto, and the invention is not limited in any way.
Generally, to perform a certain prediction according to the historical data, it is necessary to process and process the historical data, extract a data factor or a data feature with a prediction capability from the historical data, and predict the historical data based on the extracted data factor or data feature to obtain a prediction result. That is, the data factor or data feature is an intermediate quantity between the history data and the prediction result, and is collectively referred to as a data tag.
In actual life, the quantity of the historical data is insufficient, so that certain prediction accuracy based on a small quantity of the historical data is low, the neural network has more network layers, particularly neurons of an intermediate network layer are far more than those of an input layer, the historical data input to the input layer are processed through the network structure with the more layers, intermediate data which is larger than the quantity of the historical data can be obtained, the intermediate data has a certain influence on the prediction result of an output layer, and therefore the intermediate data in the intermediate layer can be extracted as a data tag, the data tags are combined together to serve as a research object, and a large quantity of the data tags are beneficial to improving the prediction accuracy of the data.
To facilitate an understanding of the inventive concepts of the present invention, historical financial asset data may be used as an example. If future benefits of the target finance company are to be predicted, historical finance asset data of the target finance company, such as daily driving price, daily closing price, daily maximum price, daily minimum price, monthly finance data, and the like, can be obtained, a neural network model is trained based on the obtained historical finance asset data, and when the neural network model reaches local convergence, data output by a designated layer is extracted as a data tag. The data output by the designated layer is a technical index (e.g., random index KDJ, brin index boil, BRAR index, ASI index, etc.) with a predicted future benefit of the target finance company.
In an alternative embodiment, after said obtaining the history data, the method further comprises:
preprocessing the historical data.
The preprocessing may include, but is not limited to: deleting null data, removing extremum data and normalizing data.
By way of example, the null data may refer to data at the time of stock stop. The deleting the null data includes: and filling incomplete data in the historical data with 0 or filling non-existing data with 0.
The extremum removal data comprises: removing data positioned in the front K1 row and the rear K2 row in the historical data; and carrying out average calculation on the historical data to obtain average data, reducing the data which is larger than the preset first multiple of the average data in the historical data to the average data, and improving the data which is smaller than the preset second multiple of the average data in the historical data to the average data.
The data normalization includes Min-max normalization (Min-max normalization), log function transformation, z-score normalization (zero-mean normalization), etc., which are prior art and the present invention is not described in detail herein.
In the alternative embodiment, the preprocessed historical data has higher quality, so that the obtained data label is more reliable when the neural network model is trained later, and the convergence speed of the training neural network model can be increased.
S12, initializing input parameters of a preset neural network.
The input parameters may include: the neural network total layer number, training batch, dropout proportion, neural network weight distribution and the like.
In this embodiment, the neural network may be preset as a supervised learning network, or an unsupervised learning network, or a semi-supervised learning network. Wherein the supervised learning network comprises: multi-Layer perceptron (MLP), long Short-Term Memory (LSTM), convolutional neural network (Convolutional Neural Networks, CNN), etc., the unsupervised learning network includes: a self-encoder, etc.
The selection of the neural network can be determined by itself according to actual needs and personalized needs.
Illustratively, the present example presets a self-encoder as a prototype structure of a neural network, the self-encoder including the following 3 parts:
(1) Encoder with a plurality of sensors
The goal of the encoder is to maximally compress, perform linear and nonlinear transformations using neural networks, and extract implicit information from the original input features. Given stock data x= { X 1 ,x 2 ,...,x n },x i ∈R d Where d represents the dimension of the stock factor, the encoder first maps X to the hidden layer, F, using a neural network e ={F 1 ,F 2 ,...,F m },Wherein d is i Representing the number of neurons of the ith hidden layer, F i Representing the output of the ith hidden layer. F (F) i The expression of (2) is as follows:
F i =s(W i F i-1 +b i )
wherein s is an activation function, W i And b i The weight and bias of the i-th layer, respectively.
(2) Decoder
The goal of the decoder is to maximally restore the original input features using a neural network, based on the output of the encoder. Output of a given encoderThe decoder is denoted as F d ={F 1 ,F 2 ,...,F l },Wherein d is j Representing the dimension of the j-th decoding layer, F j Representing the output of the j-th layer of the decoder. Wherein F is l D is the output layer l =d。
(3) Loss function
The self-encoder is trained by minimizing the reconstruction error, defining a loss function as follows:
and finding out W and b which minimize the reconstruction error through gradient descent, and obtaining the optimal self-encoder.
Preferably, initializing input parameters of a preset neural network includes:
initializing the total layer number of the neural network to be 2;
initializing the training batch to 100;
initializing the dropout proportion to 0.2;
initializing the neural network weight distribution to be uniform.
In this embodiment, after initializing the input parameters of the preset neural network, 2, 100,0.2 and uniform distribution can be used as a set of parameters to be input into the preset neural network at the same time, for example, input from the encoder.
It should be noted that the training batch is fixed.
S13, inputting the historical data into the preset neural network for training.
In this embodiment, after the input parameters of the preset neural network are initialized, the history data may be input into the preset neural network for training.
In an alternative embodiment, before said inputting said history data into said predetermined neural network for training, said method further comprises:
dividing the historical data into a first data part and a second data part, wherein the number of the second data part is smaller than that of the first data part;
disturbing the first data and equally dividing the first data into N data;
and selecting N-1 data in the N data in turn as a training set, and taking the remaining one data as a verification set.
The second data is used as a test set.
The training set is used for training the neural network model and determining parameters of the neural network model, the verification set is used for optimizing the parameters of the neural network model, and the test set is used for testing popularization capability of the trained neural network model. And selecting N-1 data in the N data in turn for training, verifying the rest data, calculating the prediction error square sum, and finally averaging the N prediction error square sums to be used as the basis for selecting the optimal model structure.
Because the historical data is divided into a training set, a verification set and a test set, the historical data is input into the preset neural network for training, and the training set is input into the preset neural network for training.
And S14, after training is finished, extracting the output of the designated layer of the preset neural network as a candidate data tag.
In this embodiment, if the obtained neural network model reaches the locally optimal solution in the process of training the preset neural network based on the historical data, the training process is considered to be finished. At this time, the output of the specified layer is extracted as a newly generated data tag.
In an alternative embodiment, the extracting the output of the specified layer of the preset neural network as the candidate data tag includes:
acquiring the type of the preset neural network;
when the type of the preset neural network is a supervised learning network, extracting the output of the last layer as a candidate data tag;
and when the type of the preset neural network is an unsupervised learning network, extracting the output of the middle layer as a candidate data tag.
When the neural network is determined in advance, the determined type of the neural network may be set correspondingly.
In this embodiment, the types of the neural network are classified into two main types, one type is a supervised learning network, and the other type is an unsupervised learning network. If the supervised learning network is selected as the neural network prototype, historical data is taken as input, asset profitability, risk and the like are taken as training targets, and the result output by the last output layer is designated as a candidate data label. If the unsupervised learning network is selected as the neural network prototype, historical data is taken as input, the input and the output are as similar as possible as training targets, and the result output by the middle-most layer is designated as a candidate data label.
And S15, calculating the grading result of the candidate data labels.
In this embodiment, after the output of the designated layer is extracted, the extracted candidate data labels need to be scored, and the input parameters of the preset neural network are adjusted according to the scoring result.
In an alternative embodiment, the calculating the scoring result of the candidate data tag includes:
1) Calculating the pearson correlation coefficient of the candidate data tag and the target index;
the candidate data labels are ordered according to time sequences to obtain sequences P= { P1, P2, & gt, pt }, target index sequences are Q= { Q1, Q2, & gt, qt }, and pearson correlation coefficients of P and Q are calculated to obtain score.
The pearson correlation coefficient between two variables is defined as the quotient of the covariance and standard deviation between the two variables. The pearson correlation coefficient is calculated as in the prior art, and the present invention is not specifically described.
2) Performing net value back measurement on the candidate data labels to obtain a summer ratio;
specifically, selecting partial data from the candidate data labels to carry out regression prediction, and calculating the summer ratio of the net value to be measured as score2. The present invention is not described in detail herein with respect to regression prediction as prior art.
The sharp Ratio (shappe Ratio) may take into account both revenue and risk, with a greater sharp Ratio indicating a higher risk return for the foundation unit risk.
3) Calculating the accuracy of the neural network model obtained after training;
after training of the historical data by the preset neural network is finished, testing the test passing rate of the neural network model at the end of training by using a test set, wherein the test passing rate is used as the accuracy of the neural network model and is recorded as score3.
4) Calculating an AUC value enclosed by the ROC curve and the coordinate axis;
after training of the historical data by the preset neural network is finished, an ROC curve is constructed, an AUC value surrounded by the ROC curve and the XY coordinate axis is calculated, and the AUC value is recorded as score4.
AUC (Area Under Curve) is defined as the area enclosed by the coordinate axis under the ROC curve, and the value range is between 0.5 and 1. The larger the AUC value is, the better the classification effect of the model obtained at the end of the training of the preset neural network is. The construction process of the ROC curve is prior art, and is not described in detail herein since the focus of the present invention is not in this regard.
5) And scoring results are obtained according to the pearson correlation coefficient, the summer ratio, the accuracy and the AUC value.
If the supervised learning network is selected as the preset neural network, calculating the scoring result of the candidate data labels according to the following formula:
scoru=w1×score1+w2×score2+w3×score3+w4×score4, wherein weights w1, w2, w3, w4 are preset values, and w1+w2+w3+w4=1.
If an unsupervised learning network is selected as a preset neural network, calculating a scoring result of the candidate data tag according to the following formula:
score=w1×score1+w2×score2, wherein weights w1, w2 are preset values, and w1+w2=1.
S16, initializing input parameters of the preset neural network again according to the scoring result, and training for a new round based on the new input parameters until a preset exploration period is reached.
In this embodiment, the neural network model obtained by each round of training correspondingly calculates a scoring result, and the input parameters of the neural network preset in the next round are reinitialized according to the scoring result of the previous round. When the neural network carries out the training of the neural network model of the next round based on the newly initialized input parameters, the neural network is optimized in a better direction, a new local optimal point is found, different data labels in the historical data are learned, and then candidate data labels are extracted from the trained neural network model.
In an alternative embodiment, the reinitializing the input parameters of the preset neural network according to the scoring result includes:
randomly generating a set of exploration parameters for a next round;
calculating initial input parameters of the next round according to the exploration parameters;
training a neural network model of the next round based on the initial input parameters and calculating scoring results of the next round;
judging whether the scoring result of the next round is larger than the scoring result of the previous round;
if the scoring result of the next round is greater than the scoring result of the previous round, the initial input parameters are reserved;
and if the scoring result of the next round is smaller than or equal to the scoring result of the previous round, the initial input parameter is the initial input parameter of the previous round.
In an alternative embodiment, the initial input parameters for each round are calculated using the following formula:
θ t =αθ t ′+(1-αt)θ t-1 ,1<t<T,
wherein θ t ' is a set of exploration parameters randomly generated in the next round, T represents the round, T is the preset exploration period, and alpha is the attenuation coefficient.
Exemplary, assume that the first round initializes the input parameter θ 1 First round scoring result O calculated at training end 1 The input parameters at each subsequent iteration round are reinitialized based on the scoring results of the previous round, thereby generating final initial input parameters for the round for training the neural network model and extracting newly generated candidate data labels.
If the current round is t, randomly generating a group of exploration parameters theta t ' the initial input parameter of the t wheel is calculated as theta t =αθ t ′+(1-αt)θ t-1 . By theta t Retraining a preset neural network, and calculating a corresponding scoring result O at the end of training t If O t >O t-1 Then reserve θ t The method comprises the steps of carrying out a first treatment on the surface of the If O t <O t-1 Theta is then t =θ t-1 。
The exploration cycle is the time from exploration of new initialized input parameters and then training until the neural network model converges. Iteratively training the neural network model by changing the initialized input parameters, and generating the next iteration exploration parameters according to the last parameter exploration result until the set exploration period T is reached.
Preferably, the attenuation coefficient α=0.2, and the search period t=50.
In this embodiment, the set of exploration parameters for each round includes: the total layer number of the neural network, the dropout proportion and the weight distribution of the neural network. Wherein the total layer number of the neural network is randomly selected from a set of total layer numbers of the neural network, the dropout proportion is randomly selected from a set of dropout proportions, the neural network weight distribution is randomly selected from a set of neural network weight distribution,
by way of example only, and not by way of limitation,the number of layers m of the neural network, and the data dimension of the input layer is R 1×N The data dimension of the output layer is R 1 ×M The maximum value of M is not more than N-M+1, and the set of M is { m|m epsilon [2, 51 ]]Sequentially increasing from m=2 until m=51. In order to fuse the input information of a plurality of characteristic labels, the input information is gradually decreased from an input layer to a layer, and a network with the neuron number being an arithmetic sequence is constructed. Each layer of neurons has a dimension { R 1×N ,R 1×(N-skip) ,R 1×(N-2sk) ,...,R 1×M Skip= (N-M)/(M-1).
For example, the dropout proportion set is {0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9}, the diversity of the network can be further improved through the dropout proportion, and the dropout value mode is equal interval sampling, for example {0.3,0.5,0.7,0.9}.
The set of neural network weight distributions is illustratively { constant, uniform, gaussian, truncated gaussian }.
Through the above sets, one parameter is selected from each set at will, and Cartesian product is carried out, so that 1600 types of super-parameter combinations can be obtained, and can be used as an iterator to train to obtain 1600 neural network models.
And S17, storing the neural network model obtained by each round of training and the candidate data labels extracted from each round of neural network model.
In this embodiment, the neural network model is trained by continuously exploring new initial input parameters and based on the new initial input parameters until an exploration period is reached. And storing the initialization input parameters corresponding to the neural network model obtained by training in each iteration, so that the subsequent training data labels obtained again by adopting the initialization input parameters and the neural network model obtained by training can be used for carrying out profit or risk prediction and the like.
And when the training neural network model of each round is finished, extracting the output of the designated layer as the generated candidate data label and storing the candidate data label in a preset database. When the exploration period is reached, all extracted candidate data tags may be brought together.
S18, screening target data labels from the stored candidate data labels according to preset screening conditions.
The preset screening conditions are preset screening standards and can be set or adjusted according to actual requirements.
Illustratively, if future benefits of the target finance company are to be predicted, the screening conditions may be: calculating the correlation of each candidate data tag and the income of the target finance company; and eliminating candidate data labels with the correlation smaller than a preset correlation threshold.
In other embodiments, the screening conditions may further include: and eliminating a round of candidate data labels with scoring results smaller than the preset scoring results.
The candidate data labels after being removed are target data labels, and the target data labels can be used for predicting future stock prices, future receivability, risk identification, asset pricing and the like of target finance companies.
Preferably, in order to improve the generation efficiency of the candidate data tag, a neural network set may be preset, and a plurality of sub-threads are synchronously started, and a plurality of neural network models are trained in parallel through the plurality of sub-threads. Each sub-thread executes training of a neural network model based on the historical data, different sub-threads can preset the same neural network or preset different neural networks, and a main line control controls initial input parameters of all the sub-threads. The method includes the steps of starting 4 sub-threads synchronously, wherein the 1 st sub-thread is used for training a multi-layer sensor network model based on the historical data, the 2 nd sub-thread is used for training a long-short-term memory network model based on the historical data, the 3 rd sub-thread is used for training a convolution neural network model based on the historical data, the 4 th sub-thread is used for training a self-encoder network model based on the historical data, and the main thread is used for initializing input parameters of each neural network model. Because a plurality of sub-threads are synchronously started to execute training of a plurality of neural network models in parallel, the number of the extracted candidate data labels can be increased, and the efficiency of extracting the candidate data labels is improved, so that the number of the target data labels is increased, and the efficiency of generating the target data labels is improved.
In summary, according to the data tag generation method based on the neural network, input parameters of a preset neural network are initialized, the historical data are input into the preset neural network for training, and after training is finished, output of a designated layer of the preset neural network is extracted to serve as a candidate data tag; calculating the grading result of the candidate data labels; reinitializing the input parameters of the preset neural network according to the grading result and carrying out a new round of training based on the new input parameters; and storing the neural network model obtained by each round of training and the candidate data labels extracted from the neural network model, and finally screening target data labels from the candidate data labels. Compared with the traditional method, the method can obtain a large number of data labels in a short time, the generation efficiency of the data labels is far higher than that of the traditional processing method, and the technical problems of small quantity and low efficiency of the traditional generated data labels are solved; in addition, due to the nonlinear characteristics of the neural network, the obtained data labels are more diversified; because of the dynamic characteristics of the training neural network model, the generated data label has strong effectiveness and strong practicability.
Example two
Fig. 2 is a block diagram of a data tag generating apparatus based on a neural network according to the present invention.
In some embodiments, the neural network based data tag generating device 20 may include a plurality of functional modules composed of program code segments. Program code for each program segment in the neural network based data tag generation apparatus 20 may be stored in a memory of the terminal and executed by the at least one processor to perform (see fig. 1 for details) the functions of neural network based data tag generation.
In this embodiment, the data tag generating apparatus 20 based on the neural network may be divided into a plurality of functional modules according to the functions performed by the data tag generating apparatus. The functional module may include: a data acquisition module 201, a data processing module 202, a parameter initialization module 203, a model training module 204, a data partitioning module 205, a label extraction module 206, a score calculation module 207, a retraining module 208, a label holding module 209, and a label determination module 210. The module referred to in the present invention refers to a series of computer program segments capable of being executed by at least one processor and of performing a fixed function, stored in a memory. In the present embodiment, the functions of the respective modules will be described in detail in the following embodiments.
The data acquisition module 201 is configured to acquire historical data.
In this embodiment, the history data may include: historical financial asset data, historical face image data, historical facial expression data, historical vehicle loss image data and the like are merely examples, and any data that needs to be predicted now or later can be applied thereto, and the invention is not limited in any way.
Generally, to perform a certain prediction according to the historical data, it is necessary to process and process the historical data, extract a data factor or a data feature with a prediction capability from the historical data, and predict the historical data based on the extracted data factor or data feature to obtain a prediction result. That is, the data factor or data feature is an intermediate quantity between the history data and the prediction result, and is collectively referred to as a data tag.
In actual life, the quantity of the historical data is insufficient, so that certain prediction accuracy based on a small quantity of the historical data is low, the neural network has more network layers, particularly neurons of an intermediate network layer are far more than those of an input layer, the historical data input to the input layer are processed through the network structure with the more layers, intermediate data which is larger than the quantity of the historical data can be obtained, the intermediate data has a certain influence on the prediction result of an output layer, and therefore the intermediate data in the intermediate layer can be extracted as a data tag, the data tags are combined together to serve as a research object, and a large quantity of the data tags are beneficial to improving the prediction accuracy of the data.
To facilitate an understanding of the inventive concepts of the present invention, historical financial asset data may be used as an example. If future benefits of the target finance company are to be predicted, historical finance asset data of the target finance company, such as daily driving price, daily closing price, daily maximum price, daily minimum price, monthly finance data, and the like, can be obtained, a neural network model is trained based on the obtained historical finance asset data, and when the neural network model reaches local convergence, data output by a designated layer is extracted as a data tag. The data output by the designated layer is a technical index (e.g., random index KDJ, brin index boil, BRAR index, ASI index, etc.) with a predicted future benefit of the target finance company.
In an alternative embodiment, after the acquiring the history data, the apparatus further comprises:
and the data processing module 202 is used for preprocessing the historical data.
The preprocessing may include, but is not limited to: deleting null data, removing extremum data and normalizing data.
By way of example, the null data may refer to data at the time of stock stop. The deleting the null data includes: and filling incomplete data in the historical data with 0 or filling non-existing data with 0.
The extremum removal data comprises: removing data positioned in the front K1 row and the rear K2 row in the historical data; and carrying out average calculation on the historical data to obtain average data, reducing the data which is larger than the preset first multiple of the average data in the historical data to the average data, and improving the data which is smaller than the preset second multiple of the average data in the historical data to the average data.
The data normalization includes Min-max normalization (Min-max normalization), log function transformation, z-score normalization (zero-mean normalization), etc., which are prior art and the present invention is not described in detail herein.
In the alternative embodiment, the preprocessed historical data has higher quality, so that the obtained data label is more reliable when the neural network model is trained later, and the convergence speed of the training neural network model can be increased.
The parameter initialization module 203 is configured to initialize input parameters of a preset neural network.
The input parameters may include: the neural network total layer number, training batch, dropout proportion, neural network weight distribution and the like.
In this embodiment, the neural network may be preset as a supervised learning network, or an unsupervised learning network, or a semi-supervised learning network. Wherein the supervised learning network comprises: multi-Layer perceptron (MLP), long Short-Term Memory (LSTM), convolutional neural network (Convolutional Neural Networks, CNN), etc., the unsupervised learning network includes: a self-encoder, etc.
The selection of the neural network can be determined by itself according to actual needs and personalized needs.
Illustratively, the present example presets a self-encoder as a prototype structure of a neural network, the self-encoder including the following 3 parts:
(1) Encoder with a plurality of sensors
The goal of the encoder is to maximally compress, perform linear and nonlinear transformations using neural networks, and extract implicit information from the original input features. Given stock data x= { X 1 ,x 2 ,...,x n },x i ∈R d Where d represents the dimension of the stock factor, the encoder first maps X to the hidden layer, F, using a neural network e ={F 1 ,F 2 ,...,F m },Wherein d is i Representing the number of neurons of the ith hidden layer, F i Representing the output of the ith hidden layer. F (F) i The expression of (2) is as follows:
F i =s(W i F i-1 +b i )
wherein,s is an activation function, W i And b i The weight and bias of the i-th layer, respectively.
(2) Decoder
The goal of the decoder is to maximally restore the original input features using a neural network, based on the output of the encoder. Output of a given encoderThe decoder is denoted as F d ={F 1 ,F 2 ,...,F l },Wherein d is j Representing the dimension of the j-th decoding layer, F j Representing the output of the j-th layer of the decoder. Wherein F is l D is the output layer l =d。
(3) Loss function
The self-encoder is trained by minimizing the reconstruction error, defining a loss function as follows:
And finding out W and b which minimize the reconstruction error through gradient descent, and obtaining the optimal self-encoder.
Preferably, initializing input parameters of a preset neural network includes:
initializing the total layer number of the neural network to be 2;
initializing the training batch to 100;
initializing the dropout proportion to 0.2;
initializing the neural network weight distribution to be uniform.
In this embodiment, after initializing the input parameters of the preset neural network, 2, 100,0.2 and uniform distribution can be used as a set of parameters to be input into the preset neural network at the same time, for example, input from the encoder.
It should be noted that the training batch is fixed.
The model training module 204 is configured to input the historical data to the preset neural network for training.
In this embodiment, after the input parameters of the preset neural network are initialized, the history data may be input into the preset neural network for training.
In an alternative embodiment, before said inputting said history data into said predetermined neural network for training, said apparatus further comprises:
a data dividing module 205, configured to divide the historical data into a first portion of data and a second portion of data, where the number of the second portion of data is smaller than the number of the first portion of data;
Disturbing the first data and equally dividing the first data into N data;
and selecting N-1 data in the N data in turn as a training set, and taking the remaining one data as a verification set.
The second data is used as a test set.
The training set is used for training the neural network model and determining parameters of the neural network model, the verification set is used for optimizing the parameters of the neural network model, and the test set is used for testing popularization capability of the trained neural network model. And selecting N-1 data in the N data in turn for training, verifying the rest data, calculating the prediction error square sum, and finally averaging the N prediction error square sums to be used as the basis for selecting the optimal model structure.
Because the historical data is divided into a training set, a verification set and a test set, the historical data is input into the preset neural network for training, and the training set is input into the preset neural network for training.
And the tag extraction module 206 is configured to extract, as the candidate data tag, an output of the specified layer of the preset neural network after the training is completed.
In this embodiment, if the obtained neural network model reaches the locally optimal solution in the process of training the preset neural network based on the historical data, the training process is considered to be finished. At this time, the output of the specified layer is extracted as a newly generated data tag.
In an alternative embodiment, the extracting module 206 extracts the output of the specified layer of the preset neural network as the candidate data tag includes:
acquiring the type of the preset neural network;
when the type of the preset neural network is a supervised learning network, extracting the output of the last layer as a candidate data tag;
and when the type of the preset neural network is an unsupervised learning network, extracting the output of the middle layer as a candidate data tag.
When the neural network is determined in advance, the determined type of the neural network may be set correspondingly.
In this embodiment, the types of the neural network are classified into two main types, one type is a supervised learning network, and the other type is an unsupervised learning network. If the supervised learning network is selected as the neural network prototype, historical data is taken as input, asset profitability, risk and the like are taken as training targets, and the result output by the last output layer is designated as a candidate data label. If the unsupervised learning network is selected as the neural network prototype, historical data is taken as input, the input and the output are as similar as possible as training targets, and the result output by the middle-most layer is designated as a candidate data label.
And the scoring module 207 is used for calculating the scoring result of the candidate data tag.
In this embodiment, after the output of the designated layer is extracted, the extracted candidate data labels need to be scored, and the input parameters of the preset neural network are adjusted according to the scoring result.
In an alternative embodiment, the scoring module 207 calculates the scoring result of the candidate data tag includes:
1) Calculating the pearson correlation coefficient of the candidate data tag and the target index;
the candidate data labels are ordered according to time sequences to obtain sequences P= { P1, P2, & gt, pt }, target index sequences are Q= { Q1, Q2, & gt, qt }, and pearson correlation coefficients of P and Q are calculated to obtain score1.
The pearson correlation coefficient between two variables is defined as the quotient of the covariance and standard deviation between the two variables. The pearson correlation coefficient is calculated as in the prior art, and the present invention is not specifically described.
2) Performing net value back measurement on the candidate data labels to obtain a summer ratio;
specifically, selecting partial data from the candidate data labels to carry out regression prediction, and calculating the summer ratio of the net value to be measured as score2. The present invention is not described in detail herein with respect to regression prediction as prior art.
The sharp Ratio (shappe Ratio) may take into account both revenue and risk, with a greater sharp Ratio indicating a higher risk return for the foundation unit risk.
3) Calculating the accuracy of the neural network model obtained after training;
after training of the historical data by the preset neural network is finished, testing the test passing rate of the neural network model at the end of training by using a test set, wherein the test passing rate is used as the accuracy of the neural network model and is recorded as score3.
4) Calculating an AUC value enclosed by the ROC curve and the coordinate axis;
after training of the historical data by the preset neural network is finished, an ROC curve is constructed, an AUC value surrounded by the ROC curve and the XY coordinate axis is calculated, and the AUC value is recorded as score4.
AUC (Area Under Curve) is defined as the area enclosed by the coordinate axis under the ROC curve, and the value range is between 0.5 and 1. The larger the AUC value is, the better the classification effect of the model obtained at the end of the training of the preset neural network is. The construction process of the ROC curve is prior art, and is not described in detail herein since the focus of the present invention is not in this regard.
5) And scoring results are obtained according to the pearson correlation coefficient, the summer ratio, the accuracy and the AUC value.
If the supervised learning network is selected as the preset neural network, calculating the scoring result of the candidate data labels according to the following formula:
scoru=w1×score1+w2×score2+w3×score3+w4×score4, wherein weights w1, w2, w3, w4 are preset values, and w1+w2+w3+w4=1.
If an unsupervised learning network is selected as a preset neural network, calculating a scoring result of the candidate data tag according to the following formula:
score=w1×score1+w2×score2, wherein weights w1, w2 are preset values, and w1+w2=1.
The retraining module 208 is configured to reinitialize the input parameters of the preset neural network according to the scoring result and perform a new training based on the new input parameters until a preset exploration period is reached.
In this embodiment, the neural network model obtained by each round of training correspondingly calculates a scoring result, and the input parameters of the neural network preset in the next round are reinitialized according to the scoring result of the previous round. When the neural network carries out the training of the neural network model of the next round based on the newly initialized input parameters, the neural network is optimized in a better direction, a new local optimal point is found, different data labels in the historical data are learned, and then candidate data labels are extracted from the trained neural network model.
In an alternative embodiment, the re-training module 208 re-initializes the input parameters of the preset neural network according to the scoring result includes:
randomly generating a set of exploration parameters for a next round;
calculating initial input parameters of the next round according to the exploration parameters;
training a neural network model of the next round based on the initial input parameters and calculating scoring results of the next round;
judging whether the scoring result of the next round is larger than the scoring result of the previous round;
if the scoring result of the next round is greater than the scoring result of the previous round, the initial input parameters are reserved;
and if the scoring result of the next round is smaller than or equal to the scoring result of the previous round, the initial input parameter is the initial input parameter of the previous round.
In an alternative embodiment, the initial input parameters for each round are calculated using the following formula:
θ t =αθ t ′+(1-αt)θ t-1 ,1<t<T,
wherein θ t ' is a set of exploration parameters randomly generated in the next round, T represents the round, T is the preset exploration period, and alpha is the attenuation coefficient.
Exemplary, assume that the first round initializes the input parameter θ 1 First round scoring result O calculated at training end 1 The input parameters at each subsequent iteration round are reinitialized based on the scoring results of the previous round, thereby generating final initial input parameters for the round for training the neural network model and extracting newly generated candidate data labels.
If the current round is t, randomly generating a group of exploration parameters theta t ' the initial input parameter of the t wheel is calculated as theta t =αθ t ′+(1-αt)θ t-1 . By theta t Retraining a preset neural network, and calculating a corresponding scoring result O at the end of training t If O t >O t-1 Then reserve θ t The method comprises the steps of carrying out a first treatment on the surface of the If O t <O t-1 Theta is then t =θ t-1 。
The exploration cycle is the time from exploration of new initialized input parameters and then training until the neural network model converges. Iteratively training the neural network model by changing the initialized input parameters, and generating the next iteration exploration parameters according to the last parameter exploration result until the set exploration period T is reached.
Preferably, the attenuation coefficient α=0.2, and the search period t=50.
In this embodiment, the set of exploration parameters for each round includes: the total layer number of the neural network, the dropout proportion and the weight distribution of the neural network. Wherein the total layer number of the neural network is randomly selected from a set of total layer numbers of the neural network, the dropout proportion is randomly selected from a set of dropout proportions, the neural network weight distribution is randomly selected from a set of neural network weight distribution,
exemplary, the number of layers of the neural network, m, is the data dimension of the input layer, R 1×N The data dimension of the output layer is R 1 ×M The maximum value of M is not more than N-M+1, and the set of M is { m|m epsilon [2, 51 ]]Sequentially increasing from m=2 until m=51. In order to fuse the input information of a plurality of characteristic labels, the input information is gradually decreased from an input layer to a layer, and a network with the neuron number being an arithmetic sequence is constructed. Each layer of neurons has a dimension { R 1×N ,R 1×(N-ski) ,R 1×(N-2sk) ,...,R 1×M Skip= (N-M)/(M-1).
For example, the dropout proportion set is {0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9}, the diversity of the network can be further improved through the dropout proportion, and the dropout value mode is equal interval sampling, for example {0.3,0.5,0.7,0.9}.
The set of neural network weight distributions is illustratively { constant, uniform, gaussian, truncated gaussian }.
Through the above sets, one parameter is selected from each set at will, and Cartesian product is carried out, so that 1600 types of super-parameter combinations can be obtained, and can be used as an iterator to train to obtain 1600 neural network models.
The label storing module 209 is configured to store the neural network model obtained by each round of training and the candidate data labels extracted from each round of neural network model.
In this embodiment, the neural network model is trained by continuously exploring new initial input parameters and based on the new initial input parameters until an exploration period is reached. And storing the initialization input parameters corresponding to the neural network model obtained by training in each iteration, so that the subsequent training data labels obtained again by adopting the initialization input parameters and the neural network model obtained by training can be used for carrying out profit or risk prediction and the like.
And when the training neural network model of each round is finished, extracting the output of the designated layer as the generated candidate data label and storing the candidate data label in a preset database. When the exploration period is reached, all extracted candidate data tags may be brought together.
The tag determining module 210 is configured to screen out the target data tag from the stored candidate data tags according to a preset screening condition.
The preset screening conditions are preset screening standards and can be set or adjusted according to actual requirements.
Illustratively, if future benefits of the target finance company are to be predicted, the screening conditions may be: calculating the correlation of each candidate data tag and the income of the target finance company; and eliminating candidate data labels with the correlation smaller than a preset correlation threshold.
In other embodiments, the screening conditions may further include: and eliminating a round of candidate data labels with scoring results smaller than the preset scoring results.
The candidate data labels after being removed are target data labels, and the target data labels can be used for predicting future stock prices, future receivability, risk identification, asset pricing and the like of target finance companies.
Preferably, in order to improve the generation efficiency of the candidate data tag, a neural network set may be preset, and a plurality of sub-threads are synchronously started, and a plurality of neural network models are trained in parallel through the plurality of sub-threads. Each sub-thread executes training of a neural network model based on the historical data, different sub-threads can preset the same neural network or preset different neural networks, and a main line control controls initial input parameters of all the sub-threads. The method includes the steps of starting 4 sub-threads synchronously, wherein the 1 st sub-thread is used for training a multi-layer sensor network model based on the historical data, the 2 nd sub-thread is used for training a long-short-term memory network model based on the historical data, the 3 rd sub-thread is used for training a convolution neural network model based on the historical data, the 4 th sub-thread is used for training a self-encoder network model based on the historical data, and the main thread is used for initializing input parameters of each neural network model. Because a plurality of sub-threads are synchronously started to execute training of a plurality of neural network models in parallel, the number of the extracted candidate data labels can be increased, and the efficiency of extracting the candidate data labels is improved, so that the number of the target data labels is increased, and the efficiency of generating the target data labels is improved.
In summary, according to the data tag generating device based on the neural network, the input parameters of the preset neural network are initialized, the history data are input into the preset neural network for training, and after training is finished, the output of the appointed layer of the preset neural network is extracted to serve as a candidate data tag; calculating the grading result of the candidate data labels; reinitializing the input parameters of the preset neural network according to the grading result and carrying out a new round of training based on the new input parameters; and storing the neural network model obtained by each round of training and the candidate data labels extracted from the neural network model, and finally screening target data labels from the candidate data labels. Compared with the traditional method, the method can obtain a large number of data labels in a short time, the generation efficiency of the data labels is far higher than that of the traditional processing method, and the technical problems of small quantity and low efficiency of the traditional generated data labels are solved; in addition, due to the nonlinear characteristics of the neural network, the obtained data labels are more diversified; because of the dynamic characteristics of the training neural network model, the generated data label has strong effectiveness and strong practicability.
Example III
Fig. 3 is a schematic structural diagram of a terminal according to a third embodiment of the present invention. In the preferred embodiment of the invention, the terminal 3 comprises a memory 31, at least one processor 32, at least one communication bus 33 and a transceiver 34.
It will be appreciated by those skilled in the art that the configuration of the terminal shown in fig. 3 is not limiting of the embodiments of the present invention, and that it may be a bus type configuration, a star type configuration, or a combination of hardware and software, or a different arrangement of components, as the terminal 3 may include more or less hardware or software than is shown.
In some embodiments, the terminal 3 is a device capable of automatically performing numerical calculation and/or information processing according to preset or stored instructions, and its hardware includes, but is not limited to, a microprocessor, an application specific integrated circuit, a programmable gate array, a digital processor, an embedded device, and the like. The terminal 3 may further comprise a client device, which includes, but is not limited to, any electronic product capable of performing man-machine interaction with a client through a keyboard, a mouse, a remote controller, a touch pad, a voice control device, etc., for example, a personal computer, a tablet computer, a smart phone, a digital camera, etc.
It should be noted that the terminal 3 is only used as an example, and other electronic products that may be present in the present invention or may be present in the future are also included in the scope of the present invention by way of reference.
In some embodiments, the memory 31 is used to store program codes and various data, such as devices installed in the terminal 3, and to enable high-speed, automatic access to programs or data during operation of the terminal 3. The Memory 31 includes Read-Only Memory (ROM), programmable Read-Only Memory (PROM), erasable programmable Read-Only Memory (EPROM), one-time programmable Read-Only Memory (One-time Programmable Read-Only Memory, OTPROM), electrically erasable rewritable Read-Only Memory (EEPROM), compact disc Read-Only Memory (Compact Disc Read-Only Memory, CD-ROM) or other optical disc Memory, magnetic tape Memory, or any other medium that can be used for computer-readable carrying or storing data.
In some embodiments, the at least one processor 32 may be comprised of an integrated circuit, for example, a single packaged integrated circuit, or may be comprised of multiple integrated circuits packaged with the same or different functions, including one or more central processing units (Central Processing unit, CPU), microprocessors, digital processing chips, graphics processors, combinations of various control chips, and the like. The at least one processor 32 is a control unit (control unit) of the terminal 3, connects the respective components of the entire terminal 3 using various interfaces and lines, and executes various functions of the terminal 3 and processes data by running or executing programs or modules stored in the memory 31 and calling data stored in the memory 31.
In some embodiments, the at least one communication bus 33 is arranged to enable connected communication between the memory 31 and the at least one processor 32 or the like.
Although not shown, the terminal 3 may further include a power source (such as a battery) for supplying power to the respective components, and preferably, the power source may be logically connected to the at least one processor 32 through a power management device, so as to perform functions of managing charging, discharging, power consumption management, etc. through the power management device. The power supply may also include one or more of any of a direct current or alternating current power supply, recharging device, power failure detection circuit, power converter or inverter, power status indicator, etc. The terminal 3 may further include various sensors, bluetooth modules, wi-Fi modules, etc., which will not be described herein.
It should be understood that the embodiments described are for illustrative purposes only and are not limited to this configuration over the scope of the patent application.
The integrated units implemented in the form of software functional modules described above may be stored in a computer readable storage medium. The software functional modules described above are stored in a storage medium and include instructions for causing a computer device (which may be a personal computer, a terminal, or a network device, etc.) or a processor (processor) to perform portions of the methods described in the various embodiments of the invention.
In a further embodiment, in connection with fig. 2, the at least one processor 32 may execute the operating means of the terminal 3 as well as various installed applications, program codes, etc., such as the various modules described above.
The memory 31 has program code stored therein, and the at least one processor 32 can invoke the program code stored in the memory 31 to perform related functions. For example, each of the modules depicted in fig. 2 is a program code stored in the memory 31 and executed by the at least one processor 32 to implement the functions of the respective module.
In one embodiment of the invention, the memory 31 stores a plurality of instructions that are executed by the at least one processor 32 to implement all or part of the steps of the method of the invention.
Specifically, the specific implementation method of the above instruction by the at least one processor 32 may refer to the description of the relevant steps in the corresponding embodiment of fig. 1, which is not repeated herein.
In the several embodiments provided by the present invention, it should be understood that the disclosed apparatus and method may be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the modules is merely a logical function division, and there may be other manners of division when actually implemented.
The modules described as separate components may or may not be physically separate, and components shown as modules may or may not be physical units, may be located in one place, or may be distributed over multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional module in the embodiments of the present invention may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units can be realized in a form of hardware or a form of hardware and a form of software functional modules.
It will be evident to those skilled in the art that the invention is not limited to the details of the foregoing illustrative embodiments, and that the present invention may be embodied in other specific forms without departing from the spirit or essential characteristics thereof. The present embodiments are, therefore, to be considered in all respects as illustrative and not restrictive, the scope of the invention being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. Any reference sign in a claim should not be construed as limiting the claim concerned. Furthermore, it will be obvious that the term "comprising" does not exclude other elements or that the singular does not exclude a plurality. A plurality of units or means recited in the apparatus claims can also be implemented by means of one unit or means in software or hardware. The terms first, second, etc. are used to denote a name, but not any particular order.
Finally, it should be noted that the above-mentioned embodiments are merely for illustrating the technical solution of the present invention and not for limiting the same, and although the present invention has been described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that modifications and equivalents may be made to the technical solution of the present invention without departing from the spirit and scope of the technical solution of the present invention.
Claims (7)
1. A data tag generation method based on a neural network, the method comprising:
acquiring historical data;
initializing input parameters of a preset neural network;
inputting the historical data into the preset neural network for training;
after training is finished, extracting the output of the designated layer of the preset neural network as a candidate data tag, wherein the method comprises the following steps: acquiring the type of the preset neural network; when the type of the preset neural network is a supervised learning network, extracting the output of the last layer as a candidate data tag; when the type of the preset neural network is an unsupervised learning network, extracting the output of the middle layer as a candidate data tag;
calculating a scoring result of the candidate data tag, including: calculating the pearson correlation coefficient of the candidate data tag and the target index; performing net value back measurement on the candidate data labels to obtain a summer ratio; calculating the accuracy of the neural network model obtained after training; calculating an AUC value enclosed by the ROC curve and the coordinate axis; scoring results according to the pearson correlation coefficient, the summer ratio, the accuracy and the AUC value;
Reinitializing the input parameters of the preset neural network according to the scoring result and performing a new training round based on the new input parameters until reaching a preset exploration period, wherein reinitializing the input parameters of the preset neural network according to the scoring result comprises: randomly generating a set of exploration parameters for a next round; calculating initial input parameters of the next round according to the exploration parameters; training a neural network model of the next round based on the initial input parameters of the next round and calculating a scoring result of the next round; judging whether the scoring result of the next round is larger than the scoring result of the previous round; if the scoring result of the next round is greater than the scoring result of the previous round, the initial input parameters are reserved; if the scoring result of the next round is smaller than or equal to the scoring result of the previous round, the initial input parameters are the initial input parameters of the previous round;
storing the neural network model obtained by each round of training and the candidate data labels extracted from each round of neural network model;
and screening target data labels from the stored candidate data labels according to preset screening conditions.
2. The method of claim 1, wherein the initial input parameters for each round are calculated using the formula:
θ t =αθ t ’+(1-αt)θ t-1 ,1<t<T,
Wherein θ t ' is a set of exploration parameters randomly generated in the next round, T represents the round, T is the preset exploration period, and alpha is the attenuation coefficient.
3. The method of any of claims 1-2, wherein prior to said inputting said historical data into said preset neural network for training, said method further comprises:
dividing the historical data into a first data part and a second data part, wherein the number of the second data part is smaller than that of the first data part;
disturbing the first data and equally dividing the first data into N data;
and selecting N-1 data in the N data in turn as a training set, and taking the remaining one data as a verification set.
4. The method according to any one of claims 1 to 2, wherein after the acquiring of the history data, the method further comprises:
preprocessing the historical data, wherein the preprocessing comprises the following steps: deleting empty data, removing extremum data, normalizing data, wherein,
the deleting the null data includes: filling 0 into incomplete data in the historical data or filling 0 into non-existing data;
the extremum removal data comprises: removing data positioned in the front K1 row and the rear K2 row in the historical data; and carrying out average calculation on the historical data to obtain average data, reducing the data which is larger than the preset first multiple of the average data in the historical data to the average data, and improving the data which is smaller than the preset second multiple of the average data in the historical data to the average data.
5. A neural network-based data tag generation apparatus, the apparatus comprising a module implementing the neural network-based data tag generation method of any one of claims 1 to 4, the apparatus comprising:
the data acquisition module is used for acquiring historical data;
the parameter initialization module is used for initializing input parameters of a preset neural network;
the model training module is used for inputting the historical data into the preset neural network for training;
the label extraction module is used for extracting the output of the appointed layer of the preset neural network as a candidate data label after training is finished;
the scoring calculation module is used for calculating scoring results of the candidate data labels;
the retraining module is used for reinitializing the input parameters of the preset neural network according to the scoring result and carrying out a new round of training on the basis of the new input parameters until a preset exploration period is reached;
the label storage module is used for storing the neural network model obtained by each round of training and the candidate data labels extracted from each round of neural network model;
and the tag determining module is used for screening target data tags from the stored candidate data tags according to preset screening conditions.
6. A terminal comprising a processor for implementing the neural network-based data tag generation method of any one of claims 1 to 4 when executing a computer program stored in a memory.
7. A computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the neural network-based data tag generation method of any one of claims 1 to 4.
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910974647.7A CN110888857B (en) | 2019-10-14 | 2019-10-14 | Data tag generation method, device, terminal and medium based on neural network |
PCT/CN2020/098885 WO2021073152A1 (en) | 2019-10-14 | 2020-06-29 | Data label generation method and apparatus based on neural network, and terminal and medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910974647.7A CN110888857B (en) | 2019-10-14 | 2019-10-14 | Data tag generation method, device, terminal and medium based on neural network |
Publications (2)
Publication Number | Publication Date |
---|---|
CN110888857A CN110888857A (en) | 2020-03-17 |
CN110888857B true CN110888857B (en) | 2023-11-07 |
Family
ID=69746177
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910974647.7A Active CN110888857B (en) | 2019-10-14 | 2019-10-14 | Data tag generation method, device, terminal and medium based on neural network |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN110888857B (en) |
WO (1) | WO2021073152A1 (en) |
Families Citing this family (29)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110888857B (en) * | 2019-10-14 | 2023-11-07 | 平安科技(深圳)有限公司 | Data tag generation method, device, terminal and medium based on neural network |
CN112434965A (en) * | 2020-12-04 | 2021-03-02 | 广东电力信息科技有限公司 | Expert label generation method, device and terminal based on word frequency |
CN113033758A (en) * | 2021-03-24 | 2021-06-25 | 北京航空航天大学 | Neural network performance evaluation method and system aiming at CT image classification |
CN113159444A (en) * | 2021-05-06 | 2021-07-23 | 国家电网有限公司 | Audit opinion prediction method and device based on deep cycle neural network |
CN113326177B (en) * | 2021-06-17 | 2024-07-26 | 深圳前海微众银行股份有限公司 | Index anomaly detection method, device, equipment and storage medium |
CN113570056A (en) * | 2021-06-23 | 2021-10-29 | 上海交通大学 | Method, system, medium, and electronic device for optimizing fault-tolerant neural network structure |
CN113457167A (en) * | 2021-06-29 | 2021-10-01 | 网易(杭州)网络有限公司 | Training method of user classification network, user classification method and device |
CN113407680B (en) * | 2021-06-30 | 2023-06-02 | 竹间智能科技(上海)有限公司 | Heterogeneous integrated model screening method and electronic equipment |
CN113782187B (en) * | 2021-09-10 | 2023-06-27 | 深圳平安智慧医健科技有限公司 | Index data processing method, related equipment and medium |
CN113780684A (en) * | 2021-10-15 | 2021-12-10 | 国网福建省电力有限公司龙岩供电公司 | Intelligent building user energy consumption behavior prediction method based on LSTM neural network |
CN113988205B (en) * | 2021-11-08 | 2022-09-20 | 福建龙净环保股份有限公司 | Method and system for judging electric precipitation working condition |
CN114372532B (en) * | 2022-01-11 | 2024-06-28 | 腾讯科技(深圳)有限公司 | Method, device, equipment, medium and product for determining label labeling quality |
CN114611400B (en) * | 2022-03-18 | 2023-08-29 | 河北金锁安防工程股份有限公司 | Early warning information screening method and system |
CN114673246B (en) * | 2022-03-31 | 2024-07-02 | 成都工贸职业技术学院 | Anti-blocking measuring method and measuring system for sewage pipeline |
CN114863554A (en) * | 2022-04-08 | 2022-08-05 | 哈尔滨工程大学 | Sign language recognition system and method based on deep learning model |
CN115127192B (en) * | 2022-05-20 | 2024-01-23 | 中南大学 | Semi-supervised water chilling unit fault diagnosis method and system based on graph neural network |
CN115130620B (en) * | 2022-08-31 | 2023-04-28 | 南方电网数字电网研究院有限公司 | Power equipment power utilization mode identification model generation method and device |
CN115891741B (en) * | 2022-09-30 | 2023-09-22 | 南京邮电大学 | Remote fault early warning method and device suitable for electric automobile charging process |
CN116189332B (en) * | 2022-10-20 | 2024-03-19 | 开源网安物联网技术(武汉)有限公司 | Vehicle health scoring method and device, electronic equipment and storage medium |
CN115374130B (en) * | 2022-10-26 | 2022-12-20 | 中科三清科技有限公司 | Atmospheric pollution historical data storage method and medium |
CN115786889B (en) * | 2023-02-13 | 2023-04-11 | 广州志橙半导体有限公司 | Data acquisition method and device of CVD (chemical vapor deposition) equipment |
CN116720728A (en) * | 2023-04-26 | 2023-09-08 | 广州地铁设计研究院股份有限公司 | Risk assessment method, electronic device and storage medium |
CN116505972B (en) * | 2023-06-27 | 2023-09-01 | 北京易桓科技有限公司 | Intelligent detection method and system for cable signal transmission |
CN117140847B (en) * | 2023-10-24 | 2023-12-29 | 南通佳腾精密模具有限公司 | Packaging method and system for precision die |
CN117272839B (en) * | 2023-11-20 | 2024-02-06 | 北京阿迈特医疗器械有限公司 | Support press-holding performance prediction method and device based on neural network |
CN117615359B (en) * | 2023-11-28 | 2024-07-02 | 广州视声智能股份有限公司 | Bluetooth data transmission method and system based on multiple rule engines |
CN118041577B (en) * | 2023-12-28 | 2024-07-19 | 广州视声智能科技有限公司 | Home data transmission method and system based on multiple agents |
CN118037046B (en) * | 2024-02-21 | 2024-06-21 | 广州番禺职业技术学院 | Asset data processing method and system based on history record |
CN118429085B (en) * | 2024-07-04 | 2024-10-01 | 盛业信息科技服务(深圳)有限公司 | Method and system for predicting receipt period of return money of hospital purchase invoice based on deep learning |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8321220B1 (en) * | 2005-11-30 | 2012-11-27 | At&T Intellectual Property Ii, L.P. | System and method of semi-supervised learning for spoken language understanding using semantic role labeling |
CN107220217A (en) * | 2017-05-31 | 2017-09-29 | 北京京东尚科信息技术有限公司 | Characteristic coefficient training method and device that logic-based is returned |
CN108875059A (en) * | 2018-06-29 | 2018-11-23 | 北京百度网讯科技有限公司 | For generating method, apparatus, electronic equipment and the storage medium of document label |
CN109190834A (en) * | 2018-09-12 | 2019-01-11 | 百色学院 | Stock price trend prediction method and system neural network based |
CN110009384A (en) * | 2019-01-07 | 2019-07-12 | 阿里巴巴集团控股有限公司 | Predict the method and device of operational indicator |
CN110276501A (en) * | 2019-06-28 | 2019-09-24 | 新奥数能科技有限公司 | The prediction technique and device of the electricity price of short term power trade market |
Family Cites Families (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20090132445A1 (en) * | 2007-09-27 | 2009-05-21 | Rice Daniel M | Generalized reduced error logistic regression method |
US8595153B2 (en) * | 2010-06-09 | 2013-11-26 | Microsoft Corporation | Exploring data using multiple machine-learning models |
CN108596393A (en) * | 2018-04-28 | 2018-09-28 | 国信优易数据有限公司 | A kind of training method and device of Electronic Finance resources model |
CN110888857B (en) * | 2019-10-14 | 2023-11-07 | 平安科技(深圳)有限公司 | Data tag generation method, device, terminal and medium based on neural network |
-
2019
- 2019-10-14 CN CN201910974647.7A patent/CN110888857B/en active Active
-
2020
- 2020-06-29 WO PCT/CN2020/098885 patent/WO2021073152A1/en active Application Filing
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8321220B1 (en) * | 2005-11-30 | 2012-11-27 | At&T Intellectual Property Ii, L.P. | System and method of semi-supervised learning for spoken language understanding using semantic role labeling |
CN107220217A (en) * | 2017-05-31 | 2017-09-29 | 北京京东尚科信息技术有限公司 | Characteristic coefficient training method and device that logic-based is returned |
CN108875059A (en) * | 2018-06-29 | 2018-11-23 | 北京百度网讯科技有限公司 | For generating method, apparatus, electronic equipment and the storage medium of document label |
CN109190834A (en) * | 2018-09-12 | 2019-01-11 | 百色学院 | Stock price trend prediction method and system neural network based |
CN110009384A (en) * | 2019-01-07 | 2019-07-12 | 阿里巴巴集团控股有限公司 | Predict the method and device of operational indicator |
CN110276501A (en) * | 2019-06-28 | 2019-09-24 | 新奥数能科技有限公司 | The prediction technique and device of the electricity price of short term power trade market |
Also Published As
Publication number | Publication date |
---|---|
WO2021073152A1 (en) | 2021-04-22 |
CN110888857A (en) | 2020-03-17 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110888857B (en) | Data tag generation method, device, terminal and medium based on neural network | |
CN110400022B (en) | Cash consumption prediction method and device for self-service teller machine | |
CN109598387A (en) | Forecasting of Stock Prices method and system based on two-way cross-module state attention network model | |
CN113435998B (en) | Loan overdue prediction method and device, electronic equipment and storage medium | |
CN113986561B (en) | Artificial intelligence task processing method and device, electronic equipment and readable storage medium | |
CN111340236A (en) | Bond default prediction method based on bond valuation data and integrated machine learning | |
CN118277838B (en) | Vehicle manufacturing quality defect detection method, device, electronic equipment and storage medium | |
CN118468061B (en) | Automatic algorithm matching and parameter optimizing method and system | |
CN115130894A (en) | Production planning method and device based on artificial intelligence, computer equipment and medium | |
CN112950344A (en) | Data evaluation method and device, electronic equipment and storage medium | |
CN113609295A (en) | Text classification method and device and related equipment | |
CN114579640A (en) | Financial time sequence prediction system and method based on generating type countermeasure network | |
Priscilla et al. | Baseline modeling for early prediction of loan approval system | |
CN114254762A (en) | Interpretable machine learning model construction method and device and computer equipment | |
CN113935413A (en) | Distribution network wave recording file waveform identification method based on convolutional neural network | |
CN112686470A (en) | Power grid saturation load prediction method and device and terminal equipment | |
Chang et al. | An ensemble of neural networks for stock trading decision making | |
CN113987351A (en) | Artificial intelligence based intelligent recommendation method and device, electronic equipment and medium | |
CN113537651A (en) | Financial time sequence prediction method, system and related equipment | |
Chua et al. | AI To Predict Price Movements in the Stock Market | |
Fu et al. | Quantitative trading strategy of market states prediction based on hmm | |
Varghese et al. | Candlestick chart based stock analysis system using ensemble learning | |
CN114036208B (en) | Model training and sensitivity analysis method, device, equipment and medium | |
CN117425020B (en) | Calculation method for natural flow index optimization promotion strategy of live broadcasting room | |
Mohamed Rida et al. | From Technical Indicators to Trading Decisions: A Deep Learning Model Combining CNN and LSTM. |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |