RandomFeature
public class RandomFeature : Hashable
Undocumented
-
Undocumented
Declaration
Swift
public var name: String -
Undocumented
Declaration
Swift
public var values: Set<FeatureValue> -
Undocumented
Declaration
Swift
public var entropy: Float? -
Undocumented
Declaration
Swift
public var giniImpurity: Float? -
Initializer for Feature
Declaration
Swift
public init(data: [[String]], column: Int)Parameters
data2D string of data
columncolumn number of feature
Return Value
Feature
-
Returns most occuring featureValue
Declaration
Swift
public func getDominantValue() -> FeatureValueReturn Value
FeatureValue
-
Returns standard deviation of continous target variable
Declaration
Swift
public func getTargetStdDev(data: [[String]], target: Int) -> FloatParameters
datastring array of data
targetcol num of target var
Return Value
standard deviation of target variable as Float
-
Computes info gain values for categorical feature/feature values
Declaration
Swift
public func getInfoGainCategorical(data: [[String]], target: Int) -> (Float, Float)Parameters
datastring array of data
targetcol num of target var
Return Value
- infoGain: from choosing the feature as float
- featureEntropy: entropy of the feature as float
-
Computes info gain values for numerical feature/feature values
Declaration
Swift
public func getInfoGainNumerical(data: [[String]], target: Int) -> (Float, RandomDataSet, RandomDataSet, Float)Parameters
datastring array of data
targetcol num of target var
Return Value
- entropy: entropy of the feature
- dataset1: dataset split part 1
- dataset2: dataset split part 2
- cutoff: for the dataset split
-
Computes gini impurity values for categorical feature/feature values
Declaration
Swift
public func getGiniImpurityCategorical(data: [[String]], target: Int) -> FloatParameters
datastring array of data
targetcol num of target var
Return Value
gini impurity of choosing feature as float
-
Computes gini impurity values for numerical feature/feature values
Declaration
Swift
public func getGiniImpurityNumerical(data: [[String]], target: Int) -> (Float, RandomDataSet, RandomDataSet, Float)Parameters
datastring array of data
targetcol num of target var
Return Value
- giniImpurity: gini impurity of the feature
- dataset1: dataset split part 1
- dataset2: dataset split part 2
- cutoff: for the dataset split
-
Required == func for implementing Hashable
Declaration
Swift
public static func == (lhs: RandomFeature, rhs: RandomFeature) -> BoolParameters
lhsfeature on the left
rhsfeature on the right
Return Value
true if feature names is same else false
-
Empty required hash func for implementing Hashable
Declaration
Swift
public func hash(into hasher: inout Hasher)
RandomFeature Class Reference