Marcs Notes

Home

❯

university

❯

Data Science

❯

Machine Learning

❯

Custom Loss Function for Linear Regression in Python

Custom Loss Function for Linear Regression in Python

03. Aug. 20251 min read

Custom Loss Function for Linear Regression in Python

from scipy.optimize import minimize
 
def error(y_true, y_pred):
	...
 
def loss(params, x, y_true):
	pred = ...params...
	return ...loss(y_true, pred)...
 
d = minimize(loss, [0,1], args=(x, y_true))
res = d.x

Source

  • https://alex.miller.im/posts/linear-model-custom-loss-function-regularization-python/

Graphansicht

  • Custom Loss Function for Linear Regression in Python
  • Source

Backlinks

  • Quantile Regression
  • Regression

Erstellt mit Quartz v4.5.1 © 2025

  • GitHub