Functions
The following functions are available globally.
- 
                  
                  Creates a subset Random DataSet where all examples have a specific feature value | Helper Function DeclarationSwift public func createRandomDataSet(randomFeature: RandomFeature, featureValue: FeatureValue, data: [[String]], target: Int) -> RandomDataSetParametersfeaturefeature we are targeting featureValuefeature value desired datacurrent data targetcol num for target var Return Valuesubset Random DataSet where all examples have the desired feature value 
- 
                  
                  Deletes a column in a given 2D array | Helper function DeclarationSwift public func deleteColumn(data: [[String]], column: Int) -> [[String]]Parametersdataarray from which column is to be deleted columncol num to be deleted Return Valuearray with column deleted 
- 
                  
                  Returns the column number for a given column name | Helper Function DeclarationSwift public func getColumnNumber(colName: String, data: [[String]]) -> IntParameterscolNamename of the feature at the column dataarray getting the col num from Return Valuecolumn number for the given column name 
- 
                  
                  Creates a subset DataSet where all examples have a specific feature value | Helper Function DeclarationSwift public func createDataSet(feature: Feature, featureValue: FeatureValue, data: [[String]], target: Int) -> DataSetParametersfeaturefeature we are targeting featureValuefeature value desired datacurrent data targetcol num for target var Return Valuesubset DataSet where all examples have the desired feature value 
- 
                  
                  Splits a given dataset into two at a index | Helper Function DeclarationSwift public func splitDataSet(data: [[String]], startIndex: Int) -> ([[String]], [[String]])Parametersdatadata tp be split startIndexsplit index - value included in second dataset returned Return ValueTwo string arrays split from original arrayß 
- 
                  
                  Returns deterministic SVD contains sign-corrected versions of left singular vectors and right singular vectors from input matrix. Reference: “Determinitic SVD” DeclarationSwift public func deterministicSvd<T: FloatingPoint & TensorFlowScalar>( _ input: Tensor<T>, columnBasedSignFlipping: Bool = true ) -> (s: Tensor<T>, u: Tensor<T>, v: Tensor<T>)ParametersinputThe input matrix. Return ValueThe sign corrected svd to ensure deterministic output. 
- 
                  
                  Returns the Minkowski distance between two tensors for the given distance metric p.Reference: “Minkowski distance” DeclarationSwift public func minkowskiDistance<Scalar: TensorFlowFloatingPoint>( _ a: Tensor<Scalar>, _ b: Tensor<Scalar>, p: Int ) -> Tensor<Scalar>ParametersaThe first tensor. bThe second tensor. pThe order of the norm of the difference: ||a - b||_p.Return ValueThe Minkowski distance based on value of p.
- 
                  
                  Returns the Euclidean distance between two tensors. Reference: “Euclidean distance” DeclarationSwift public func euclideanDistance<Scalar: TensorFlowFloatingPoint>( _ a: Tensor<Scalar>, _ b: Tensor<Scalar> ) -> Tensor<Scalar>ParametersaThe first tensor. bThe second tensor. Return ValueThe Euclidean distance: ||a - b||_2.
 Functions  Reference
      Functions  Reference