A method and device for predicting book weight interval

By constructing a decision tree and using the true value weight and characteristics of book test samples, the problem of high error rate and poor adaptability in setting book weight intervals in the existing technology is solved, and accurate weight prediction and interval adjustment of various books are achieved, improving for shipping and billing accuracy.

CN112101397BActive Publication Date: 2024-09-20BEIJING JINGDONG ZHENSHI INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN201910528040.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2019-06-18
Publication Date
2024-09-20
Estimated Expiration
2039-06-18

AI Technical Summary

Technical Problem

In the existing technology, the weight interval set for books based on the three-level classification of commodities has a high error rate and poor adaptability. It cannot adapt to a variety of books. When the weight of a book does not meet the set, manual adjustment is required, which is inefficient.

Method used

By constructing a decision tree for predicting book weight intervals, using the true weight and characteristics of a large number of book test samples, and selecting important features to construct a CART decision tree, accurate prediction and interval adjustment of various book weights can be achieved.

Benefits of technology

Improves the accuracy and adaptability of book weight predictions, reduces the need for manual adjustments, and improves shipping and billing accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112101397B
    Figure CN112101397B
Patent Text Reader

Abstract

The present invention discloses a method and device for predicting book weight intervals, and relates to the field of computer technology. A specific implementation of the method includes: obtaining multiple book training samples; the book training samples have one or more first features; selecting one or more second features from the first features according to the importance of the first features for predicting the book weight intervals; constructing a decision tree for predicting the book weight intervals according to the true weight of the book training samples and the second features; and using the decision tree to determine the weight interval of the book to be predicted according to the feature value of the second feature of the book to be predicted. This implementation reduces the error rate of artificially set weight intervals, improves the applicability of weight intervals to a variety of books, and thereby improves the accuracy of calculations such as book freight.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a method and device for predicting book weight intervals. Background Art

[0002] With the increase in the number of new books on the market, in order to better realize the transportation or distribution of books, determine the packaging method of books, calculate the transportation costs of books, etc., it is necessary to accurately measure the weight of books.

[0003] In order to reduce errors in the book collection process, weight ranges are often set for books based on the three-level classification of goods. The collected book weight is tested to see if it is within the set weight range to determine whether the collected book weight is available, thereby reducing freight losses or reputation losses caused by errors in book weight collection.

[0004] In the process of realizing the present invention, the inventors found that there are at least the following problems in the prior art: the weight range set for books according to the three-level classification of goods itself has a certain error rate and cannot adapt to a variety of books; and once the weight range of the book is set, even if it does not match the actual weight of the book, it can only be adjusted or updated manually, and the adaptability is poor. Summary of the invention

[0005] In view of this, an embodiment of the present invention provides a method and device for predicting book weight ranges, which can construct a decision tree for predicting book weight ranges based on the true weights and features of a large number of existing book test samples, so that the decision tree can be applied to the prediction of a variety of book weights, and the predicted book weight ranges have high accuracy.

[0006] To achieve the above-mentioned purpose, according to a first aspect of an embodiment of the present invention, a method for predicting book weight ranges is provided, comprising: obtaining a plurality of book training samples; the book training samples having one or more first features; selecting one or more second features from the first features according to the importance of the first features for predicting book weight ranges; constructing a decision tree for predicting book weight ranges according to the true weight of the book training samples and the second features; and determining the weight range of the book to be predicted using the decision tree according to the feature value of the second feature of the book to be predicted.

[0007] Optionally, selecting one or more second features from the first features according to the importance of the first features for predicting the book weight interval includes:

[0008] Selecting a predefined number of first features of the book training samples, and constructing a primary decision tree according to the true value weights of the book training samples and the selected predefined number of first features;

[0009] Calculating the sub-importance of each of the first features in each of the primary decision trees containing the first feature, and calculating the importance of the first feature for predicting the book weight interval according to the sub-importance of the first feature;

[0010] The predefined number of first features are selected in descending order of importance as the second features.

[0011] Optionally, calculating the sub-importance of each of the first features in each of the primary decision trees containing the first features includes:

