Cost Function Curve Calculator

Explore cost functions, compare training behavior, simulate optimization, inspect gradients, detect convergence issues, and export clear machine learning results with interactive visual controls instantly.

Calculated Results

Load a preset or enter data, then calculate.
Ready

Formula Used

Select a function to display its formula.

Curve Analysis

Analysis appears after calculation.

Detailed Calculation Table

#XActualPredictedResidual |Residual|SquaredIndividual LossWeight Weighted LossParameterGradientIteration
No calculated rows yet.

Calculator Settings

Choose a preset, then adjust every available setting.

Used directly, or replaced by model predictions during a sweep.
Format: Series|x:y,x:y. Use one series per line.

Formula Reference

Cost functions summarize prediction error into one measurable value. Lower values usually indicate better fit. Context still determines the best function.

FunctionFormulaTypical use
MSEJ = (1/n) Σ(y − ŷ)²Regression with stronger outlier penalties.
MAEJ = (1/n) Σ|y − ŷ|Robust regression interpretation.
Binary cross-entropyJ = −(1/n) Σ[y ln(p)+(1−y)ln(1−p)]Binary probability predictions.
HuberQuadratic near zero, linear outside delta.Regression with moderate outliers.
QuantileJ = mean(max(qr,(q−1)r))Conditional quantile estimation.

How to Use

Choose a cost function and enter matching numeric arrays. Select a curve mode and parameter range. Press calculate to update every result.

Enable optimization to simulate parameter updates across iterations. Compare training and validation behavior when available. Export the finished chart and calculations.

Example Data

XActualPredictedWeight
132.81
255.31
376.61
499.41

Frequently Asked Questions

What does the minimum point represent?

It represents the lowest tested cost. The related parameter is the best tested value.

Why can validation cost increase?

The model may start fitting training noise. This pattern often suggests overfitting.

Which cost function should I choose?

Match the function to the prediction task. Consider robustness and probability assumptions.

Why does a high learning rate diverge?

Large updates can overshoot the minimum. Repeated overshooting may increase cost rapidly.

What does regularization add?

Regularization adds a parameter penalty. It can discourage overly complex fitted models.

Can I import a CSV file?

Yes. Use columns named x, actual, predicted, and weight.

What is the generalization gap?

It is validation cost minus training cost. Larger positive gaps may indicate overfitting.

How does early stopping work?

It tracks improvement across iterations. Training stops after the selected patience expires.

Can I use a custom expression?

Yes. Use y, p, r, w, numbers, and Math functions.

Related Calculators

Gradient Descent Path PlotContour Plot3D Loss SurfaceLearning-Rate Comparison PlotRegularisation CurveSigmoid Function GraphSoftmax Probability PlotEntropy CurveGini Impurity CurveCross-Entropy Loss Curve

Important Note: All the Calculators listed in this site are for educational purpose only and we do not guarentee the accuracy of results. Please do consult with other sources as well.