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
1
vote
0 answers

Classifier vector of Naive Bayes

I am trying to define a objective/loss function for the Naive Bayes classifier in Sklearn. However, the objective function has 'w' which is the classifier vector. This confuses me because I thought the Naive Bayes classifier only uses…
1
vote
0 answers

Can anyone suggest comparison criteria for various algorithms like ACO, ABC, PSO, BFO, FA, SSO,etc?

I want to compare these methods using matlab. So what can be the criteria for calculating the best method, although different methods are useful as per the applications. Can I use the the objective functions described in link below. Further which…
1
vote
1 answer

GLPK/GMPL: Minimize objective function but keep it > 0

I am trying to minimize an objective function that has three parameters: i, p, j like this: param mlu{i in I, p in P, j in out[p]} := traffic[i,p]/capacity[j]; minimize MAXLU{i in I, p in P, j in out[p]}: mlu[i,p,j] * x[i,p,j]; but the objective…
1
vote
0 answers

gurobipy.GurobiError: Invalid argument to LinExpr multiplication

I'm getting the error: gurobipy.GurobiError: Invalid argument to LinExpr multiplication The bug has to be in the following line: m.setObjective(quicksum(sum(s[d, r] *x[d, r] for r in piecewise) * h[d] * Z * VarDemand[d] for d in…
S.Six
  • 31
  • 2
  • 5
1
vote
1 answer

Bin Packing Objective function

First I want to clarify that English is not my native language so have me a little patience :) I'm trying to solve the 3D bin packing problem, only with one container(knapsack) and I have a problem about the formulation of the objective function. I…
0
votes
0 answers

Objective function consists of discrete and continuous parts CppAD ::ipopt

I am solving an optimization problem based on CppAD::ipopt library. My objective function Z = Z1 + Z2. The decision variables are x1 and x2. Z1 is a continuous function Z2 = V[f(x1, x2)] (Z1 based on a vector V, and index of vector V depends on…
0
votes
0 answers

Applying Reinforcement Learning technique to RPL protocol

Based on many papers, for routing functionality in IoT-WSN networks, we can utilize artificial intelligence algorithms to provide the routing protocol with self-learning and self-adaptive capabilities. Several studies have attempted to apply…
NajmH
  • 1
0
votes
1 answer

Compute objective function in CPLEX

I am trying to solve the supplier diversification problem by minimizing the costs. I basically have a list of pricing for an item from different suppliers. The suppliers are willing to give me some discounts if I order in large quantities. I am…
0
votes
0 answers

Constrained Imputation

I actually have two original datasets (each one for a departure that are related to each one in a specific way , but it's not important to know how exactly) , but these 2 datasets contain some outliers in the column 'value' that i deleted and which…
0
votes
0 answers

When simulating RPL Attack in Cooja, modifications made to core files affect normal motes behavior during experiment?

I wanted to seek your help to answer the following question: I want to implement RPL attack in cooja, so I built the scenario with sink and normal nodes and the run the network. Afterward, including the attack node requires some modifications to…
Lelle Mohd
  • 21
  • 3
0
votes
0 answers

Objective function for pendulum genetic algorithm

I am looking for help developing an objective function to minimise, to evolve (through genetic algorithm) a control system for this frictionless inverted pendulum (https://www.gymlibrary.dev/environments/classic_control/pendulum/). The goal is to…
0
votes
1 answer

Objective function definition for MIP using docplex

import numpy as np rnd = np.random rnd.seed(0) n = 6 t = [i for i in range(1, n)] V = [0] + [i for i in range(1, n + 1)] o = 5 operator = [o for o in range(1, o)] precedence = [[1, 2], [1, 3], [3, 5], [2, 4], [4, 5], [4, 6], [5, 7], [6,…
0
votes
1 answer

Calculating the value of the objective function for a manual input in Gurobi

I have a complex model and I want to calculate the objective function value for different options (not just the optimal solution). I created the toy example below: import gurobipy as gp from gurobipy import GRB import numpy as np m = gp.Model() X =…
Hadij
  • 3,661
  • 5
  • 26
  • 48
0
votes
1 answer

Quadratic objective function in Gurobi

I am building a model with a quadratic objective function. But I am having trouble on how to code it. v is a matrix of coefficients. This is the original objective: x = m.addMVar(shape=n, vtype=GRB.BINARY, name="x") # binary var m.setObjective(v…
Ella
  • 15
  • 5
0
votes
1 answer

How can I insert this objective function min W with its two constraints on Gurobi using Java? How do I initialise w?

I tried to initialise like this but it's wrong GRBVar w = null; GRBLinExpr obj = new GRBLinExpr(); obj.addTerm(1, w); model.setObjective(obj); model.set(GRB.IntAttr.ModelSense, GRB.MINIMIZE); These are the two constraints w >= xir…
Paolo
  • 21
  • 4