DataSet
public class DataSet
Undocumented
-
data
Declaration
Swift
public var data: [[String]] -
entropy of the dataset
Declaration
Swift
public var entropy: Float? -
infoGains provided by each feature
Declaration
Swift
public var infoGains: Dictionary<Feature, Float> -
best feature to use to grow tree
Declaration
Swift
public var splitFeature: Feature -
col num of target var
Declaration
Swift
public var target: Int -
standard deviation
Declaration
Swift
public var stdDev: Float -
giniImpurity of the data set
Declaration
Swift
public var giniImpurity: Float? -
Creates a DataSet
Declaration
Swift
public init(data: [[String]], target: Int)Parameters
datadata with labels
targetcolumn number of label
Return Value
DataSet
-
Returns if dataset has same target classification for all examples
Declaration
Swift
public func homogenous() -> (Bool, String)Return Value
- if dataset has same target classification for all examples
- the target classification
-
Returns Coefficient of Standard Deviation
Declaration
Swift
public func getCoeffDev() -> FloatReturn Value
Coefficient of Standard Deviation as Float
-
Returns standard deviation of continous target variable
Declaration
Swift
public func getTargetStdDev() -> FloatReturn Value
standard deviation of target variable as Float
-
Returns mean of continous target variable
Declaration
Swift
public func getTargetMean() -> FloatReturn Value
mean of target variable as Float
-
Returns entropy of dataset and sets entropy
Declaration
Swift
public func getEntropy() -> FloatReturn Value
entropy of dataset as Float
-
Returns the bestFeature with max infoGain to be used in id3
Declaration
Swift
public func getMaxInfoGainFeatureForClassification() -> FeatureReturn Value
best feature
-
Returns the best gini feature i.e. minimum gini impurity
Declaration
Swift
public func getGiniFeature() -> FeatureReturn Value
best feature
-
Returns the feature with most standard deviation reduction
Declaration
Swift
public func getMaxStdReductionFeature() -> FeatureReturn Value
feature
-
Returns gini impurity of the data set
Declaration
Swift
public func getGiniImpurity() -> FloatReturn Value
gini impurity of the data set as a Float
DataSet Class Reference