sigmoidal regression with scipy, numpy, python, etc

Using scipy.optimize.leastsq: import numpy as np import matplotlib.pyplot as plt import scipy.optimize def sigmoid(p,x): x0,y0,c,k=p y = c / (1 + np.exp(-k*(x-x0))) + y0 return y def residuals(p,x,y): return y – sigmoid(p,x) def resize(arr,lower=0.0,upper=1.0): arr=arr.copy() if lower>upper: lower,upper=upper,lower arr -= arr.min() arr *= (upper-lower)/arr.max() arr += lower return arr # raw data x = np.array([821,576,473,377,326],dtype=”float”) … Read more

Open source alternative to MATLAB’s fmincon function? [closed]

Is your problem convex? Linear? Non-linear? I agree that SciPy.optimize will probably do the job, but fmincon is a sort of bazooka for solving optimization problems, and you’ll be better off if you can confine it to one of the categories below (in increasing level of difficulty to solve efficiently) Linear Program (LP) Quadratic Program … Read more

Is the order of a Python dictionary guaranteed over iterations?

Yes, the same order is guaranteed if it is not modified. See the docs here. Edit: Regarding if changing the value (but not adding/removing a key) will affect the order, this is what the comments in the C-source says: /* CAUTION: PyDict_SetItem() must guarantee that it won’t resize the * dictionary if it’s merely replacing … Read more

Plotting with C# [closed]

There is OxyPlot which I recommend. It has packages for WPF, Metro, Silverlight, Windows Forms, Avalonia UI, XWT. Besides graphics it can export to SVG, PDF, Open XML, etc. And it even supports Mono and Xamarin for Android and iOS. It is actively developed too. There is also a new (at least for me) open … Read more

Principal components analysis using pandas dataframe

Most sklearn objects work with pandas dataframes just fine, would something like this work for you? import pandas as pd import numpy as np from sklearn.decomposition import PCA df = pd.DataFrame(data=np.random.normal(0, 1, (20, 10))) pca = PCA(n_components=5) pca.fit(df) You can access the components themselves with pca.components_

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)