[0012] For a first feature used to construct the primary decision tree, when the first feature has a first feature value, calculating a first error of a weight interval of a book test sample predicted by using the primary decision tree;

[0013] When the first feature has a second feature value, calculating a second error of predicting a weight interval of a book test sample using the primary decision tree;

[0014] The sub-importance of the first feature in the primary decision tree containing the first feature is calculated according to the first error and the second error.

[0015] Optionally, the importance of the first feature for predicting the weight of a book is an average value of the sub-importances of the first feature.

[0016] Optionally, the true value weight of the predicted book and the feature value of the second feature are recorded as the book training sample to update the decision tree.

[0017] Optionally, the decision tree for predicting book weight intervals is a CART decision tree.

[0018] To achieve the above object, according to a second aspect of an embodiment of the present invention, a device for predicting book weight intervals is provided, comprising: a book training sample acquisition module, a feature selection module, a decision tree construction module, and a weight interval prediction module; wherein:

[0019] The book training sample acquisition module is used to acquire a plurality of book training samples; the book training samples have one or more first features;

[0020] The feature selection module is used to select one or more second features from the first features according to the importance of the first features for predicting the book weight interval;

[0021] The decision tree construction module is used to construct a decision tree for predicting the book weight range according to the true value weight of the book training sample and the second feature;

[0022] The weight interval prediction module is used to determine the weight interval of the book to be predicted using the decision tree according to the feature value of the second feature of the book to be predicted.

[0023] To achieve the above-mentioned purpose, according to the third aspect of an embodiment of the present invention, a server for predicting book weight intervals is provided, comprising: one or more processors; a storage device for storing one or more programs, when the one or more programs are executed by the one or more processors, the one or more processors implement any of the methods described above in the method for predicting book weight intervals.

[0024] To achieve the above objective, according to a fourth aspect of an embodiment of the present invention, a computer-readable medium is provided, on which a computer program is stored, and when the program is executed by a processor, any of the methods described above in the method for predicting a book weight interval is implemented.

[0025] An embodiment of the above invention has the following advantages or beneficial effects: since a decision tree for predicting book weight ranges is constructed based on the true weights and features of a large number of existing book samples, the decision tree can be applied to the prediction of a variety of book weights; at the same time, the accuracy of the predicted book weight ranges is ensured by screening the features used to construct the decision tree.

[0026] The further effects of the above-mentioned non-conventional optional manner will be described below in conjunction with the specific implementation manner. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] The accompanying drawings are used to better understand the present invention and do not constitute an improper limitation of the present invention.

[0028] Figure 1 is a schematic diagram of the main process of the method for predicting book weight intervals according to an embodiment of the present invention;

[0029] Figure 2 is a schematic diagram of a characteristic path according to an embodiment of the present invention;

[0030] Figure 3 is a schematic diagram of the main process of the method for selecting the second feature according to an embodiment of the present invention;

[0031] Figure 4a is a schematic diagram of a method for calculating sub-importance according to an embodiment of the present invention;

[0032] Figure 4b is a schematic diagram of a method for calculating importance according to an embodiment of the present invention;

[0033] Figure 5is a schematic diagram of main modules of an apparatus for predicting book weight intervals according to an embodiment of the present invention;

[0034] Figure 6 is an exemplary system architecture diagram to which embodiments of the present invention may be applied;

[0035] Figure 7 It is a schematic diagram of the structure of a computer system of a terminal device or a server suitable for implementing an embodiment of the present invention. DETAILED DESCRIPTION

[0036] The following is a description of exemplary embodiments of the present invention in conjunction with the accompanying drawings, including various details of the embodiments of the present invention to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present invention. Similarly, for clarity and conciseness, the description of well-known functions and structures is omitted in the following description.

[0037] See also Figure 1 The embodiment of the present invention provides a method for predicting the weight interval of a book, which may specifically include the following steps:

[0038] Step S101, obtaining a plurality of book training samples; the book training samples have one or more first features.

