The breakthrough point

At present, AI is only used to learn some rules from historical data. In business, it is only used to reduce human intervention. Therefore, to introduce neural network into business system, in fact, it is mainly to find a breakthrough point.

Simply put, you can visit front-line users to see where they spend the most time in the system, what they do frequently, and you can use statistical logs to find the right entry point.

Understand the problem

  • Business problem to solve: Predict a category.
  • The information pipeline involved in the problem: XX.
  • Data source and collection method: Data source is on XX service system and can be obtained from related APIS.
  • Is the data regular or real-time: Regular & real-time.
  • Valuable factors influencing the model: Consulting business experts to provide preliminary model characteristics.
  • Workload: Project planning.

Data preprocessing

  • Filter the data records that do not meet the conditions.
  • Null fill, fill 0, or other fill measure.
  • Standardized processing of data.
  • String set tagging.

Sample statistics

Conduct statistical analysis on samples to see how many samples are available. For general classification tasks, the number of samples for each classification can generally range from thousands to tens of thousands. Also check for sample imbalances, and if so, balance them, for example by up-sampling.

The model definition

Define a model, such as a traditional multi-layer neural network, with two hidden layers and 100 neurons each.

Make the input attribute1, attribute2… , the output is the category number.

The loss function is optional: TANH, Logistic or RELU.

The optimization method can be: gradient descent method or Adam.

Model training

  • The whole dataset was divided into two groups with a ratio of 8:2. The first group was the training set, which was used to adjust model parameters. The second group is the test set, which is used to test the accuracy of the model obtained by training.
  • The maximum number of iterations is 10000.
  • Batch size is 200.
  • Improved tolerance to 1E-8.
  • Standardize the initial weights.

Model iteration

The effect of the model requires constant analysis of features, selection or generation of more valuable features, and continuous optimization of the model effect. Such as

  • V0.1 selects several data features as input by feeling, and the effect may be poor.
  • V0.2 consulted business experts and combined their advice to use or generate more valuable features. Precision, Recall, and F1-Score were all improved due to the addition of certain attributes and the extraction of useful features from additional systems.
  • V0.3 has not been able to directly find valuable features, so it can be considered to introduce natural language processing to analyze some texts, using features such as word vector and TFIDF. Precision, recall and F1-Score all reach over 90%.
version precision recall f1-score
v0.1 0.52 0.59 0.54
v0.2 0.83 0.82 0.81
v0.3 0.91 0.90 0.90

Online deployment

You can deploy the model in the following ways.

  • For example, the business system is generally developed in Java, while the models are mostly developed in Python. However, the performance of Java is not good after the concurrency of Python. Otherwise, Java will be used as the model and jar will be provided.
  • Independent model deployment, the model system is open to the outside world in the form of services, accessed by business systems, to achieve decoupling effect, but in some cases will lead to a heavy system architecture.
  • In background deployment, the model system accesses the business data layer directly and writes the predicted results back to the business data persistence.

————- Recommended reading ————

Summary of my open Source projects (Machine & Deep Learning, NLP, Network IO, AIML, mysql protocol, Chatbot)

Why to write “Analysis of Tomcat Kernel Design”

2018 summary data structure algorithms

2018 Summary machine learning

2018 Summary Java in Depth

2018 Summary of natural language processing

2018 Summary of deep learning

2018 summary JDK source code

2018 Summary Java concurrency Core

2018 summary reading passage


Talk to me, ask me questions:

Welcome to: