I am looking for a way to duplicate the interpolate.linear() function that exists in versions of flux for influx 2.x. I am working with an influx 1.8.10 system and would like to be able to interpolate linearly over some data. I was wondering if there was a function definition for the linear() function that would make it easy for me to mimic in influx 1.8 or if there are easier ways of achieving the same goal.
Hello @ticchioned,
The version of flux in 1.8 is quite old.
You could maybe use:
With conditional filtering after windowing such that if your original data doesnāt exist, then use the values from the contrib package referenced above.
However, Iām not confident that that function will work with the Flux version thatās supported in 1.x.
Thanks
Thank you for the response @Anaisdg! I was able to get the linear regression function implemented and working but am a little confused at how I can use this function to achieve linear interpolation. For example, say I have a dayās worth of ~1 second data. I would like to window that data every 5 min and only receive ONE interpolated value per 5 min. In 2.x I go and get the data I would like to window, call interpolate.linear(every: 5m) then just get the first() value in each window. Is it possible to achieve something similar to that with linear regression? my thought would be to limit this function to only work with two points at a time, those points being the points right before and right after the point I am trying to interpolate.
Hello @ticchioned,
Thereās this function:
But I donāt know if itās available to you in 1.8
@Anaisdg It is not available in the version Iām using but that function does exactly what I need!
@ticchioned,
Can you upgrade? <3
@Anaisdg, Im actually trying to support 1.8.x, 2.0.x, and 2.1.x. I have this function working in all three but was hoping to bring the interpolation in 1.8 off of the client and onto the server. Looks like itāll be staying on the client for now