Closed. This question is not about programming or software development. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 6 days ago.
Improve this question
I want to create below image distribution with n=10 in python code.
image
After searching on the Internet, the distribution most similar to this distribution is the binomial distribution, but the formula is different.
So, there are two things I want to ask you.
When n choose k, it should be written with nCk. Can I use n and k on the right side of C? (Even after searching for a combination, I couldn't find a case where it was written on the right side.)
Is there a distribution name for this formula?
thank you
After searching on the Internet, the distribution most similar to this distribution is the binomial distribution, but the formula is different.
Related
Closed. This question is not about programming or software development. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 2 days ago.
Improve this question
My data is not a linear data, so what do you suggest which model best to predict?
See plots, X is feature, Y is target
I did scale the feature, and just feel like confused since i got low r2 score always.
Any suggestion?
See plots, X is feature, Y is target
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
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.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 8 years ago.
Improve this question
I am trying to determine the following step characteristics for a step response in Python:
RiseTime
SettlingTime
SettlingMin
SettlingMax
Overshoot
Undershoot
Peak
PeakTime
Matlab offers me the function stepinfo, but I am unable to find a suitable alternative in Python. I did try to roll my own using numpy and scipy, but I haven't had much luck yet, my knowledge of signal processing is lacking.
Most information that I can find on the internet look rather complicated but I do like to learn more about this. If any one could recommend me a good book or other source to learn more from I would appreciate it! Thank you!
This is the step response that I currently have:
This discussion suggests a sort of implementation:
def step_info(t,yout):
print "OS: %f%s"%((yout.max()/yout[-1]-1)*100,'%')
print "Tr: %fs"%(t[next(i for i in range(0,len(yout)-1) if yout[i]>yout[-1]*.90)]-t[0])
print "Ts: %fs"%(t[next(len(yout)-i for i in range(2,len(yout)-1) if abs(yout[-i]/yout[-1])>1.02)]-t[0])
Then you need to use numpy functions in the Signal Processing section to get the other information that you want.
Could you not just implement the formulas? (Assuming that this is a second order system / has two dominant poles and can be approximated as second order)
For rise and settling time there are a few different approximations, so the internet is your friend.
You could also figure out the damped frequency (from the maxima and minima of your plot data), and use that to figure out the natural frequency:
There are a handful of formulas that relate these various quantities, depending on what you know.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
Is there any way to find the solutions of a set of non-linear complex equations in python?
I need to solve the Bethe equations of the heisenberg model (eg. equation 15 of http://arxiv.org/pdf/1201.5627v1.pdf)
SciPy includes nonlinear numerical solvers, but you may want to consider dedicated software, such as Wolfram Mathematica especially for computation speed considerations.
If the maths is the problem at some point, consider posting to the Math Stack Exchange website
You can use Sage. Sage notebook is the browser-based interface of Sage.
Most of the scientific/ Mathematical (SciPy,NumPy,Sympy...) python libraries are integrated with Sage so you do not have to call these libraries explicitly.