[0039] The book training samples can be obtained through various channels such as manual collection and network extraction. Each book training sample has one or more first features, and the book training sample has a true value weight, that is, the true weight of each book training sample is known. The first feature includes one or more of the following: the type, number of pages, paper type, size, publisher, author, publication date, word count, book number, edition, and printing of the book sample.

[0040] Step S102: selecting one or more second features from the first features according to the importance of the first features for predicting the book weight range.

[0041] Each book training sample has multiple first features, but not every feature is related to the weight of the book, that is to say, different first features have different effects on the weight of the book, such as the publication date, publisher, author, etc. have basically no effect on the weight of the book; while the number of pages, number of words, paper type, size, etc. have a greater impact on the weight of the book. Therefore, the amount of calculation when constructing the decision tree can be reduced, the efficiency of building the decision tree can be improved, and the first features can be screened, and the features that have a greater impact on the weight of the book can be selected as the second feature. Specifically, the first feature can be screened by artificially judging the importance of the first feature for predicting the weight interval of the book, such as artificially judging the number of pages, number of words, paper type, size, etc. based on experience that the first features have a greater impact on the weight of the book, then the number of pages, number of words, paper type, size, etc. are determined as the second feature; in addition, it can also be screened in any other way, such as setting the rules for calculating the importance of the first feature for predicting the weight interval of the book, and directly selecting the first feature as the second feature according to the importance of the calculation.

[0042] Step S103, constructing a decision tree for predicting the book weight range according to the true weight of the book training sample and the second feature.

[0043] The true weight of the book training sample is the correct real weight of the book training sample. It is understandable that a variety of algorithms can be used to construct a decision tree for the book weight interval, such as ID3 algorithm, CART algorithm, C4.5 algorithm, etc. The constructed decision trees include but are not limited to CART decision tree (classification and regression tree), random forest, gradient boosting decision tree (GBDT, Gradient Boosting Decision Tree), etc.

[0044] Specifically, see Figure 2 , take the decision tree for predicting the weight interval of a book as an example, the CART decision tree. According to the true weight corresponding to the second feature of the book training sample (such as the number of pages, paper type, size, etc.), determine the maximum and minimum values ​​of the true weight, and divide the weight range composed of the maximum and minimum values ​​into one or more weight intervals; then, use the Gini index or any one of the information gain and information gain ratio to determine the characteristic path and the corresponding weight interval of the CART decision tree, and then complete the construction of the decision tree. For example, when the characteristic path, that is, the corresponding weight interval, is determined by the information gain ratio, the weight interval with the largest information gain ratio can be selected as the weight interval corresponding to the characteristic path, and finally the following is formed. Figure 2 The characteristic path described.

[0045] Step S104, according to the feature value of the second feature of the book to be predicted, using the decision tree to determine the weight range of the book to be predicted.

[0046] After constructing a decision tree for predicting the weight of books, the decision tree can be used to predict the weight range of any book according to actual needs. For example, in the warehousing and logistics link, the books that need to be billed or put into storage according to the weight of the books are predicted, and then the correctness of the collected book weight can be judged by whether the collected book weight falls within the predicted weight range. Specifically, the second feature and the corresponding feature value of the book to be predicted can be obtained by scanning or reading the book number, i.e., the ISBN code of the book to be predicted, and then the decision tree that has been constructed for predicting the weight range of books is called according to the obtained second feature, and the weight range is predicted according to the specific feature value.

[0047] In an optional implementation, the true weight of the predicted book and the characteristic value of the second feature are recorded as the book training sample to update the decision tree. It is understandable that due to the increasing number of new books on the market, in order to ensure the effectiveness and accuracy of the weight interval predicted by the decision tree, the book to be predicted can be used as a book training sample for constructing a decision tree, that is, the true weight of the book to be predicted and the second feature are used to update the decision tree. At the same time, due to the gradual increase in the number of book training samples, in order to further improve the accuracy of the predicted weight interval, the corresponding weight interval is increased when establishing the decision tree, that is, the distance between the weight intervals is reduced. Specifically, refer to Figure 2 , where the weight intervals corresponding to the feature path are (150g, 200g], (250g, 300g], and the distance between the two weight intervals (i.e., the difference between 250 and 200) is 50; as the number of subsequent book training samples gradually increases, the two weight intervals (150g, 200g], (250g, 300g] can be re-divided into 3 or more weight intervals, such as dividing into 3 weight intervals, (150g, 190g], (205g, 245g], (260g, 300g], then the distance between each weight interval is only 15.

