How to chart a line and a fixed point in the same chart in Looker - data-visualization

I want to compare precision-recall curve of my model to current rule based model precision-recall. So I want to have a chart with a line and a fixed point. Data looks like following:
threshold
precision
recall
current precision
current recall
0.01
0.05
0.93
. 0.55
. 0.35.
0.02
0.07
0.87
. 0.55
. 0.35.
0.03
0.09
0.81
. 0.55
. 0.35.
.
.
.
Please note current precision/current recall values are constant for each row.
I want to have a line (or scatter plot) of precision recall and mark the current precision/recall point in the same chart.
Is there a way to do this in Looker?

Go to the chart option under the "Series" tab (see pic 1), and for current precision/recall, change the type to scatter. For the remaining dimensions( precision and recall curve), change it to an area or line chart. Also, you can even go to the "Y" tab and drag current recall and precision to the right axis if you want. The final result should be similar to pic 2.

Related

Increase numerical input in steps

I want to set a numerical input to increase in steps over time. The numerical input should start at 0.2 and increase in steps of 0.2 every 60 seconds. I have been aiming to use express vi as much as possible and am using LabVIEW for a myRIO.

How do I access the original point in periodic 2 D Triangulation in CGAL?

I did the periodic triangulation of five points with the default domain.The points were (0.2,0.3), (0.5,0.1), (0.7,0.6), (0.8,0.8), (0.5,0.11). After iterating over the faces for 1 sheeted covering and printing the output, I got this result:
0.8 0.8 , 0.7 0.6 , 1.2 1.3 and so on.
I know the points 1.2 1.3 means the point 0.2 0.3 as the domain is iso_ rectangle. But I want it to print 0.2 0.3 instead of 1.2 1.3 so that I could find the delaunay neighbours of a given vertex.
Thank you
If you have a vertex v of the periodic triangulation t, then t.periodic_point(v) gives you a periodic point, whose first element is a point in the original domain. I guess that this point is what you are looking for.
See
http://doc.cgal.org/latest/Periodic_2_triangulation_2/classCGAL_1_1Periodic__2__triangulation__2.html#a217b56b0d5a8c222573f520a69a696ee
and
http://doc.cgal.org/latest/Periodic_2_triangulation_2/classCGAL_1_1Periodic__2__triangulation__2.html#abc48042ca1cff117f7c5201c0ffdabfa

how to increase size of a cell and keep it fixed in gnuplot

I have posted similar question 3 days ago ("increase pixel size"). However, so far, no answer. Therefore, I decided to start a new thread and make my question more precise.
I have 2D matrix 68 per 68 and I want to make a heat map from it. I did it, but
the problem is that for the matrix of this size cells become really small.
https://www.dropbox.com/s/b4ygdg0csa7d5y5/TEST_68x68.png?dl=0
Therefore, I want to increase size of a cell, for example twice and keep it fixed.
So, my idea was to define a matrix, which will be twice bigger than 68/68 that is 68*2/68*2 and then increase size of cell accordingly. I tried it: https://www.dropbox.com/s/spwo6zik1f077z3/TEST_incresedTwice.png?dl=0
However, dimensions of cells are also scaled. They have the same size like in the standard 68/68 matrix (see the first link). The cells also move. For example, instead of being bound to their original coordinates, all my values are moved by 10. I know why. The question is, how to prevent GNUPLOT from doing it?
Summarizing, I want to increase size of cells, keep their dimensions fixed and plot these bigger cells on a 68*2/68*2 matrix.
Any suggestions? Thank you.
Thank you.
Code below:
set terminal png transparent truecolor nocrop enhanced size 2000,2000 font
"arial bold,30”
set output 'TEST_now.png'
set size ratio 1
set palette rgbformulae -21,-22,-23
set xrange[-0.5:136.5]
set yrange[-0.5:136.5]
plot "matrix.dat" matrix using ($1*2):($2*2):3 with image not
With the image plotting style you get 68×68 pixels, all of the same size. You cannot increase the size of single pixels.
In your data file you have many entries with 0.00 which is what makes the white pixels. And, in the data file you have section like
0.000 0.457 0.000 0.000
0.000 0.000 0.000 0.000
0.000 0.073 0.337 0.000
0.002 0.993 0.916 0.000
0.000 0.003 0.000 0.000
and here I wouldn't even know how you would expect the pixels to be enlarged.
On possibility would be to plot every pixel as square point and use a large point size. This however leads to overlapping of immediately neighbouring points. To reduce this problem a bit, you could first draw all points with 0 < z <= 0.1, then those with 0.1 < z <= 0.2 and so on:
set terminal pngcairo transparent truecolor nocrop enhanced size 2000,2000 font "arial bold,30”
set output 'TEST_now.png'
set size ratio 1
set palette rgbformulae -21,-22,-23
set autoscale xfix
set autoscale yfix
set offsets 1,1,1,1
plot for [i=1:10] "matrix.dat" matrix using ($3 > 0.1*(i-1) && $3 <= 0.1*i ? $1 : 1/0):2:3 with points pt 5 ps 7 palette notitle
I don't know of any "smarter" solution, even when disregarding gnuplot's abilities.

Writing the right sax code

i wrote a SAX(symbolic aggregate approximation) classification code using synthetic control training and testing data but it never gives me the right accuracy( i got 0.2 error and the real was 0.02 error) using window_size = 16 and alphabet = 10 . I want to know what is the right code to do so.

Incorrect Hue returned by getHue function

I am converting RGB to HSV using built in function of UIColour: - (BOOL)getHue:(CGFloat *)hue saturation:(CGFloat *)saturation brightness:(CGFloat *)brightness alpha:(CGFloat *)alpha but for some RGB it is not giving correct output.
CGFloat h,s,v,a;
UIColor *tColor=[UIColor colorWithRed:(230.0/255.0) green:(226.0/255.0) blue:(226.0/255.0) alpha:1.0];
BOOL success=[tColor getHue:&h saturation:&s brightness:&v alpha:&a];
NSLog(#"Output-> Success:%d, hue:%f, sat:%f, value:%f, alpha:%f",success,h,s,v,a);
Actual output:
Output-> Success:1, hue:1.000000, sat:0.017391, value:0.901961, alpha:1.000000
Expected output:
hue:0, sat:0.017391, value:0.901961, alpha:1.000000
Note: I have derived this expected output from some online conversion tools(ex: http://www.rapidtables.com/convert/color/rgb-to-hsv.htm)
You can see clearly difference in Hue? So, why such difference in Hue and how can I get my expected output?
While most of the rest of the world defines "hue" as going from 0 to 360 degrees, for UIColor it's 0.0 to 1.0.
Actually, just as 360.000 degrees is identical to 0.000 in geometry or someone else's hue, so we have with UIColor's hue that 1.000 is identical to 0.000 (hallucinate as many zero digits after the decimal point as you like, and in binary if you prefer.)
So, your "actual output" and "expected output" are identical. In coding, keep hue in the range 0.000 to 0.999, and change 1.000 to 0.000 to avoid trouble.
Hue in HSB or HSL is measured as degrees around a colour circle, starting with red at 0° and wrapping back around to red at 360°; so a hue of 0° is the same as a hue of 360°. UIColor maps this range (0–360°) to the values 0–1 (0°=0.0, 360°=1.0).