Returns fitted coordinates in specified number of dimensions, and
        the amount of variance explained)
975686
def coords_by_dimension(self, dimensions=3):
        

        coords_matrix = self.vecs[:, :dimensions]
        varexp = self.cve[dimensions - 1]
        return coords_matrix, varexp
993010
function(dimensions) {
   var simplex = new gamejs.math.noise.Simplex(Math);
   var surfaceData = [];
   for (var i=0;i<dimensions[0];i++) {
      surfaceData[i] = [];
      for (var j=0;j<dimensions[1];j++) {
         var val = simplex.get(i/50, j/50) * 255;
         surfaceData[i][j] = val;
      }
   }
   return surfaceData;
}
19068
def get_dimension(geometry):
    """"""
    coordinates = geometry["coordinates"]
    type_ = geometry["type"]
    if type_ in ('Point',):
        return len(coordinates)
    elif type_ in ('LineString', 'MultiPoint'):
        return len(coordinates[0])
    elif type_ in ('Polygon', 'MultiLineString'):
        return len(coordinates[0][0])
    elif type_ in ('MultiPolygon',):
        return len(coordinates[0][0][0])
    else:
        raise ValueError("Invalid type '{}'".format(type_))
1233796
def _get_axis_bounds(self, dim, bunch):
        """"""
        if dim in self.attributes:
            # Attribute: specified lim, or compute the min/max.
            vmin, vmax = bunch['lim']
            assert vmin is not None
            assert vmax is not None
            return vmin, vmax
        # PC dimensions: use the common scaling.
        return (-1. / self.scaling, +1. / self.scaling)
1164104
def fit(self, X, y, **kwargs):
        
        self.estimator.fit(X, y, **kwargs)
        self.draw()
        return self
212354
def _get_factors(self, element):
        
        xdim, ydim = element.dimensions()[:2]
        xvals, yvals = [element.dimension_values(i, False)
                        for i in range(2)]
        coords = tuple([v if vals.dtype.kind in 'SU' else dim.pprint_value(v) for v in vals]
                  for dim, vals in [(xdim, xvals), (ydim, yvals)])
        if self.invert_axes: coords = coords[::-1]
        return coords
834511
def _n_parameters(self):
        """"""
        ndim = self.means_.shape[1]
        if self.covariance_type == 'full':
            cov_params = self.n_components * ndim * (ndim + 1) / 2.
        elif self.covariance_type == 'diag':
            cov_params = self.n_components * ndim
        elif self.covariance_type == 'tied':
            cov_params = ndim * (ndim + 1) / 2.
        elif self.covariance_type == 'spherical':
            cov_params = self.n_components
        mean_params = ndim * self.n_components
        return int(cov_params + mean_params + self.n_components - 1)
216480
def infer_x(self, y):
        
        assert len(y) == self.fmodel.dim_y, "Wrong dimension for y. Expected %i, got %i" % (self.fmodel.dim_y, len(y))
        if len(self.fmodel.dataset) == 0:
            return [[0.0]*self.dim_x]
        else:
            _, index = self.fmodel.dataset.nn_y(y, k=1)
            return [self.fmodel.dataset.get_x(index[0])]
485857
def _sampleFromFaces(self):
    
    coordinates = [random.uniform(-1, 1) * dim / 2. for dim in self.dimensions]
    dim = random.choice(range(self.dimension))
    coordinates[dim] = self.dimensions[dim] / 2. * random.choice([-1, 1])
    return coordinates
920503
def _fit(self, index, width, height):
        """"""
        node = self._atlas_nodes[index]
        x, y = node[0], node[1]
        width_left = width
        if x+width > self._shape[1]:
            return -1
        i = index
        while width_left > 0:
            node = self._atlas_nodes[i]
            y = max(y, node[1])
            if y+height > self._shape[0]:
                return -1
            width_left -= node[2]
            i += 1
        return y
11801
def fit(self, X, y=None):
        
        return self.partial_fit(np.concatenate(X, axis=0))
527199
def transform(self, X):
        """"""
        utils.validation.check_is_fitted(self, 's_')
        if self.check_input:
            utils.check_array(X, dtype=[str, np.number])
        return self.row_coordinates(X)
1142172
def _get_axis_dims(self, element):
        
        dims = element.dimensions()[:2]
        if len(dims) == 1:
            return dims + [None, None]
        else:
            return dims + [None]
1138711
def with_added_dimensions(self, n):
        
        if n > 0:
            return Rect(np.pad(self.data, ((0, 0), (0, n)), 'constant'))
        return Rect(self.data[:, :self.dimensions + n])
444484
def Kdiag(self, X):
        """"""
        K_ff = np.zeros(X.shape[0])
        for i,x in enumerate(X):
            K_ff[i] = self.k_ff(x[0],x[0],self.lengthscale[0])
        return K_ff * self.variances[0]
521192
def _raw_dimensions(self):
        """"""
        return tuple(
            _RawDimension(dimension_dict, self._dimension_dicts)
            for dimension_dict in self._dimension_dicts
        )
385073
def fit_params_to_1d_data(logX):
    
    m_max = logX.shape[0]
    p_max = logX.shape[1]
    params = np.zeros((m_max, p_max, 3)) 
    for m_ in range(m_max):
        for p_ in range(p_max):
            params[m_,p_] = skewnorm.fit(logX[m_,p_])
    
    return params