Difference between fit as argument and fit as function?

(Jihyun00) #1


What is difference between fit as chainable function and fit as argument in .es() function?

When I use fit as chainable function,

.es(index='test', ... blahblah ).fit('average')

value 0 in graph changes graph's average value.

But, when I use fit as argument in .es() function,

 .es(index='test', fit='average')

 .es(index='test', fit='none')

 .es(index='test', fit='carry')

Any change didn't occur.

Can anybody explain what is fit as argument in .es function?

(Rashid Khan) #2

fit= in datasources, eg .es(fit=carry)
This is used for interpolating points when a data source returns timestamps that don't perfectly align with what timelion wants. Timelion generates a series that would best fit what you're asking for, and then leaves it up to the data source to give it something back, but not every data source can live up to timelion's expectations. For example, most .wbi() data sets only have yearly resolution, so timelion must fill in the spaces when asking for something more granular, such as weekly:

.fit() as a function, eg .es().fit(average)
.fit() applies to null points in an existing series. null is a perfectly valid thing to have in a series, but usually denotes something is missing, so I provided .fit() to try to interpolate nulls into something else.

For example, in the case below I am intentionally setting any point less than 5000 to null, then interpolating between the known values

(system) #3