[0048] Based on the above embodiments, the method for predicting book weight ranges provided by the present invention can not only use decision trees to predict weight ranges of various books, but also add the true weights and features corresponding to the predicted books to book training samples, and update the decision tree for predicting book weights in real time, so that more and more types of books are used in the decision tree, and the predicted book weight ranges are becoming more and more accurate.

[0049] See also Figure 3 Based on the above embodiment, the embodiment of the present invention provides a method for selecting a second feature, which may specifically include the following steps:

[0050] Step 1021, select a predefined number of first features of the book training samples, and construct a primary decision tree according to the true value weight of the book training samples and the selected predefined number of first features.

[0051] The number of primary decision trees constructed can be one or more. In the case of constructing multiple primary decision trees, a predefined number of first features of the book training samples are reselected each time to reconstruct different primary decision trees. The total number of primary decision trees constructed can be any number set according to actual needs. For example, taking the total number of first features as 10 and the predefined number as 5 as an example, the number of primary decision trees can be any value such as 1, 2, 3, etc. In addition, it can also be determined based on the full permutation of the predefined number 5 for the total number of first features 10, and the number of primary decision trees constructed is 252.

[0052] The predefined number can be any value not greater than the total number of first features. For example, if the number of first features of the book training sample is still 10, the predefined number can be any value not greater than 10. Taking the example of the number of first features being 10 and the predefined number being 5, 5 first features can be randomly selected from the 10 first features at one time, or 5 first features can be selected from the 10 first features with replacement. After the 5 first features are determined, a primary decision tree is constructed based on the true weight of the book training sample and the 5 first features. It can be understood that a variety of algorithms can be used to construct a primary decision tree, such as the ID3 algorithm, the CART algorithm, the C4.5 algorithm, etc. The constructed decision trees include but are not limited to CART decision trees (classification and regression trees), random forests, gradient boosting decision trees, etc.

[0053] Step 1022, calculating the sub-importance of each of the first features in each of the primary decision trees containing the first features, and calculating the importance of the first feature for predicting the book weight range based on the sub-importance of the first feature.

[0054] In an optional embodiment, the importance of the first feature for predicting the weight of the book is the average value of the sub-importances of the first feature. It is understandable that the importance of the first feature for predicting the weight of the book can be any one of the average value, maximum value, and minimum value of the sub-importances, or can be calculated by summing the sub-importances.

[0055] In an optional embodiment, calculating the sub-importance of each of the first features in each of the primary decision trees containing the first feature includes: for the first feature used to construct the primary decision tree, when the first feature has a first eigenvalue, calculating a first error of predicting the weight interval of a book test sample using the primary decision tree; when the first feature has a second eigenvalue, calculating a second error of predicting the weight interval of a book test sample using the primary decision tree; and calculating the sub-importance of the first feature in the primary decision tree containing the first feature based on the first error and the second error.

[0056] Among them, the first eigenvalue and the second eigenvalue are different values ​​of the first feature. The value of the first eigenvalue can be randomly changed to obtain the second eigenvalue, or two possible values ​​of the first feature can be randomly selected as the first eigenvalue and the second eigenvalue respectively. It can be understood that the value of the first feature can be the number of pages of a book, such as 200 pages, 400 pages and other specific values, or it can be a paper type, such as newsprint, coated paper, dictionary paper and other specific text descriptions. The first error and the second error are the errors that exist when the primary decision tree is used to predict the weight interval of the book test sample when the first feature has different values. Specifically, it can be judged by whether the true weight of the book test sample falls within the predicted weight interval. For example, taking the first error as an example, if the true weight of 90% of the book test samples falls within the weight interval predicted by the primary decision tree, the accuracy of the primary decision tree predicting the book weight interval is 90%, and the corresponding first error is 10%.

[0057] It can be understood that in order to more accurately evaluate the first error and the second error of predicting the book weight interval using the primary decision tree, the selected book test samples should be different from the book training samples used to construct the primary decision tree, where the book test samples are also called out-of-bag samples. In other words, before constructing the primary decision tree, all available book samples need to be divided into book training samples and book test samples. Specifically, any possible method can be used to divide the book training samples and book test samples according to actual needs, such as: randomly selecting 2 / 3 from the book samples as book training samples, and the remaining 1 / 3 is the book test sample; or sampling with replacement, selecting multiple times from the book samples to form a book training sample, and using the unselected ones to form a book test sample, etc.

[0058] Specifically, see Figure 4a and Figure 4b, the first error and the second error are calculated by randomly changing the eigenvalue of the first feature in the primary decision tree. The value of the first feature before the change is the first eigenvalue, and the first error is calculated accordingly. The value of the first feature after the change is the second eigenvalue, and the second error is calculated accordingly. Among them, since the first error and the second error are obtained using book test samples, that is, out-of-bag samples, they can also be called out-of-bag errors. More specifically, see Figure 4a , take the example of selecting 2 / 3 (i.e. 200) of 300 book samples as book training samples and the remaining 1 / 3 (i.e. 100) as book test samples, use 200 book training samples to build a primary decision tree, then use the primary decision tree to predict the weight interval of each of the 100 book test samples, and judge whether the true weight of the book test sample falls within the corresponding weight interval predicted by the primary decision tree, and determine the first error or the second error according to the accuracy of the true weight of all book test samples falling into the weight interval. For example, when 80 of the true weights of 100 book test samples fall within the weight interval predicted by the primary decision tree, the accuracy of the primary decision tree in predicting the book weight interval is 80%, and the corresponding error is 20%. See Figure 4b , taking the first feature A1 (such as the number of book pages) for predicting the importance of book weight as the average value of the sub-importance as an example, when the value of the first feature A1 in the primary decision tree 1 (i.e. the specific value of the number of book pages, such as 200 pages) does not change, the primary decision tree 1 is used to predict the weight interval of the book test sample, and the first error errOOB of the true value weight falling into the weight interval is calculated. 1 After randomly changing the value of the first feature A1 (i.e. changing the specific value of the number of book pages, such as changing from 200 pages to 250 pages), calculate the weight interval of the book test sample predicted by the primary decision tree 1, and calculate the second error errOOB when the true value weight falls into the weight interval 2 ; Then the importance of the first feature A1 in the primary decision tree 1 can be calculated using the following formula:

[0059] Sub-importance of the first feature A1 = |errOOB 1 -errOOB 2 |

[0060] Among them, errOOB 1 is the first error when the value of the first feature in the primary decision tree does not change, errOOB 2 is the second error after the value of the first feature in the primary decision tree is changed. Based on this, the sub-importance of any first feature Ai can be calculated, and the importance of any first feature Ai for predicting the book weight interval can be calculated using the following formula:

[0061]

[0062] Among them, MDA(Ai) is the importance of the first feature Ai for predicting the book weight interval, and ntree represents the number of times the first feature Ai appears in all primary decision trees, that is, the number of primary decision trees containing the first feature Ai. t1 Represents the out-of-bag error (i.e., the first error) after the eigenvalue of the first feature Ai in the t-th tree is changed, errOOB t2 It represents the out-of-bag error (i.e., the second error) before the eigenvalue of the first feature Ai in the t-th tree is changed.

[0063] Step 1023: Select the predefined number of first features as the second features in descending order of importance.

[0064] It can be understood that the first features Ai can be sorted according to their importance for predicting the book weight interval and a predefined number (5 for example) of first features can be selected as the second features at one time, or they can be selected in batches according to the importance, such as:

[0065] According to the order of importance, one or more first features with the lowest importance are eliminated from all primary decision trees to form a new primary decision tree; then the importance of each first feature in the new primary decision tree for predicting the book weight interval is recalculated, and one or more first features with the lowest importance are continued to be eliminated; and so on, until the number of first features contained in all primary decision trees reaches a predefined number (i.e., 5), then the 5 first features contained in the primary decision tree at this time are selected as the second features to construct a decision tree for predicting the book weight interval.

