How to convert trained data (feature extracted) into a prediction model? Background:


I am analyzing and labeling some log data. (parsed already, sample data below)
I have extracted the major features of data.

For examples, the classification results ("1 - normal" or "0 - anomaly") largely depends on columns "duration", "mean", "std". For example,


records/sec usually &lt;= 10
std usually &lt; 0.5   , etc

Then I want to convert current result into a prediction model, in order to classify the future log data.


Sample data:

| ID |        datetime       | No. of Records | duration(s) |  mean | std  |  labels |
| 1  |  26/7/2019 8:06:00 PM |       5        |     1.0     |  0.33 | 0.47 |  normal |
| 2  |  ...                                                                | anomaly |
...
| 1,000,000 |  ...                                                         |  normal |


Question:


How to convert such parsed &amp; feature extracted &amp; labelled data into a prediction mode (or prediction function)?

I am NOT asking the theory. I have read some articles or projects of machine learning models. But many of them introduces too high-level. I still don't understand how to implement those machine learning models. I need to convert them into a real prediction function running in the computer.

I am asking the detailed / hands-on implementation steps. Maybe it becomes a call function f(x1, x2, x3, ...) or API in the code? The new data may be the input of a function call? The output will be normal or anomaly in this case.
In other words, how to present a prediction model in the form of code?
This question is insanely broad… you should better go for an API documentation/tutorial... Python is usually the preferred porgramming language and two major API are used: scikit-learn for machine learning and Keras/tensorflow for Deep learning… (but there are quite a few more)

I'll give you some links... You should firstly consult these kind of sources of information and coming here later on with more specific and detailed issues.


Scikit-learn examples:

https://scikit-learn.org/0.20/auto_examples/plot_anomaly_comparison.html (for your problem)

https://towardsdatascience.com/5-powerful-scikit-learn-models-e9b12375320d (general)
Really good blog with Machine/Deep Learning examples:

https://machinelearningmastery.com/blog/

https://machinelearningmastery.com/introduction-python-deep-learning-library-keras/