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.
Questions tagged [objective-function]
78 questions
0
votes
1 answer
How do I insert the objective function with absolute value in Gurobi using Java language?
My objective function is like min|XyPiy-XkPik| i=1...10, j=1...4, k=5...8
I tried to write the code like this, but I don't know what to do with the module
GRBLinExpr obj = new GRBLinExpr();
for(int y=1; y<=4; y++) {
for(int i=0; i<10; i++)…

Paolo
- 21
- 4
0
votes
1 answer
How to Add Matrix as x0 Variable in fminsearch?
I am using fminsearch to minimize objective function. This requires defining variable x0 (usually vector) as estimates of solution which algorithm uses as starting point of finding solution. However, I want to create many estimates and evaluate…

Dario Mirić
- 111
- 3
0
votes
1 answer
What should I do abs in objectfunction
I want to find an expression with an absolute value as an objective function in gurobi. Specifically, it is an expression such as ∑_j ∈ J | ∑_i ∈ P x_ij-d_i *t_i |.
The variable is x_ij, and the others are constants. I tried and errored this formula…

炎天下修羅
- 1
- 3
0
votes
1 answer
How to use min & max in objective function in pyomo
I am very new to Pyomo, working on a use case where my objective function coefficient is dynamic & needs a min-max function.
Objective function = Max( sum (P * UC) - sum ( P - min(P)) * UC
where P is variable needs to be optimized and UC is function…

Shah Rohit
- 1
- 2
0
votes
0 answers
Can pyomo handle segmentation functions (defined by numpy) when defining objective function?
I want to implement the following objective function in pyomo:
def alpha_beta(x):
a = 0.0019727939
b = 0.0078887
Lmin, Lnom, Lmax = 0.8035, 2.3811, 3.084
return np.piecewise(x, [np.logical_and(Lmin <= x, x < Lnom),
…

Jian ZUO
- 35
- 4
0
votes
1 answer
Optimization of functions using pyomo models
I have a problem with the optimization code. The code I have written should optimize the two objectives considering their expressions and produce value that can be plotted. This is my code as mentioned below.
from pyomo.environ import *
import…
0
votes
1 answer
PuLP: Normalizing multiple decision variables and assigning weights
I have 4 groups of decision variables of various scale.
dgp, dgm, (y_s1+y_s2), v
dgp, dgm, (y_s1+y_s2) are below 1000
v is in the range of 6000 to 16000.
I would like to assign a certain weightage to each of the 4 variables in the objective…

JMT
- 63
- 3
- 7
0
votes
1 answer
Docplex objective funtion: Minimize a maximum value
I need to minimze the maximum value of a dictionary. How can I phrase the objective function?
example input: A = {1: 1.0, 2: 2.0, 3: 2.0, 4: 1.0, 5: 7.0, 6: 1.0, 7: 4.0}
So far I´ve tried:
Count == max(A.values())
Count == max(A.items(),…

Mado_xx
- 1
- 2
0
votes
1 answer
Custom XGB obj function
I'd like to preface by saying I'm pretty new to using xgboost, pandas, and numpy.
Currently I'm working on implementing a custom OBJ function for XGBoost based on the kelly criterion.
This approach is drawn from another post on…

Redratz
- 136
- 7
0
votes
1 answer
Two Expressions for one objective function in Gurobi
With Gurobi (Java), is it possible to write two expressions for one objective function so that only the objective function is subsequently optimized?
More precisely: I have the following objective function:
f = -(a-b)
Both a and b contain my…

Handballer73
- 103
- 5
0
votes
1 answer
Cplex is it possible to write objective function like this
I have a 2d matrix of scores as parameters.
I have nxm variables x[i,j], those variables can assume integer values in a predetermined range.
I need to maximize something like this:
desidered objective function
Where scores is the matrix.
Is it…

Miko Miko
- 11
- 2
0
votes
1 answer
SCIP Optimization of an Exponential Function
I am having issues summing over an exponential equation and using
this as is the objective function.
I have also tried writing the exponential equation in as
a constraint as I thought that may be another method to solve this
issue, but this did not…

jdw
- 11
- 2
0
votes
1 answer
Conditionals on Pulp variables
I am trying to solve a professor/class asignment problem using Pulp. Below is a simplified example of my code. In the example there are 12 different subjects/year ('Maths_1', stands for Maths 1st year) to be given to 3 different groups (A, B, C).…

user1862963
- 79
- 3
- 11
0
votes
1 answer
Going from non-linear root-finding to multi-objective optimization
To simplify, let's say I can describe a system with
variables x1 and x2,
parameters p1 and p2, and
constraints f(x, p) = 0 and g(x, p) = 0:
For example:
f(x1, x2, p1, p2) = x1^2 * p1 + x1^2 * p2 + x2 = 0
g(x1, x2, p1, p2) = x2^2 * p2 + x1 * p1 =…

Florent H
- 323
- 1
- 8
0
votes
1 answer
Why is a matrix argument of my objective function changed when I minimize it with scipy.optimize.minimize()?
I'm trying to do the Space-Time Auto-Regression (STAR). The code below basically defines the objective function above that I need to minimize, where Y is an N-by-K matrix and D an N-by-N matrix.
import numpy as np
from sys import exit
def…

Paw in Data
- 1,262
- 2
- 14
- 32