How Weka draw ROC curve from KNN (IBk)? - weka

I have read a lot about ROC curve before posting.
So, I didn't understand how Weka draw the ROC curves. I can't find the thereshold to variate to generate the points in the curve. Thanks,

Weka uses a class called TheresholdCurve from a method in the Evaluation class.
In this class there are all the points of the ROC Curve.
The threshold will variate depending on the classification used. See here for more details.

Related

Easiest and fastest draw a sigmoid curve with Teechart

i'm looking for a fast way to draw a sigmoid curve in Tchart. I really have difficulties to make it work. I tried to do it with Line Series and Fast Line Series but instead of a smoothed curve i obtain a straight one and i don't see an option to smoothen the curve. Is there an option that i can use to smoothen the curve or is there another C/C++ library which allows me to create bar charts and also sigmoid curves very easily and fast?
You can set the TLineSeries Smoothed property to true.
You can find an example in the "Features Demo", sources here:

plot Roc curve for ANN and SVM

I'm using ANN and SVM for classification of 6 classes. All works well, but I'd like to measure accuracies of the classifiers using ROC curves.
I can easily get the confusion matrix for each of the classifiers but I don't know what parameter I should change to get more points and actually plot the ROC curves.
Could someone help me please!

What is the fastest way to calculate position cluster centers constriant by a concave polygon

I have a distribution of weighted 2D pose estimates (position + orientation) that are samples of an unknown PDF of a systems pose. All estimates and the underlying real position are constrained by a concave polygon.
The picture shows an exemplary distribution. The magenta colored circles are the estimates, the radius line indicates the estimated direction. The weights are indicated by the circles diameter. The red dot is the weighted mean, the yellow cirlce indicates the variance and the direction but is of no importance for the following problem:
From all estimates I want to derive the most likely position of the system.
Up to now I have evaluated the following approaches:
Using the estimate with the highest weight: Gives poor results since one estimate with a high weight outperforms several coinciding estimates with slightly lower weights.
Weighted Mean: Not applicable since the mean might lie outside the polygon as in the picture (red dot with yellow circle).
Weighted Median: Would work but does neglect potential clusters. E.g. in the image below two clusters are prominent of which one is more likely than the other.
Additionally I have looked into K-Means and K-Medoids. For K-Means I do not know the most efficient way to constrain the centers to the polygon. K-Medoids seems to work, but has poor performance (O(n^2)), which is important since I have a high number of estimates (contrary to explanatory picture)
What would be the ideal algorithm to solve this kind of problem ?
What complexity can be achieved ?
Are there readily available algorithms in c++ that solve this problem, or can be easily adapted to solve it?
k-means may also yield an estimate outside your polygons.
Such constraints are beyond the clustering use case. But nothing prevents you from devising a method to correct the estimates afterwards.
For non-convex data, DBSCAN may be worth a try. You could even incorporate line-of-sight into Generalized DBSCAN easily. But I'm not convinced that clustering will help for your overall objective.

3D Graph cut with shape prior

I'm applying 3D graph cuts based on Yuri Boykov's implementation in C++, itk and boost for min cut/max flow. First I provide some foreground and background seeds. Then I create the graph and assign the weight to the edges using 3D neighborhood (boundary term):
weight=vcl_exp(-vcl_pow(pixelDifference,2)/(2.0*sigma*sigma)),
being sigma a noise function.
Then I assign the source/sink edges depending on the intensity probability histogram (regional term):
this->Graph->add_tweights(nodeIterator.Get(),
-this->Lambda*log(sinkHistogramValue),
-this->Lambda*log(sourceHistogramValue));
So the energy function is E= regional term+boundary term. Then, the cut is compute with Boycov's implementation, but I don't understand exactly how. Anyway, now I want to add a shape prior to the cut, but I have no clue on how to do it.
Do I have to change the weight of the edges?
Do I have to create another energy function? And if so, how?
How could I provide both functions to the mincut/max flow algorithm?
Hope my questions are easily understandable.
Thank you very much,
Karen

Convert Mouse Points to Quadratic BSplines

I'm writing a drawing program. I'm trying to take an ordered list mouse positions, and approximate a smooth Quadratic BSpline Curve. Does anyone know how to accomplish this?
Thanks!
"B-spline curve fitting based on adaptive curve refinement using dominant points" by Park & Lee and "Fair interpolation and approximation of B-splines by energy minimization and points insertion" by Vassilev seem to be solving this problem. Also there look like a few references on the first link that should help you.
Converting data points to control points in areas of high curvature and removing data points in areas of little curvature is a general approach.