Hej, does anyone know how I can check in ESPER if a value is NaN? I want to get the slope of some variables which works, but the first value is always NaN. I want to exclude that value.
value ='NaN' and
value = NaN does not work
Try Double.isNaN(...). On the JVM it is "Double.NaN!=Double.NaN" making "isNaN" the right choice.
Related
I'm using flexlm_exporter to export my license usage to Prometheus and from Prometheus to custom service (Not Graphana).
As you know Prometheus hides missing values.
However, I need those missing values in my metric values, therefore I added to my prom query or vector(0)
For example:
flexlm_feature_used_users{app="vendor_lic-server01",name="Temp"} or vector(0)
This query adds a empty metric with zero values.
My question is if there's a way to merge the zero vector with each metric values?
Edit:
I need grouping, at least for a user and name labels, so vector(0) is probably not the best option here?
I tried multiple solutions in different StackOverflow threads, however, nothing works.
Please assist.
It would help if you used Absent with labels to convert the value from 1 to zero, use clamp_max
( Metrics{label=“a”} OR clamp_max(absent(notExists{label=“a”}),0))
+
( Metrics2{label=“a”} OR clamp_max(absent(notExists{label=“a”}),0)
Vector(0) has no label.
clamp_max(Absent(notExists{label=“a”},0) is 0 with label.
If you do sum(flexlm_feature_used_users{app="vendor_lic-server01",name="Temp"} or vector(0)) you should get what you're looking for, but you'll lose possibility to do group by, since vector(0) doesn't have any labels.
I needed a similar thing, and ended up flattening the options. What worked for me was something like:
(sum by xyz(flexlm_feature_used_users{app="vendor_lic-server01",name="Temp1"} + sum by xyz(flexlm_feature_used_users{app="vendor_lic-server01",name="Temp2"}) or
sum by xyz(flexlm_feature_used_users{app="vendor_lic-server01",name="Temp1"} or
sum by xyz(flexlm_feature_used_users{app="vendor_lic-server01",name="Temp2"}
There is no an easy generic way to fill gaps in returned time series with zeroes in Prometheus. But this can be easily done via default operator in VictoriaMetrics:
flexlm_feature_used_users{app="vendor_lic-server01",name="Temp"} default 0
The q default N fills gaps with the given default value N per each time series returned from q. See more details in MetricsQL docs.
Whenever I sample, I get the same results for a given temperature value. Is there a way to configure a random seed or another value that controls the output?
Try calling math.randomseed(os.time()) once at the start of the program.
I'm trying to improve the mahout recommendation implementation in a project, and I found out that my predecessor used tanimotoCoefficientSimilarity for a dataset with preference value 1-5. I changed it to UncenteredCosineSimilarity, and now I'm trying to test its improvement in performance.
I tried using AverageAbsoluteDifferenceEvaluator on both, but realised that this should not be used for Tanimoto since it does not return the expected value of the preference.
However, the value seems odd and I don't quite understand what the value this implementation is returning represents. The average preference value of the dataset is 3.2, and if Tanimoto was to return a value in the range [0,1], then the output of AverageAbsoluteDifferenceEvaluator must be in the range [2.2, 3.2], but it consistently returns a value in the range [0.8, 1.1].
Does anyone have explanation for this?
Thank you.
TanimotoCoefficientSimilarity works without coefficients - so AverageAbsoluteDifferenceEvaluator not have any sense for TanimotoCoefficientSimilarity
We'll have to compute:
y*log(y_compute)+(1-y)*(1-y_compute)
so when we get y_compute 1. or 0.,this problem would show up. What should I do to avoid it?
Your expression y_compute maybe contains an exponential, e.g. coming from theano.tensor.nnet.sigmoid? In that case, it should usually never reach exact 0 or 1. In those cases you can then just use your expression or theano.tensor.nnet.crossentropy_categorical_1hot directly.
If for whatever reason you have exact 0 and 1, another way is to clip the input to the crossentropy. Try e.g. replacing y_compute with theano.tensor.clip(y_compute, 0.001, 0.999), knowing that this will restrict the range of the logarithm.
How can I express a number in Objective-C "infinitely" close to zero but still larger. Essentially I want the smallest positive number.
I want to express the number, .0000000000000001 in a simpler form.
What's the smallest number I can get without it being zero?
Use scientific notation when dealing with really small or really large numbers:
double reallyTiny = 1.0e-16; // .0000000000000001
But the best way to start with the smallest number possible is to use:
double theTiniestPositive = DBL_MIN; // 2.2250738585072014e-308
Use the nextafter function, as found here. It is of the format nextafter(x, y) and returns the closest value to x in direction of y.
Try the value DBL_MIN or FLT_MIN, they should be 1E-37.