Questions tagged [cvxopt]

A Python package for convex optimization, including solvers for linear programming, quadratic programming, semidefinite programming and more.

There is an official web site of the CVXOPT package. The official description of the package is given there as follows:

CVXOPT is a free software package for convex optimization based on the Python programming language. It can be used with the interactive Python interpreter, on the command line by executing Python scripts, or integrated in other software via Python extension modules. Its main purpose is to make the development of software for convex optimization applications straightforward by building on Python’s extensive standard library and on the strengths of Python as a high-level programming language.

227 questions
1
vote
1 answer

How to solve a binary linear program with cvxopt? Python

I know how to solve a linear program with cvxopt, but I don't know how to make it when the variables are all 0 or 1 (binary problem). Here is my attempt code: #/usr/bin/env python3 # -*- coding: utf-8 -*- from cvxopt.modeling import variable, op,…
Tobal
  • 709
  • 2
  • 11
  • 31
1
vote
2 answers

Installing cvxopt for python - Where do I find libblas.a and liblapack.a

I've got a (what I assume to be) rather simple question regarding the installation of cvxopt on Windows. I'm following this "guide" http://cvxopt.org/install/index.html. But I've got stuck on the part where you're supposed to Copy libblas.a and…
Good Guy Mike
  • 187
  • 1
  • 6
1
vote
0 answers

Threshold values b in SVM implementations

I was playing around with my own crude implementation for SVMs using cvxopt for solving the Quadratic programming problem inherent.I am a newbie to SVMs. Because it is my own implementation the onus of figuring out the margin support vectors and the…
Hsolo
  • 45
  • 9
0
votes
0 answers

CVXOPT constraint-related error: Rank(A) < p or Rank([P; A; G]) < n

I want to run the GRAM algorithm from MKLpy on a list of dataframes mrna_df, methylation_df, and protein_df. MKLpy uses cvxopt under the hood. GRAM code from MKLpy: from . import Solution, Cache, TwoStepMKL from ..arrange import average,…
melolili
  • 1,237
  • 6
  • 16
0
votes
1 answer

qpsolvers error: "SolverNotFound: solver 'cvxopt' is not in the list ['ecos', 'osqp', 'quadprog', 'scs'] of available solvers"

I am trying to use qpsolvers library to solve a quadratic program using the 'cvxopt' solver, but I keep getting the following error: SolverNotFound: solver 'cvxopt' is not in the list ['ecos', 'osqp', 'quadprog', 'scs'] of available solvers I am…
trash627
  • 1
  • 1
0
votes
0 answers

Sklearn Kernel SVM is Different from CVXOPT

I am confused. The sklearn implementation of a kernel SVM does not arrive at the same optimum as manually solving the problem does. In fact, the two solutions are completely different. What is going on? Let me provide an example. Below, we generate…
Claudio Moneo
  • 489
  • 1
  • 4
  • 10
0
votes
0 answers

cvxopt: Trying to find the best C (regularization parameter)

I'm trying to run a loop that finds the best C (regularization parameter), for C in range(1, 10): clf = SVM(Kernel.linear(), C) clf.fit(X['train'], y['train'].astype('double')) print("C = ", C) y_hat = clf.predict(X['train']) …
rerecodes
  • 33
  • 5
0
votes
0 answers

Using solvers from cvxopt, problem with parameter

As stated in title, I have optimization problem with 3 assets I tried the following solution: G1 = matrix(np.concatenate((np.eye(n_assets1), -np.eye(n_assets1)), axis=0)) sol1 = solvers.qp(covariance_matrix1, -expected_return1, G1, h1, A1,…
Jaro
  • 1
0
votes
0 answers

CVXOPT in DataFrame

I have the following df and trying to optimize the objective function using the cvxopt module in Python. The objective function is df.UTILIITY_FUNCTION * df_weight subject to the following constraints: • Weight of NAME=a should be less than 0.15 •…
cs_123
  • 13
  • 2
0
votes
1 answer

How can I write an expression towards this problem's constrain to satisfy the DCP rule of cvxpy?

I am trying to create an expression of a constrain in cvxpy to solve an optimization problem. The following image shows the left side of constrain: And t,a is the type of Variable. Therefore, I hope to know how to express ∑tlog(1+omega*a/t), I…
Tom_blade
  • 3
  • 3
0
votes
0 answers

Budget with Margin Per ticker constraint in the Portfolio Optimization

I'm trying to solve the below problem. We define a budget for our long short allocation (Sum(W) == 0). Suppose one of the asset in that portfolio get weight of 25% and this means if we are allocating the 10 million then that asset will get 1 Mil but…
0
votes
0 answers

CVXPY constraint formulation

I'm creating a long short market neutral portfolio using following function. import cvxpy as cp def create_gross_exposure_constraint(w): return cp.norm1(w) <= 2 def create_market_neutral_constraint(w): return cp.sum(w) == 0 I'm trying to…
0
votes
1 answer

LINK : fatal error LNK1181: cannot open input file 'lapack.lib'

LINK : fatal error LNK1181: cannot open input file 'lapack.lib' error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2022\\BuildTools\\VC\\Tools\\MSVC\\14.34.31933\\bin\\HostX86\\x64\\link.exe' failed with exit code 1181 I'm getting…
Mansi
  • 11
  • 3
0
votes
0 answers

multiclass robust svm using cvxopt socp

we have binary class robust svm https://cvxopt.org/examples/mlbook/robsvm.html. Similar to this, is there any reference for multiclass robust svm for the same using socp here?
Sree
  • 61
  • 2
0
votes
0 answers

CVXOPT and portfolio optimization: puzzling issue

I am trying to solve the following simple optimization problem. One seeks to find the global minimum variance portfolio, being the portfolio that minimizes variance with only one constraint : weights must sum to one. Optimization program This…