Struct light_curve_feature::features::Bins
source · [−]pub struct Bins<T, F> where
T: Float,
F: FeatureEvaluator<T>, { /* private fields */ }
Expand description
Sampled time series meta-feature
Binning time series to bins with width $\mathrm{window}$ with respect to some $\mathrm{offset}$. $j-th$ bin interval is $[j \cdot \mathrm{window} + \mathrm{offset}; (j + 1) \cdot \mathrm{window} + \mathrm{offset})$. Binned time series is defined by $$ t_j^* = (j + \frac12) \cdot \mathrm{window} + \mathrm{offset}, $$ $$ m_j^* = \frac{\sum{m_i / \delta_i^2}}{\sum{\delta_i^{-2}}}, $$ $$ \delta_j^* = \frac{N_j}{\sum{\delta_i^{-2}}}, $$ where $N_j$ is a number of sampling observations and all sums are over observations inside considering bin. Bins takes any other feature evaluators to extract features from sample time series
- Depends on: time, magnitude, magnitude error
- Minimum number of observations: as required by sub-features, but at least 1
- Number of features: as provided by sub-features
Implementations
sourceimpl<T, F> Bins<T, F> where
T: Float,
F: FeatureEvaluator<T>,
impl<T, F> Bins<T, F> where
T: Float,
F: FeatureEvaluator<T>,
pub fn new(window: T, offset: T) -> Self
pub fn set_window(&mut self, window: T) -> &mut Self
pub fn set_offset(&mut self, offset: T) -> &mut Self
sourcepub fn add_feature(&mut self, feature: F) -> &mut Self
pub fn add_feature(&mut self, feature: F) -> &mut Self
Extend a feature to extract from binned time series
pub fn default_window() -> T
pub fn default_offset() -> T
Trait Implementations
sourceimpl<T, F> Default for Bins<T, F> where
T: Float,
F: FeatureEvaluator<T>,
impl<T, F> Default for Bins<T, F> where
T: Float,
F: FeatureEvaluator<T>,
sourceimpl<'de, T, F> Deserialize<'de> for Bins<T, F> where
T: Float,
F: FeatureEvaluator<T>,
T: Float,
F: FeatureEvaluator<T>,
impl<'de, T, F> Deserialize<'de> for Bins<T, F> where
T: Float,
F: FeatureEvaluator<T>,
T: Float,
F: FeatureEvaluator<T>,
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl<T, F> EvaluatorInfoTrait for Bins<T, F> where
T: Float,
F: FeatureEvaluator<T>,
impl<T, F> EvaluatorInfoTrait for Bins<T, F> where
T: Float,
F: FeatureEvaluator<T>,
sourcefn size_hint(&self) -> usize
fn size_hint(&self) -> usize
Size of vectors returned by eval(), get_names() and get_descriptions() Read more
sourcefn min_ts_length(&self) -> usize
fn min_ts_length(&self) -> usize
Minimum time series length required to successfully evaluate feature
sourcefn is_t_required(&self) -> bool
fn is_t_required(&self) -> bool
If time array used by the feature
sourcefn is_m_required(&self) -> bool
fn is_m_required(&self) -> bool
If magnitude array is used by the feature
sourcefn is_w_required(&self) -> bool
fn is_w_required(&self) -> bool
If weight array is used by the feature
sourcefn is_sorting_required(&self) -> bool
fn is_sorting_required(&self) -> bool
If feature requires time-sorting on the input TimeSeries
sourceimpl<T, F> FeatureEvaluator<T> for Bins<T, F> where
T: Float,
F: FeatureEvaluator<T>,
impl<T, F> FeatureEvaluator<T> for Bins<T, F> where
T: Float,
F: FeatureEvaluator<T>,
sourcefn eval(&self, ts: &mut TimeSeries<'_, T>) -> Result<Vec<T>, EvaluatorError>
fn eval(&self, ts: &mut TimeSeries<'_, T>) -> Result<Vec<T>, EvaluatorError>
Vector of feature values or EvaluatorError
sourcefn eval_or_fill(&self, ts: &mut TimeSeries<'_, T>, fill_value: T) -> Vec<T>
fn eval_or_fill(&self, ts: &mut TimeSeries<'_, T>, fill_value: T) -> Vec<T>
Returns vector of feature values and fill invalid components with given value
sourcefn check_ts_length(
&self,
ts: &TimeSeries<'_, T>
) -> Result<usize, EvaluatorError>
fn check_ts_length(
&self,
ts: &TimeSeries<'_, T>
) -> Result<usize, EvaluatorError>
Checks if TimeSeries has enough points to evaluate the feature
sourceimpl<T, F> FeatureNamesDescriptionsTrait for Bins<T, F> where
T: Float,
F: FeatureEvaluator<T>,
impl<T, F> FeatureNamesDescriptionsTrait for Bins<T, F> where
T: Float,
F: FeatureEvaluator<T>,
sourceimpl<T, F> JsonSchema for Bins<T, F> where
T: Float,
F: FeatureEvaluator<T>,
impl<T, F> JsonSchema for Bins<T, F> where
T: Float,
F: FeatureEvaluator<T>,
sourcefn is_referenceable() -> bool
fn is_referenceable() -> bool
Whether JSON Schemas generated for this type should be re-used where possible using the $ref
keyword. Read more
sourcefn schema_name() -> String
fn schema_name() -> String
The name of the generated JSON Schema. Read more
sourcefn json_schema(gen: &mut SchemaGenerator) -> Schema
fn json_schema(gen: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
sourceimpl<T, F> Serialize for Bins<T, F> where
T: Float,
F: FeatureEvaluator<T>,
T: Float,
F: FeatureEvaluator<T>,
impl<T, F> Serialize for Bins<T, F> where
T: Float,
F: FeatureEvaluator<T>,
T: Float,
F: FeatureEvaluator<T>,
Auto Trait Implementations
impl<T, F> RefUnwindSafe for Bins<T, F> where
F: RefUnwindSafe,
T: RefUnwindSafe,
impl<T, F> Send for Bins<T, F>
impl<T, F> Sync for Bins<T, F> where
F: Sync,
impl<T, F> Unpin for Bins<T, F> where
F: Unpin,
T: Unpin,
impl<T, F> UnwindSafe for Bins<T, F> where
F: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
sourceimpl<Src, Scheme> ApproxFrom<Src, Scheme> for Src where
Scheme: ApproxScheme,
impl<Src, Scheme> ApproxFrom<Src, Scheme> for Src where
Scheme: ApproxScheme,
sourcefn approx_from(src: Src) -> Result<Src, <Src as ApproxFrom<Src, Scheme>>::Err>
fn approx_from(src: Src) -> Result<Src, <Src as ApproxFrom<Src, Scheme>>::Err>
Convert the given value into an approximately equivalent representation.
sourceimpl<Dst, Src, Scheme> ApproxInto<Dst, Scheme> for Src where
Dst: ApproxFrom<Src, Scheme>,
Scheme: ApproxScheme,
impl<Dst, Src, Scheme> ApproxInto<Dst, Scheme> for Src where
Dst: ApproxFrom<Src, Scheme>,
Scheme: ApproxScheme,
type Err = <Dst as ApproxFrom<Src, Scheme>>::Err
type Err = <Dst as ApproxFrom<Src, Scheme>>::Err
The error type produced by a failed conversion.
sourcefn approx_into(self) -> Result<Dst, <Src as ApproxInto<Dst, Scheme>>::Err>
fn approx_into(self) -> Result<Dst, <Src as ApproxInto<Dst, Scheme>>::Err>
Convert the subject into an approximately equivalent representation.
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T, Dst> ConvAsUtil<Dst> for T
impl<T, Dst> ConvAsUtil<Dst> for T
sourcefn approx(self) -> Result<Dst, Self::Err> where
Self: ApproxInto<Dst, DefaultApprox>,
fn approx(self) -> Result<Dst, Self::Err> where
Self: ApproxInto<Dst, DefaultApprox>,
Approximate the subject with the default scheme.
sourcefn approx_by<Scheme>(self) -> Result<Dst, Self::Err> where
Self: ApproxInto<Dst, Scheme>,
Scheme: ApproxScheme,
fn approx_by<Scheme>(self) -> Result<Dst, Self::Err> where
Self: ApproxInto<Dst, Scheme>,
Scheme: ApproxScheme,
Approximate the subject with a specific scheme.
sourceimpl<T> ConvUtil for T
impl<T> ConvUtil for T
sourcefn approx_as<Dst>(self) -> Result<Dst, Self::Err> where
Self: ApproxInto<Dst, DefaultApprox>,
fn approx_as<Dst>(self) -> Result<Dst, Self::Err> where
Self: ApproxInto<Dst, DefaultApprox>,
Approximate the subject to a given type with the default scheme.
sourcefn approx_as_by<Dst, Scheme>(self) -> Result<Dst, Self::Err> where
Self: ApproxInto<Dst, Scheme>,
Scheme: ApproxScheme,
fn approx_as_by<Dst, Scheme>(self) -> Result<Dst, Self::Err> where
Self: ApproxInto<Dst, Scheme>,
Scheme: ApproxScheme,
Approximate the subject to a given type with a specific scheme.