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
2 answers
Optimization methods used from scipy.optimize to nlopt package
I am currently having a black box of objective function. It has been use successfully in scipy.optimize as 'status=op.basinhopping(obj,sp,...)', however, when I try the same obj to NLOPT package, it gives a message of
TypeError: () takes…

Wenyu_LIN
- 3
- 3
0
votes
0 answers
translating matlab objective functions to R
I would like to translate a matlab function into R code. Here is the part of the code I am most confused about:
obj = (Pv*v)'*double(ttv(Xhat,Pv*v,2))*(Pu*u);
ind = 1; iter = 1;
while ind>thr & maxit>iter
…

pigtowndandy
- 47
- 5
0
votes
0 answers
Weighted Matrix Factorization
So I have got this weird function which can be formulated in to objective function as shown on the image attached. I do know I can't use any L2 Low rank matrix factorization(LRMF) algorithms to solve this as this is considered a weighted Low rank…

MLLearner
- 1
- 2
0
votes
1 answer
Supplied objective function must return a scalar value
I am trying to code a ML algorithm in Matlab. These are my different functions:
sigmoid.m:
function g = sigmoid(z)
g = zeros(size(z));
g = 1 ./ (1+exp(z));
costFunction.m
function [J, grad ] = costFunction(theta, X, y)
m = length(y); % number of…

Hasani
- 3,543
- 14
- 65
- 125
0
votes
2 answers
How do I know how well my clustering of geospatial data has worked?
I have a number of coordinates points, each associated with a particular landmark however they have varying and unknown degrees of accuracy. For each of these landmarks I have the coordinates of when a visitor says they are 'at the landmark'.
I…

jedge
- 937
- 2
- 11
- 18
0
votes
1 answer
Add quadratic penalty term to objective function in cplex (Java)
I'm developing an Optimization tool for a domestic energy system that also contains a battery. All values are correct and the solution makes sense. The problem is that the solution contains very strong fluctuations. Meaning that the decision…

L. Burg
- 3
- 1
0
votes
1 answer
How to view the sensitivity analysis of the objective function in ILOG CPLEX Optimization Studio
Here is my code below
*********************************************/
dvar float+ x; /* daily quantity of t-shirts*/
dvar float+ y; /* daily quantity of shorts */
maximize 6*x + 10*y; /* maximize the daily profit from t-shirts and…

Charuka Deshan
- 19
- 2
0
votes
0 answers
Implementing Objective Function in matlab
I am trying to implement Objective function in Matlab.
Here a,b,c are constants, D_k and E_k are uniformly distributed vectors between 0 to 1. P_k is a constant vector. E_k is decision variable. The objective is to maximize subject to E_k value…

sukhalid
- 43
- 9
0
votes
1 answer
Applying element wise conditional functions on Theano TensorVariable
Easiest thing might be for me to just post the numpy code that I'm trying to perform directly in Theano if it's possible:
tensor = shared(np.random.randn(7, 16, 16)).eval()
tensor2 = tensor[0,:,:].eval()
tensor2[tensor2 < 1] = 0.0
tensor2[tensor2 >…

Corey J. Nolet
- 339
- 1
- 4
- 13
0
votes
1 answer
Objective function of a Genetic Algorithm
This is my first effort about AI/ML.
I have the following problem given by my teacher,
Design a simple genetic algorithm in MATLAB, with binary-coded chromosomes, in
order to solve pattern finding problem in 16-bit strings.
The objective…

user366312
- 16,949
- 65
- 235
- 452
0
votes
1 answer
How to map database values in objective function in Mixed Integer Programming using IBM Cplex?
I'm trying to model a student assignment probelm using cplex.
I have student details in a access database (ex: student id and marks)
I was able to obtain these values from db to .mod file using tuples.
tuple stuType{
int id;
int mark;
}
stuType…

Ann
- 403
- 2
- 5
- 17
0
votes
1 answer
matlab optimization: objective function with dependent decision variable
I want to optimize an objective function with dependent decision variables as below.
Sum [I * (x(i) - x(i-1) + lo(i) - g(i)) * p(i)]
Please note that the decision variable is only x(i) and x(i-1) is a value came from previous step of…

nana
- 1
- 1
0
votes
0 answers
Clean Binary Image in Matlab
I have a noisy binary image of size 300X200 pixel. I need to clean it up, but using a given objective function, which I should maximise. So I have the noisy binary image and the objective function. I should find the cleaned binary image which…

user3331949
- 23
- 1
- 8
0
votes
1 answer
How to use R to solve a program with piecewise constant objective function?
I would like to solve a minimization problem using R that has a piecewise constant objective function. The idea is that for lower values of my (integer) decision variable x higher penalty costs are incurred than for higher values. I want to minimize…

Braamstruik
- 211
- 2
- 11
-1
votes
1 answer
Confusion in Python Pyomo Components (Parameter and Variable)
I am learning Pyomo Abstract Modeling from a Book.
I have an example that has an objective functionEquation is here to minimize the cost of establishing a warehouse at optimal locations to build warehouses to meet delivery demands.
The authors…

Waqas Swati
- 1
- 4