plotting a function like ezplot in matlab in python using matplotlib - matplotlib

I have a a classification function that classify a data point into one of two classes. The problem is, I need a way to plot the decision boundary of two class. While this is easy for linear function. it's cumbersome to find the equation of the boundary. ezplot package in matlab seems to be able to do it. It will plot the result automatically. It works using linear and quadratic function. It doesn't require you to provide the coordinate. In matplotlib, you can only plot if you are given the coordinate. Does anyone know how to do this with matplotlib?

Related

What's the difference between Keras' AUC(curve='PR') and Scikit-learn's average_precision_score?

I am quite confused on the difference between Keras' AUC(curve='PR') and Scikit-learn's average_precision_score. My objective is to compute the Area Under the Precision-Recall Curve (AUPRC), for both Scikit-learn and Keras models. However, these two metrics yield vastly different results!
Did I miss something out on the TensorFlow-Keras documentation at https://www.tensorflow.org/api_docs/python/tf/keras/metrics/AUC, with regards to the use of the AUC function?
As stated in the Scikit-learn documentation, they use a different implementation method:
References [Manning2008] and [Everingham2010] present alternative variants of AP that interpolate the precision-recall curve. Currently, average_precision_score does not implement any interpolated variant. References [Davis2006] and [Flach2015] describe why a linear interpolation of points on the precision-recall curve provides an overly-optimistic measure of classifier performance. This linear interpolation is used when computing area under the curve with the trapezoidal rule in auc.
In the average_precision_score function documentation, you can also read:
This implementation is not interpolated and is different
from computing the area under the precision-recall curve with the
trapezoidal rule, which uses linear interpolation and can be too
optimistic.
I encourage you to look in detail at the different functions and their descriptions available in the metrics module. I also highly recommend to read the related paper.
Lastly, there's also a potentially interested thread here: [AUC] result of tf.metrics.auc doesnot match with sklearn's.

Librosa Spectogram vs Matplotlib Spectrogram

I know spectrogram can be plotted using different functions of the different libraries in python. In matplotlib, plyplot plots spectrogram directly using time-series audio data but librosa first applies short Fourier transform on data before plotting spectrogram.
But I am still confused between two.
Please tell me the detailed difference between
1.librosa.dispay.specshow()
2.matplotlib.pyplot.specgram()
I have searched the internet a lot but couldn't find any relevant information though.
According to librosa documentation, all librosa plotting functions are depends on matplotlib.
All of librosa’s plotting functions rely on matplotlib. To demonstrate everything we can do, it will help to import matplotlib’s pyplot API here.

2D image decomposition

I have a matrix and I want to decompose it into different matrices with low to high frequency limit. As I have noticed, it can be done using wavelet transform. I found something like the figure below for 1D signal and I want to do similar procedure for my 2D matrix using MATLAB. I want to decompose it to different matrices with low to high frequency components in different levels.
I used the matrix tool box, however, when I have problems with extracting the data.
How can I do this using MATLAB?
You are looking for the wavedec2 function.
There's a basic example w/ the function documentation here

python 3d and multidimensional plots

What are the different alternatives available for 3D plotting in python matplotlib? I am using scatterplot and would like to know more about other types of 3d plots. I checked the site http://matplotlib.org/mpl_toolkits/mplot3d/tutorial.html but could not get effective results as I was not able to interpret results effectively. Please let me know of some good 3D plots. Also I would like to try multidimensional plotting and have heard that scatterplot matrix is very effective. Please give some good examples demonstrating the same.

ROC/AUC curves for matplotlib

I have a lot of data that comes from some experiment, just one column "measure" and would like to calculate ROC/AUC curves. I use matplotlib and had a look, but found no way to do with it. I wonder if anyone can share experiences with matplotlib or with any other open source easy to use library for ROC/AUC curves.
Matplotlib is mostly used for plotting things, so you'd need to calculate the curves first and then plot them with matplotlib. There seem to be multiple relevant Python modules:
scipy roc_curve
PyROC
CROC
yard