示例#1
0
 def read_data(self, path):
     conn = sql.connect(path)
     self.V = pd.read_sql('select * from data;', conn).values
     self.S = data.euclidean_to_simplex(self.V)
     self.Yl = data.angular_to_euclidean(data.euclidean_to_angular(self.V))
     self.A = data.euclidean_to_angular(self.Yl)
     self.Vi = self.cast_to_cube(self.A)
     self.pVi = self.probit(self.Vi)
     conn.close()
     return
示例#2
0
 def read_data(self, path):
     self.Z = pd.read_csv(path).values
     self.R = self.Z.max(axis=1)
     self.V = (self.Z.T / self.R).T
     self.S = data.euclidean_to_simplex(self.V)
     self.A = data.euclidean_to_angular(self.V)
     self.Yl = data.angular_to_euclidean(self.A)
     self.Vi = self.cast_to_cube(self.A)
     self.pVi = self.probit(self.Vi)
     self.I = (np.arange(self.Z.shape[0]), )
     return
示例#3
0
 def generate_posterior_predictive(self, n_per_sample = 10):
     """ Generates posterior prediction, projects to hypercube, then
     casts to angular space """
     hyp = self.generate_posterior_predictive_hypercube(n_per_sample)
     return dm.euclidean_to_angular(hyp)
示例#4
0
 def generate_posterior_predictive_angular(self, n_per_sample = 1):
     hypercube = self.generate_posterior_predictive_hypercube(n_per_sample)
     return euclidean_to_angular(hypercube)