sklearn-matlab icon indicating copy to clipboard operation
sklearn-matlab copied to clipboard

which functions i should use?

Open vlada140 opened this issue 5 years ago • 5 comments

Hello Steven,

i have collected data in xls file (about 300 values and i will collect more). In my algorithm i am doing edge detection with canny operator. Canny operator has two threshold and i want to implement some of your function to find best threshold for Canny (chose some of 300 values from database). So, i have objective parameter to find best match its FIgure of Merit (FoM). So, i want to check all 300 values and find where is FoM greatest, which your functions i should use?

vlada140 avatar Mar 24 '20 12:03 vlada140

Your question is not specific enough. Can you calculate FoM for each value?

steven2358 avatar Mar 26 '20 14:03 steven2358

Your question is not specific enough. Can you calculate FoM for each value?

Yes. For example:

image = imread(pathToImage); 
image = rgb2gray(image);``
edgeCanny = edge(image, treshold1, treshold2); 
FoM = calculateFom(edgeCanny, refImage); % I  have already this function and refImage

So, for threshold1 and treshold2 I already have 300 values and i will collect more. I want to use some of your function to find best values for treshold1 and threshold2 in order to achieve better FoM.

vlada140 avatar Mar 26 '20 14:03 vlada140

Seems like a problem of hyperparameter tuning. This is often done through grid search, which I haven't implemented yet in this library. You can do a basic grid search with a few lines of Matlab code though.

Alternatively, you can check Matlab's bayesopt algorithm, which is often better than grid search but a little harder to configure. https://www.mathworks.com/help/stats/bayesopt.html

steven2358 avatar Mar 26 '20 22:03 steven2358

Oh, bayesopt is to hard to configure.
Can you give me example with a few lines of matlab code ?

vlada140 avatar Mar 26 '20 22:03 vlada140

I don't have any examples that are shorter or easier than the ones on https://www.mathworks.com/help/stats/bayesopt.html I suggest you study those.

steven2358 avatar Mar 26 '20 23:03 steven2358