date: 2024-12-24
title: ML-Regression
status: DONE
author:
- AllenYGY
tags:
- NOTE
- Regression
- ML
publish: True
ML-Regression
Linear Regression is used for regression tasks to predict continuous outputs by minimizing the mean squared error.
Ridge Regression is a regularized version of linear regression that adds a penalty term to the loss function to prevent overfitting.
Logistic Regression is used for binary classification tasks to predict probabilities and classify data points.
Linear regression models the output
The cost function used is the Mean Squared Error (MSE):
Logistic regression maps the linear function to a probability using the sigmoid function:
The cost function for logistic regression is:
岭回归是一种线性回归的正则化变体,通过在损失函数中加入
岭回归的目标是最小化以下损失函数:
岭回归有一个闭式解,可以通过修改普通线性回归的正规方程得到:
梯度下降解
通过梯度下降最小化损失函数:
Suppose predict
"
"
The cost function for logistic regression is defined as:
When
As
When
When
Simplification of Logistic Regression Cost Function
The overall cost function for logistic regression is defined as:
Note:
To fit parameters
To make a prediction given new
Output
The cost function for logistic regression is:
Repeat: