causal_hub/estimators/parameters/sufficient_statistics/mod.rs
1mod table;
2mod trajectory;
3
4use crate::{models::Labelled, types::Labels};
5
6/// A struct representing a sufficient statistics estimator.
7#[derive(Clone, Copy, Debug)]
8pub struct SSE<'a, D> {
9 dataset: &'a D,
10}
11
12impl<'a, D> SSE<'a, D> {
13 /// Constructs a new sufficient statistics estimator.
14 ///
15 /// # Returns
16 ///
17 /// A new `SSE` instance.
18 ///
19 #[inline]
20 pub const fn new(dataset: &'a D) -> Self {
21 Self { dataset }
22 }
23}
24
25impl<D> Labelled for SSE<'_, D>
26where
27 D: Labelled,
28{
29 #[inline]
30 fn labels(&self) -> &Labels {
31 self.dataset.labels()
32 }
33}