In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces the difference between the algorithm and the model in machine learning, which has a certain reference value. Interested friends can refer to it. I hope you will gain a lot after reading this article.
What is the "algorithm" in machine learning?
The "algorithm" in machine learning is the process of running on data to create a machine learning "model".
Machine learning algorithms perform "pattern recognition". The algorithm "learns" from the data or "fits" the data set.
There are many machine learning algorithms. For example, we have classification algorithms, such as K-nearest neighbor algorithm, regression algorithms, such as linear regression, clustering algorithms, such as K-means algorithm.
Here is an example of a machine learning algorithm:
Linear regression.
Logical regression
Decision tree
Artificial neural network
K-nearest neighbor
K-mean
You can think of machine learning algorithms as any other algorithm in computer science.
For example, some other types of algorithms that you may be familiar with include bubble sorting for data sorting and optimal prioritization for search.
Therefore, machine learning algorithms have many characteristics:
Machine learning calculation can be described by mathematics and pseudocode.
The efficiency of machine learning algorithm can be analyzed and described.
Machine learning algorithms can be implemented in any modern programming language.
For example, you may see machine learning algorithms described in pseudocode or linear algebra in research papers and textbooks. You can see the computational efficiency of one particular machine learning algorithm compared to another feature algorithm.
Academia can design holographic machine learning algorithms, and machine learning practitioners can use standard machine learning algorithms in their projects. Like other areas of computer science, scholars can design new sorting algorithms, and programmers can use standard sorting algorithms in applications.
You may also see multiple machine learning algorithms implemented and provided in a library with standard API. A popular example is the scikit-learn library, which provides the implementation of many machine learning algorithms for classification, regression, and clustering in Python.
What is the "model" in machine learning?
The "model" in machine learning is the output of machine learning algorithms that run on data.
The model represents what machine learning algorithms have learned.
A model is a "thing" saved after running a machine learning algorithm on the training data. it represents the rules, numbers, and any other algorithm-specific data structures needed to make predictions.
Let me give you some examples that may make this more clear:
The result of linear regression algorithm is a model composed of sparse vectors with specific values.
The result of the decision tree algorithm is a model composed of if-then statement trees with specific values.
The neural network / back propagation / gradient descent algorithm produces a model composed of a vector or weight matrix with a specific value and a graph structure with a specific value.
The machine model is more challenging for beginners because it has no clear analogy with other algorithms in computer science.
For example, the sorted list output of a sorting algorithm is not a real model.
The best analogy is to think of a machine learning model as a "program".
The machine learning model "program" consists of data and the process of using data for prediction.
For example, consider the linear regression algorithm and the resulting model. The model consists of coefficient (data) vectors, which are multiplied and summed by a row of new data as input for prediction (prediction process).
We save the data as a machine learning model for later use.
We often use the prediction process of machine learning models provided by machine learning libraries. Sometimes we can implement the prediction process ourselves as part of our application. This is usually straightforward, considering that most forecasting processes are very simple.
Algorithm and model framework
Now we are familiar with the "algorithm" and "model" of machine learning.
Specifically, it is to run algorithms on the data to create a model.
Machine learning = > machine learning model
We also learned that the model consists of data and the process of how to use it to predict new data. You can also think of this process as a prediction algorithm if you like.
Machine learning model = = model data + prediction algorithm
This distinction is very helpful in understanding a wide range of algorithms.
For example, most algorithms do all the work in the "algorithm", while the "prediction algorithm" does little work.
In general, the algorithm is some kind of optimization program, that is, to minimize the error of the model (data + prediction algorithm) on the training data set. Linear regression algorithm is a good example. It performs an optimization process (or uses linear algebra to analyze and solve), finds a set of weights, and minimizes the sum of squares of errors on the training data set.
Linear regression.
Algorithm: find the coefficient set with the least error on the training data set.
Model:
Model data: the whole training data set.
Prediction algorithm: find out the K most similar rows and take the average of their target variables.
Some algorithms are trivial or even do nothing, and all the work is in the model or prediction algorithm.
The K-nearest neighbor algorithm has no other algorithms except to save the whole training data set. Therefore, the awakening data is the whole training data set, and all the work is in the prediction algorithm, that is, how a row of new data interacts with the saved training data set to make a prediction.
K-nearest neighbor
Algorithm: save training data.
Model:
Model data: the whole training data set.
Prediction process: find out the K most similar rows and take the average of their target variables.
You can use this decomposition as a framework to understand any machine learning algorithm.
Machine learning is automatic programming.
We really just want a "model" of machine learning, and "algorithm" is the path by which we get the model.
Machine learning technology is used to solve problems that can not be solved effectively or efficiently by other methods.
For example, if we need to classify e-mail as spam or non-spam, we need a software program to accomplish this task.
We can sit down, check a large number of emails manually, and then write if statements to complete the qualified task. People have tried this method. Facts have proved that this method is slow, fragile, and the effect is not very good.
On the contrary, we can use machine learning technology to solve this problem. Specifically, algorithms like naive Naive Bayes can learn how to classify messages as spam and non-spam from a large number of historical email sample datasets.
We don't want "naive Bayes", we want the model given by naive Bayes, which is the model we can use to classify mail (probability vector and prediction algorithm of using probability). What we want is the model, not the algorithm used to create the model.
In this sense, the machine learning model is a program that is automatically written, or created, or learned by machine learning algorithms to solve our problems.
As developers, we are not interested in "learning" machine learning algorithms in the sense of artificial intelligence. We don't care about the simulated learning process. Some people may care, which is interesting, but that's not why we use machine learning algorithms.
On the contrary, we are more interested in the automatic programming capabilities provided by machine learning algorithms. We hope to be able to effectively create an effective model and integrate it into our software project.
Machine learning algorithms perform automatic programming, and machine learning models are programs created for us.
Thank you for reading this article carefully. I hope the article "what is the difference between algorithms and models in machine learning" shared by the editor will be helpful to everyone. At the same time, I also hope that you will support and pay attention to the industry information channel. More related knowledge is waiting for you to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.