[0066] See also Figure 5 The embodiment of the present invention provides a device 500 for predicting book weight intervals, comprising a book training sample acquisition module 501, a feature selection module 502, a decision tree construction module 503, and a weight interval prediction module 504; wherein the book training sample acquisition module 501 is used to acquire multiple book training samples; the book training samples have one or more first features; the feature selection module 502 is used to select one or more second features from the first features according to the importance of the first features for predicting book weight intervals; the decision tree construction module 503 is used to construct a decision tree for predicting book weight intervals according to the true weight of the book training samples and the second features; the weight interval prediction module 504 is used to determine the weight interval of the book to be predicted using the decision tree according to the feature value of the second feature of the book to be predicted.

[0067] Figure 6 An exemplary system architecture 600 is shown to which the method for predicting book weight intervals or the apparatus for predicting book weight intervals according to the embodiments of the present invention can be applied.

[0068] like Figure 6 As shown, system architecture 600 may include terminal devices 601, 602, 603, network 604 and server 605. Network 604 is used to provide a medium for communication links between terminal devices 601, 602, 603 and server 605. Network 604 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.

[0069] The user can use the terminal devices 601, 602, 603 to interact with the server 605 through the network 604 to receive or send messages, etc. Various communication client applications can be installed on the terminal devices 601, 602, 603, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc.

[0070] The terminal devices 601 , 602 , and 603 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, and desktop computers, etc.

[0071] The server 605 may be a server that provides various services, such as a backend management server (only an example) that provides support for shopping websites browsed by users using the terminal devices 601, 602, and 603. The backend management server may analyze and process the received data such as product information query requests, and feed back the processing results (predicted weight ranges of books) to the terminal device.

[0072] It should be noted that the method for predicting book weight intervals provided in the embodiment of the present invention is generally executed by the server 605 , and accordingly, the device for predicting book weight intervals is generally disposed in the server 605 .

[0073] It should be understood that Figure 6 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.

[0074] Reference below Figure 7 , which shows a schematic diagram of the structure of a computer system 700 of a terminal device suitable for implementing an embodiment of the present invention. Figure 7 The terminal device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.

[0075] like Figure 7As shown, the computer system 700 includes a central processing unit (CPU) 701, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 702 or a program loaded from a storage part 708 into a random access memory (RAM) 703. In the RAM 703, various programs and data required for the operation of the system 700 are also stored. The CPU 701, the ROM 702, and the RAM 703 are connected to each other via a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.

[0076] The following components are connected to the I / O interface 705: an input section 706 including a keyboard, a mouse, etc.; an output section 707 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 708 including a hard disk, etc.; and a communication section 709 including a network interface card such as a LAN card, a modem, etc. The communication section 709 performs communication processing via a network such as the Internet. A drive 710 is also connected to the I / O interface 705 as needed. A removable medium 711, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 710 as needed, so that a computer program read therefrom is installed into the storage section 708 as needed.

[0077] In particular, according to the embodiments disclosed in the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present invention include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 709, and / or installed from the removable medium 711. When the computer program is executed by the central processing unit (CPU) 701, the above-mentioned functions defined in the system of the present invention are executed.

[0078] It should be noted that the computer-readable medium shown in the present invention may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present invention, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.

[0079] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0080] The modules involved in the embodiments of the present invention may be implemented by software or hardware. The modules described may also be set in a processor, for example, it may be described as: a processor includes a book training sample acquisition module, a feature selection module, and a decision tree construction module. The names of these modules do not constitute a limitation on the modules themselves in some cases, for example, the decision tree construction module may also be described as a "module for constructing a decision tree for predicting book weight intervals".

