Convert this vector to the new mllib-local representation.
        This does NOT copy the data; it copies references.

        :return: :py:class:`pyspark.ml.linalg.SparseVector`

        .. versionadded:: 2.0.0
776636
def asML(self):
        
        return newlinalg.SparseVector(self.size, self.indices, self.values)
713186
public SparseDoubleVector getColumnVector(int column) {
        SparseDoubleVector values = new SparseHashDoubleVector(rows);
        for (int row = 0; row < rows; ++row) {
            double d = get(row, column);
            if (d != 0)
                values.set(row, d);
        }
        return values;
    }
957681
public static DenseTensor copyOf(Tensor tensor) {
    if (tensor instanceof DenseTensor) {
      // Tensors are immutable, so there's no reason to copy the input.
      return (DenseTensor) tensor;
    } else {
      DenseTensorBuilder builder = new DenseTensorBuilder(tensor.getDimensionNumbers(),
          tensor.getDimensionSizes());
      double[] otherValues = tensor.getValues();
      for (int i = 0; i < otherValues.length; i++) {
        builder.putByKeyNum(tensor.indexToKeyNum(i), otherValues[i]);
      }
      return builder.buildNoCopy();
    }
  }
1010991
def physical_vector_from_hypercube_vector(self, hypercube_vector):
        
        return list(
            map(lambda prior_tuple, unit: prior_tuple.prior.value_for(unit), self.prior_tuples_ordered_by_id,
                hypercube_vector))
442476
def copy(self):
        
        df = super(Ensemble,self).copy()
        pe = ParameterEnsemble.from_dataframe(df=df,pst=self.pst.get())
        pe.__istransformed = self.istransformed
        return pe
223216
def copy(self):
        
        return HyperCube(
            dimensions=self.dimensions(copy=False),
            arrays=self.arrays(),
            properties=self.properties())
990571
def copy(self):
        
        inst = super(type(self), type(self)).empty(**self.dimensions)
        
        # Need to copy all attributes, fields, relations
        inst.__attributes__ = {k: v.copy() for k, v in self.__attributes__.items()}
        inst.__fields__ = {k: v.copy() for k, v in self.__fields__.items()}
        inst.__relations__ = {k: v.copy() for k, v in self.__relations__.items()}
        inst.maps = {k: m.copy() for k, m in self.maps.items()}
        inst.dimensions = self.dimensions.copy()
        
        return inst
963748
public SparseDoubleVector getColumnVector(int column) {
        checkIndices(0, column);
        rowReadLock.lock();
        SparseDoubleVector values = new SparseHashDoubleVector(rows.get());
        for (int row = 0; row < rows.get(); ++row) {
            AtomicSparseVector rowEntry = getRow(row, -1, false);            
            double value = 0;
            if (rowEntry != null && (value = rowEntry.get(column)) != 0)
                values.set(row, value);
        }
        rowReadLock.unlock();
        return values;
    }
1080504
public static SparseVector fromCSV(String csv) {
        return Vector.fromCSV(csv).to(Vectors.SPARSE);
    }
474796
def to_libSVM (sel_features = nil)
      
      #Load the selected features into a Hash
      sf = Hash.new
      if (sel_features)
        sel_features.each do |f| 
          sf[f] = 1 
        end
      end
      
      self.define_features if (@train) #This method is needed only for training data
      
      output = Array.new
      @fvs.each do |vector, label|
        line = Array.new
        line.push(label)
        
        (1..@features.f_count).each do |id| #OPTIMIZE: Change this line to consider sorting in case of terms being features
          term = @features.term(id)
          if ( value = vector[term] ) then
            line.push([id, value].join(":")) if sf[term] or not sel_features
          end
        end
        output.push(line.join(" "))
      end
      output.join("\n")
    end
73888
def transpose(self):
        
        if len(self._row_name_list) != len(self._rows):
            raise NotImplementedError("You can't rotate a FVM that doesn't have all rows keyed")

        fvm = FeatureVectorMatrix(default_value=self._default_value, default_to_hashed_rows=self._default_to_hashed_rows)
        fvm._update_internal_column_state(self._row_name_list)
        for idx, r in enumerate(self.get_matrix().transpose()):
            fvm.add_row(r.tolist(), self._column_name_list[idx])

        return fvm
90218
def _data(self, copy=False):
        
        data = {}
        for key, obj in vars(self).items():
            if isinstance(obj, (pd.Series, pd.DataFrame, pd.SparseSeries, pd.SparseDataFrame)):
                if copy:
                    data[key] = obj.copy(deep=True)
                else:
                    data[key] = obj
        return data
935278
def copy(self):
        

        m = Map(features=self._features, width=self._width,
                   height=self._height, **self._attrs)
        m._folium_map = self._folium_map
        return m
854878
public static SparseVector fromCollection(Collection<? extends Number> list) {
        return Vector.fromCollection(list).to(Vectors.SPARSE);
    }
144437
def copy(self):
        
        new_term = PauliTerm("I", 0, 1.0)  # create new object
        # manually copy all attributes over
        for key in self.__dict__.keys():
            val = self.__dict__[key]
            if isinstance(val, (dict, list, set)):  # mutable types
                new_term.__dict__[key] = copy.copy(val)
            else:  # immutable types
                new_term.__dict__[key] = val

        return new_term
896511
def cast_vector_to dtype, source=nil, nm_dtype=nil
      source = @data.to_a if source.nil?

      new_vector =
        case dtype
        when :array   then Daru::Accessors::ArrayWrapper.new(source, self)
        when :nmatrix then Daru::Accessors::NMatrixWrapper.new(source, self, nm_dtype)
        when :gsl then Daru::Accessors::GSLWrapper.new(source, self)
        when :mdarray then raise NotImplementedError, 'MDArray not yet supported.'
        else raise ArgumentError, "Unknown dtype #{dtype}"
        end

      @dtype = dtype
      new_vector
    end
1154573
def _toSparkGLM(self, model):
        
        skl_cls = type(model)
        py_cls = self._skl2spark_classes[skl_cls].py
        jvm_cls_name = self._skl2spark_classes[skl_cls].jvm
        intercept = model.intercept_
        weights = model.coef_
        if len(np.shape(weights)) == 1\
                or (len(np.shape(weights)) == 2 and np.shape(weights)[0] == 1):
            # Binary classification
            uid = _randomUID(skl_cls)
            _java_model = _new_java_obj(self.sc, jvm_cls_name, uid, Vectors.dense(weights), float(intercept))
            return py_cls(_java_model)
        elif len(np.shape(weights)) == 2 and skl_cls == SKL_LogisticRegression:
            # Multiclass label
            raise ValueError("Converter.toSpark cannot convert a multiclass sklearn Logistic" +
                             " Regression model to Spark because Spark does not yet support" +
                             " multiclass.  Given model is for %d classes." %
                             np.shape(weights)[0])
        else:
            raise Exception("Converter.toSpark experienced unknown error when trying to convert" +
                            " a model of type: " + type(model) + "  " + len(np.shape(weights)))