cvxpy | embedded modeling language for convex optimization problems

 by   cvxgrp C++ Version: v1.1.11 License: Non-SPDX

kandi X-RAY | cvxpy Summary

kandi X-RAY | cvxpy Summary

cvxpy is a C++ library. cvxpy has no bugs, it has no vulnerabilities and it has medium support. However cvxpy has a Non-SPDX License. You can download it from GitHub.

A Python-embedded modeling language for convex optimization problems.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              cvxpy has a medium active ecosystem.
              It has 3300 star(s) with 709 fork(s). There are 123 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              There are 115 open issues and 835 have been closed. On average issues are closed in 41 days. There are 10 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of cvxpy is v1.1.11

            kandi-Quality Quality

              cvxpy has 0 bugs and 0 code smells.

            kandi-Security Security

              cvxpy has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              cvxpy code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              cvxpy has a Non-SPDX License.
              Non-SPDX licenses can be open source with a non SPDX compliant license, or non open source licenses, and you need to review them closely before use.

            kandi-Reuse Reuse

              cvxpy releases are available to install and integrate.
              Installation instructions are not available. Examples and code snippets are available.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of cvxpy
            Get all kandi verified functions for this library.

            cvxpy Key Features

            No Key Features are available at this moment for cvxpy.

            cvxpy Examples and Code Snippets

            No Code Snippets are available at this moment for cvxpy.

            Community Discussions

            QUESTION

            norm of differences of variables in cvxpy
            Asked 2022-Mar-29 at 19:14

            How can I take the following norm in cvxpy

            ...

            ANSWER

            Answered 2022-Mar-29 at 19:14

            Your problem is solved exactly because you don't have any constraint. I skipped the function to make you a shorter script.

            Source https://stackoverflow.com/questions/71632766

            QUESTION

            The objective is not DCP
            Asked 2022-Mar-28 at 08:48

            I try to solve the convex problem on page 20 presented in this paper

            In my opinion, the objective is convex.

            cvxpy version 1.1.18

            prob is DCP: False

            it reports

            xception has occurred: DCPError Problem does not follow DCP rules. Specifically: The objective is not DCP. Its following subexpressions are not: 0.004 / (power(var1[0], 0.5) + power(var1[0], 0.5)) 0.004 / (power(var11, 0.5) + power(var11, 0.5))

            my code is

            ...

            ANSWER

            Answered 2022-Mar-28 at 08:48

            Use cp.inv_pos(u) instead of 1/u.

            Source https://stackoverflow.com/questions/71641509

            QUESTION

            Accessing suboptimal solution in Mosek+Cvxpy
            Asked 2022-Feb-24 at 07:24

            We are using Mosek solver via its Cvxpy interface.

            We deal with large-scale optimization problem on a regular-basis and sometimes the runtime is very high. So, we specify a upper limit on runtime using Mosek's mosek.dparam.optimizer_max_time parameter.

            In those cases, the pain-point is that we get no solution.

            Is it possible to get the suboptimal/best found solution so far?

            ...

            ANSWER

            Answered 2022-Feb-24 at 07:24

            If Mosek did not find any feasible integer solution within the time limit then there is nothing to return, so you get nothing.

            If Mosek found some feasible integer solution then CVXPY should return it with solution status s.OPTIMAL_INACCURATE, judging from a quick look at the code.

            So the question is what does it say in the log output and what happens at the end of the optimization when CVXPY is processing the answer from the solver.

            Source https://stackoverflow.com/questions/71240192

            QUESTION

            Convex Optimization - Currency exchange problem - cvxpy error
            Asked 2022-Jan-24 at 10:04

            I am solving the currency exchange problem, where we have a set of currency holdings for 10 different kinds. Our objective is to have a specific minimum of each currency holdings, while minimizing the loss due to the bid-ask spread which occurs when we exchange some units of a currency for some units of another currency.

            In case it helps here is the full question: https://drive.google.com/file/d/1DG8xfM3ayQ0Oj9VQGYSNbHF_rbKHMTLq/view

            The code:

            ...

            ANSWER

            Answered 2022-Jan-23 at 20:58

            Wherever you are operating on cvxpy objects you should be using cp. functions, not np. ones. So cp.dot etc.

            Source https://stackoverflow.com/questions/70824473

            QUESTION

            How to install mosek for cvxpy?
            Asked 2022-Jan-11 at 09:09

            Previously I used command conda install -c mosek mosek to install mosek(my IDE is VS Code and use anaconda environment). After I installed it, I ran a program for a convex optimization problem, and one line of code was(because I want to choose mosek as solver):

            ...

            ANSWER

            Answered 2022-Jan-10 at 08:49

            Have you tested that your conda installed Mosek can be used outside Cvxpy i.e. directly from Python.

            Source https://stackoverflow.com/questions/70648123

            QUESTION

            cvxpy solvers produce solutions of different shapes?
            Asked 2022-Jan-06 at 16:16

            I am trying to use maxrect's get_maximal_rectangle, which uses cvxpy under the hood.

            With the shapely polygon: POLYGON ((0 0.95, 0 2, 2 2, 2 1.95, 0 0.95))

            ...

            ANSWER

            Answered 2022-Jan-06 at 16:16

            I found success in customizing this library for modern use.

            Source https://stackoverflow.com/questions/70586297

            QUESTION

            CVXPY, least-squares Optimization, wrong constraint formulation
            Asked 2022-Jan-03 at 14:35

            First of all, I'm sorry if my questions doesn't make sens, I am new using CVXPY library and I don't understand everything :/

            I am trying to solve a minimization problem that I thought would be easy handle. I got a matrix S dimensions (9,7) with known coefficients, B dimensions (1,7) with known coefficients, Alpha dimensions (1,7) what I need to find, with various constraints :

            • Alpha must be positive
            • The sum of all the coefficients of Alpha must be equal to 1

            I need to optimize Alpha such as : A @ Alpha-B=0. I discovered CVXPY and thought least square optimization was perfect for this issue.

            This is the code I wrote :

            ...

            ANSWER

            Answered 2022-Jan-03 at 14:35

            Use just sum(Alpha) == 1. You are not supposed to use numpy functions in CVXPY expressions, you must use CVXPY functions listed in https://www.cvxpy.org/tutorial/functions/index.html

            Source https://stackoverflow.com/questions/70566975

            QUESTION

            Solving linear regression minimizing quadratic cost
            Asked 2021-Nov-25 at 16:15

            I want to solve linear regression in the following way

            When I try with minimizing the sum of cost it works fine,

            ...

            ANSWER

            Answered 2021-Nov-25 at 16:15

            I think CVXPY does not understand that both y - X*theta are the same in

            Source https://stackoverflow.com/questions/70108101

            QUESTION

            MISDP/MISOCP in cvxpy
            Asked 2021-Nov-24 at 09:08

            I'm trying to solve the following problem in CVXPY.

            The problem is a mixed-integer SDP due to the PSD matrix we're solving. However, according to this list it looks as though none of the solvers can handle such a problem.

            Can we use the fact that A is a 2x2 matrix to somehow convert this to a mixed-integer SOCP problem?

            ...

            ANSWER

            Answered 2021-Nov-24 at 09:08

            Let's say A=[[x,z], [z,y]], then you can maximize sqrt(det(A)) (which is equivalent to your objective). Note that

            Source https://stackoverflow.com/questions/70091659

            QUESTION

            Multipoint(df['geometry']) key error from dataframe but key exist. KeyError: 13 geopandas
            Asked 2021-Oct-11 at 14:51

            data source: https://catalog.data.gov/dataset/nyc-transit-subway-entrance-and-exit-data

            I tried looking for a similar problem but I can't find an answer and the error does not help much. I'm kinda frustrated at this point. Thanks for the help. I'm calculating the closest distance from a point.

            ...

            ANSWER

            Answered 2021-Oct-11 at 14:21

            geopandas 0.10.1

            • have noted that your data is on kaggle, so start by sourcing it
            • there really is only one issue shapely.geometry.MultiPoint() constructor does not work with a filtered series. Pass it a numpy array instead and it works.
            • full code below, have randomly selected a point to serve as gpdPoint

            Source https://stackoverflow.com/questions/69521034

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install cvxpy

            You can download it from GitHub.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/cvxgrp/cvxpy.git

          • CLI

            gh repo clone cvxgrp/cvxpy

          • sshUrl

            git@github.com:cvxgrp/cvxpy.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link