pplbench/ppls/jags/logistic_regression.py [17:31]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    def format_data_to_jags(self, data: xr.Dataset) -> Dict:
        # transpose the dataset to ensure that it is the way we expect
        data = data.transpose("item", "feature")
        # we already have all the values to be bound except for X and Y in self.attrs
        attrs: dict = self.attrs.copy()
        attrs["X"] = data.X.values
        attrs["Y"] = data.Y.values
        return attrs

    def extract_data_from_jags(self, samples: Dict) -> xr.Dataset:
        # dim 2 is the chains dimension so we squeeze it out
        return xr.Dataset(
            {
                # alpha dimensions are [1, samples], we want [samples]
                "alpha": (["draw"], samples["alpha"].squeeze(0)),
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



pplbench/ppls/jags/robust_regression.py [17:31]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    def format_data_to_jags(self, data: xr.Dataset) -> Dict:
        # transpose the dataset to ensure that it is the way we expect
        data = data.transpose("item", "feature")
        # we already have all the values to be bound except for X and Y in self.attrs
        attrs: dict = self.attrs.copy()
        attrs["X"] = data.X.values
        attrs["Y"] = data.Y.values
        return attrs

    def extract_data_from_jags(self, samples: Dict) -> xr.Dataset:
        # dim 2 is the chains dimension so we squeeze it out
        return xr.Dataset(
            {
                # alpha, nu, sigma dimensions are [1, samples], we want [samples]
                "alpha": (["draw"], samples["alpha"].squeeze(0)),
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



