排列组合数
1 | from scipy.misc import comb |
最优化相关
Optimization and root finding (scipy.optimize) — SciPy v0.18.1 Reference Guide
from scipy.optimize import leastsq
Minimize the sum of squares of a set of equations.
1 | ###最小二乘法试验### |
from scipy.optimize import linprog
1 | Minimize a linear objective function subject to linear equality and inequality constraints. |
from scipy.optimize import minimize
Minimization of scalar function of one or more variables.
In general, the optimization problems are of the form:
minimize f(x) subject to1
2g_i(x) >= 0, i = 1,...,m
h_j(x) = 0, j = 1,...,p
where x is a vector of one or more variables. g_i(x) are the inequality constraints. h_j(x) are the equality constrains.
Optionally, the lower and upper bounds for each element in x can also be specified using the bounds argument.