[0081] As another aspect, the present invention also provides a computer-readable medium, which may be included in the device described in the above embodiment; or it may exist independently without being assembled into the device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by a device, the device includes: obtaining multiple book training samples; the book training samples have one or more first features; according to the importance of the first features for predicting the book weight interval, one or more second features are selected from the first features; according to the true weight of the book training samples and the second features, a decision tree for predicting the book weight interval is constructed; according to the true weight of the book training samples and the second features, a decision tree for predicting the book weight interval is constructed.

[0082] According to the technical solution of the embodiment of the present invention, not only can the decision tree be used to predict the weight ranges of various books, but the true weights and features corresponding to the predicted books can also be added to the book training samples, and the decision tree for predicting the book weight can be updated in real time, so that more and more types of books can be used by the decision tree, and the predicted book weight ranges can be more and more accurate.

[0083] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A method for predicting book weight intervals, characterized in that: include: Acquire a plurality of book training samples; the book training samples have one or more first features; According to the importance of the first feature for predicting the book weight interval, one or more second features are selected from the first feature, including: selecting a predefined number of first features of the book training sample, and constructing a primary decision tree according to the true weight of the book training sample and the selected predefined number of first features; calculating the sub-importance of each of the first features in each of the primary decision trees containing the first feature, and calculating the importance of the first feature for predicting the book weight interval according to the sub-importance of the first feature; selecting the predefined number of first features in descending order of importance as the second features; Constructing a decision tree for predicting the weight interval of a book according to the true weight of the book training sample and the second feature, including: determining the maximum value and the minimum value of the true weight according to the true weight corresponding to the second feature of the book training sample, and dividing the weight range formed by the maximum value and the minimum value into one or more weight intervals; determining the characteristic path of the decision tree and the corresponding weight interval by any one of an index or information gain and an information gain ratio; The decision tree is used to determine the weight interval of the book to be predicted according to the feature value of the second feature of the book to be predicted.

2. The method for predicting book weight intervals according to claim 1, characterized in that: The calculating the sub-importance of each of the first features in each of the primary decision trees containing the first features includes: For a first feature used to construct the primary decision tree, when the first feature has a first feature value, calculating a first error of a weight interval of a book test sample predicted by using the primary decision tree; When the first feature has a second feature value, calculating a second error of predicting a weight interval of a book test sample using the primary decision tree; The sub-importance of the first feature in the primary decision tree containing the first feature is calculated according to the first error and the second error.

3. The method for predicting book weight intervals according to claim 2, characterized in that: The importance of the first feature for predicting the weight of a book is an average value of the sub-importances of the first feature.

4. The method for predicting book weight intervals according to claim 1, characterized in that: The true value weight of the predicted book and the feature value of the second feature are recorded as the book training sample to update the decision tree.

5. The method for predicting book weight intervals according to claim 1, characterized in that: The decision tree used to predict the book weight interval is a CART decision tree.

6. A device for predicting book weight intervals, characterized in that: include: Book training sample acquisition module, feature selection module, decision tree construction module, weight interval prediction module; among them, The book training sample acquisition module is used to acquire a plurality of book training samples; the book training samples have one or more first features; The feature selection module is used to select one or more second features from the first features according to the importance of the first features for predicting the book weight interval, including: selecting a predefined number of first features of the book training samples, and constructing a primary decision tree according to the true weight of the book training samples and the selected predefined number of first features; calculating the sub-importance of each of the first features in each of the primary decision trees containing the first features, and calculating the importance of the first feature for predicting the book weight interval according to the sub-importance of the first feature; selecting the predefined number of first features in the order of the importance from high to low as the second features; The decision tree construction module is used to construct a decision tree for predicting the book weight range according to the true weight of the book training sample and the second feature, including: determining the maximum value and the minimum value of the true weight according to the true weight corresponding to the second feature of the book training sample, and dividing the weight range composed of the maximum value and the minimum value into one or more weight ranges; determining the characteristic path of the decision tree and the corresponding weight range by any one of an index or information gain and an information gain ratio; The weight interval prediction module is used to determine the weight interval of the book to be predicted using the decision tree according to the feature value of the second feature of the book to be predicted.

7. A server for predicting book weight intervals, characterized in that: include: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 5.

8. A computer readable medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 5 is implemented.