Skip to content

Commit

Permalink
Added getProbabilityDistribution method.
Browse files Browse the repository at this point in the history
  • Loading branch information
Olcay Taner YILDIZ committed Apr 24, 2021
1 parent fb539f4 commit 7a8044d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Sources/Math/DiscreteDistribution.swift
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,14 @@ public class DiscreteDistribution{
return 0.0
}
}

public func getProbabilityDistribution() -> [String : Double]{
var result : [String: Double] = [:]
for item in keys{
result[item] = getProbability(item: item)
}
return result
}

/**
The getProbabilityLaplaceSmoothing method takes an item as an input returns the smoothed value to which the
Expand Down

0 comments on commit 7a8044d

Please sign in to comment.