def __init__(self, records, mixtures): Model.__init__(self, records) self.mixtures = mixtures self.mu = np.random.permutation(records)[0:mixtures] self.cov = np.ones( (mixtures, self.dimensions, self.dimensions)) * np.cov(records.T) self.theta = np.ones(mixtures) * (1 / mixtures)
def __init__(self, training_set=None, testing_set=None): Model.__init__(self, training_set, testing_set) # points that define the target function self.point1 = (random.uniform(-1, 1), random.uniform(-1, 1)) self.point2 = (random.uniform(-1, 1), random.uniform(-1, 1)) self.weights = [0., 0., 0.]
def __init__(self, training_set=None, testing_set=None, weights=None): Model.__init__(self, training_set, testing_set) if weights is None: self.weights = np.array([[0., 0., 0.]]).T else: self.weights = weights # points that define the target function self.point1 = (random.uniform(-1, 1), random.uniform(-1, 1)) self.point2 = (random.uniform(-1, 1), random.uniform(-1, 1))
def __init__(self, training_set=None, testing_set=None): Model.__init__(self, training_set, testing_set)
def __init__(self,records): Model.__init__(self,records) self.mu = np.random.permutation(records)[0] self.cov = np.cov(records.T) self.cov = np.diag(np.diag(self.cov)) self.nu = 1000
def __init__(self, records, factors): Model.__init__(self, records) self.factors = factors self.mu = np.mean(records, 0) self.cov = np.diag(np.cov(records.T)) self.phi = np.random.rand(self.dimensions, factors)