Questions tagged [objective-function]

An objective function is either a loss function or its negative (sometimes called a reward function, a profit function, a utility function, a fitness function, etc.), in which case it is to be maximized.

78 questions
271
votes
3 answers

How to interpret loss and accuracy for a machine learning model

When I trained my neural network with Theano or Tensorflow, they will report a variable called "loss" per epoch. How should I interpret this variable? Higher loss is better or worse, or what does it mean for the final performance (accuracy) of my…
34
votes
1 answer

Difference between Objective and feval in xgboost

What is the difference between objective and feval in xgboost in R? I know this is something very fundamental but I am unable to exactly define them/ their purpose. Also, what is a softmax objective, while doing multi class classification?
14
votes
1 answer

How to write a custom evaluation metric in python for xgboost?

I would like to add the kappa evaluation metric to use in xgboost in Python. I am having trouble understanding how to connect a Python function with xgboost. According to the xgboost documentation, a "User can add multiple evaluation metrics, for…
Greg
  • 8,175
  • 16
  • 72
  • 125
7
votes
1 answer

What is the ideal value of loss function for a GAN

GAN originally proposed by IJ Goodfellow uses following loss function, D_loss = - log[D(X)] - log[1 - D(G(Z))] G_loss = - log[D(G(Z))] So, discriminator tries to minimize D_loss and generator tries to minimize G_loss, where X and Z are training…
5
votes
0 answers

How to pass multiple custom metrics (eval_metric) in python xgboost?

The folloiwng code is not working, where aucerr and aoeerr are custom evaluation metrics, it is working with just one eval_metric either aucerr or aoeerr prtXGB.fit(trainData, targetVar, early_stopping_rounds=10, eval_metric= [aucerr, aoeerr],…
BigDataScientist
  • 1,045
  • 5
  • 17
  • 37
4
votes
1 answer

How to define complex objective functions in or-tools?

I would like to know how to define a complex objective function using or-tools (if it is possible). The basic example below shows how to have basic linear problem with Or-tools in python: solver = pywraplp.Solver('lp_pricing_problem',…
3
votes
0 answers

XGBoost for precision

I'm using XGBoost for binary classification. The standard/default loss function (binary logistic) considers all classifications (both in the positive and negative classes) for performance. All I care about is precision. I don't mind if it makes a…
3
votes
3 answers

Custom objective function for XGBoost including an external data column

I am using XGBoost in order to do a sales forecasting. I need a custom objective function, as the value of the prediction depends on the sales price of an item. I am struggling to feed in the sales price into the loss function next to the labels and…
3
votes
0 answers

XGBoost custom loss function cannot reproduce binary:logistic objective

I am workin in RStudio and am looking to develop a custom objective function for XGBoost. In order to make sure I have understood how the process works, I have tried to write an objective function which reproduces the "binary:logistic" objective.…
DanielB
  • 31
  • 1
3
votes
1 answer

PuLP: Objective Function: Adding multiple lpSum in a loop

I am trying to use PuLp for a Blending problem with different Elements (Iron, Mercury..). But instead of max/min some profit/cost I need to maximize the utilization of my constraints. So in Excel I had something like this (in pseudocode): max Sum…
JanB
  • 179
  • 2
  • 2
  • 10
3
votes
0 answers

How do I calculate Gradient of ranking loss?

I am trying to understand ranking loss(a.k.a, Maximum Margin Objective Function, MarginRankingLoss ...) based on CS 224D: Deep Learning for NLP lecture note. In this note, the cost is defined as follows: J = (1 + sc − s) s= f(θ,x), sc = f(θ,xc),…
이경호
  • 97
  • 9
2
votes
1 answer

MPC in GEKKO: error code 'Position 4' solution

Question updated Previously, the control variable m.P in my model has a wide range that leads to the failure of the solver. With Dr.John's advice, I tried logarithmic scaling of P in the objective function. While new error rises with error code…
2
votes
0 answers

How to customize a XGBoost objective function for ordinal classification problem?

I am training a model to do the classification on an ordinal response variable with 10 levels. I have studied a paper called "Squared Earth Mover’s Distance-based Loss for Training Deep Neural Networks" (https://arxiv.org/pdf/1611.05916.pdf) and I…
2
votes
1 answer

Absolute value in objective function of linear optimization

I'm trying to find the solution for the following expression Objective function: minimize(| x - c0 | + | y - c1 |) Constraint: 0 < x < A 0 < y < B where c0, c1, A, B are positive constants Following the conversion given in …
2
votes
1 answer

Keras: Why do loss functions have to return one scalar per batch item rather than just one scalar?

I'm writing a custom loss function in Keras and just tripped over the following: Why do Keras loss functions have to return one scalar per batch item rather than just one scalar? I care about the cumulative loss for the whole batch, not about the…
Alex
  • 3,316
  • 4
  • 26
  • 52
1
2 3 4 5 6