Lecture Note
University
University of California San DiegoCourse
DSC 207R | Python for Data SciencePages
2
Academic year
2023
anon
Views
30
Building and Applying a Classification Model ● Building a Classification Model: Understanding the Basics Let's discuss what it means to develop the classification model now that we have understood what classification entails and how building a model differs from applying amodel. By the end of this article, you ought to be able to discuss what it means to build aclassification model, clarify the distinction between building and applying a model, list thereasons why a model's parameters need to be adjusted, explain the purpose of aclassification algorithm, and mention a few popular classification algorithms. ● Introduction to Machine Learning Models A Machine Learning model is a mathematical model or a parametric function over the inputs. In the general sense, this means that the model has parameters and uses equationsto determine the relationship between its inputs and outputs. The parameters are used bythe model to modify the inputs to generate the outputs. The model adjusts its parameters inorder to correct or refine this input-output relationship. ● Understanding Model Parameters Here is an example of a simple model. This mathematical model represents a line. Y is the output. X is the input. M determines the slope of the line, and B determines the Y intercept,or where the line crosses the Y-axis. M and B are the model's parameters. Given a specificvalue for X, the model uses its parameters along with X to determine Y. By adjusting thevalues for parameters M and B, the model can adjust how the input X maps to the output Y. ● Parameter Adjustment and Model Refinement Here, we see how the output Y changes for the same value of M input X when parameters B changed. Recall that B is the Y intercept, or where the line crosses the Y-axis. The valueof B is positive one for the red line, and negative one for the blue line. For the input X equalsone, the value of Y is three for the red line, as indicated by the red arrow. For the blue line,when the parameter B changes from positive one to negative one, for X equals one, thevalue of Y is one as indicated by the blue arrow. So we see that with just a simple change inone model parameter, the input to output mapping changes. ● Machine Learning Model Parameters and Learning Algorithm A Machine Learning model works in a very similar way. It maps input values to output values and adjusts its parameters in order to correct or refine this input-output mapping. Theparameters of a Machine Learning model are adjusted or estimated from the data using alearning algorithm. This, in essence, is what's involved in building a model. This process is
referred to by many terms as model building, model creation, model training, and modelfitting. ● Supervised and Unsupervised Tasks In order to lower the model's error, we want to modify the parameters as we create the model. This refers to getting the model's outputs to match the targets, or desired outputs, asclosely as possible in the case of supervised tasks, such as classification. You can visualizethe classification problem as dividing the input space into regions corresponding to variousclass labels since the classification job is to predict the category or class given the inputvariables. ● Decision Boundaries and the Classification Model To specify the regions separating the red triangles from the blue diamonds from the green circles from the yellow squares, for instance, the classification model must define theborders in this diagram. In this illustration, a sample will be labeled as a blue diamond if itlies between the area in the upper right corner. These regions serve as the basis forclassification judgments, and the dashed lines in this diagram show where the regions'boundaries are located. The term "choice boundaries" is used to describe these boundaries. ● Building a Classification Model Building a classification model then means using the data to adjust a model's parameters in order to form decision boundaries to separate the target classes.
Building and Applying Classification Models
Please or to post comments