Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 1 year ago.
Improve this question
I'm trying to get some approximation ratios for the Maximum Independent Set Problem and so I need some exact solutions !
I've found libraries written in C++ (i.e https://github.com/iPapatsoris/Maximum-Independent-Set)
but wondered if there were any directly in Python. I know of the `networkx' maximal indepedent set function but these are only approximations.
I realise it's far from the most efficient language to use but I'm only solving small Erdős–Rényi graphs (N<20).
In addition to this, are there any libraries that solve this for the weighted problem, where some nodes matter more than others?
This is the only python library I could find:
https://github.com/pchervi/Graph-Coloring/blob/master/Coloring_MWIS_heuristics.py
I haven't checked that it works correctly however.
I've been using KaMIS instead, which is a C++ implementation.
https://github.com/KarlsruheMIS/KaMIS
Related
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 5 months ago.
Improve this question
Is there any Hierarchical Agglomerative Clustering implementation (in Python) available that preserves the order of data points? For example, I want the output something like this.
(((seg1, seg2), (seg3, seg4)), seg5)
but not like this
(((seg1, seg5), (seg2, seg3)), seg4)
E.g., Actual output with existing implementation
Expected output (any implementation?)
Vijaya, from what I know, there is only one public library that does order preserving hierarchical clustering (ophac), but that will only return a trivial hierarchy if your data is totally ordered (which is the case with the sections of a book).
There is a theory that may offer a theoretical reply to your answer, but no industry-strength algorithms currently exist: https://arxiv.org/abs/2109.04266. I have an implementation of this theory that can deal with up to 20 elements, so if this is interesting, give me a hint, and I will share the code.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 2 years ago.
Improve this question
I have a system which is configurable. It has 3 parameters
Parameter1 - can vary between [0, 2^30]
Parameter2 - can vary between [0, 2^30]
Parameter3 - can vary between [0, 2^12]
I have a python code which when given a set of valid numbers corresponding to (parameter1, parameter2, parameter3) can configure the system and after few mins return a number say a score for the configuration.
Suppose the aim to maximize the score. Is there a python library to generate the parameters with constraints intelligently.
Thanks in advance
This is a bounded optimization problem. Depending on how the "system" is structured different optimization strategies will behave differently well.
My suggestions is to either look at scipy.optimize.minimize or a genetic algorithm. I know there are multiple GA implementations in Python, but I haven't tried them.
Since a single evaluation takes on the order of minutes, you are looking at long optimization times though.
If you can compute the gradient to your score function, and if it is well-behaved (i.e. convex) then the scipy.optimize.minimize is probably your best bet. Otherwise you might have better luck with a GA.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 2 years ago.
Improve this question
I want to forecast upcoming total users on a daily basis within Python using a machine learning algorithm. Check the pattern below:
Looking at this graph, I was wondering if someone knows which forecasting method in Python I should use to predict?
Thanks!
If you have no additional data expect the user data over time which you have shown, the only thing you can do is try to find a function dependent on time which gives you a good approximation for that plot (ordinary curve fitting). I suppose that's not what you want.
To do a predection (which can be done not only by a machine learning approach), you need other data which is somehow correlated to the data you want to predict.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
I note that Matlab has a straightforward function for getting the entropy of an image. I need something similar for python. Scikit image has an entropy filter, which outputs the image using the least amount of bits needed to do so (at least, I think it does). I assume that to do this it calculates the entropy, but I can't seem to access it as a scalar value.
Before I code a function to do this manually, does anyone know if already exists and I'm somehow missing it? Or for that matter, some existing code that they'd recommend?
If you don't mind shelling out to ImageMagick you can do it like this:
convert someImage.png -format '%[entropy]' info:
0.907238
Not sure how you do it with the ImageMagick Python bindings, but it is probably possible.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 8 years ago.
Improve this question
I am looking for an implementation of Continuous Wavelet Transform for Python that includes Haar Wavelet.
I would like to reproduce the experiment given by MathWorks for Matlab, at this link.
I tried with Pyscellania but I obtain completely different coefficients.
Is there a Python implementation of the CWT out there that includes the Haar Wavalet apart from Pyscellania?
Your request is clear.
Have you tried Pyscellania's normalised or standard Haar Wavelet?
Maybe you are just using the wrong one.