Last active
January 21, 2018 20:42
-
-
Save fitomad/9feb4211ca08a397f60e6ff7d2ee7613 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// MARK: - CoreML Methods | |
// | |
extension TablaViewController | |
{ | |
/** | |
Predice el doble de un número usando un modelo `CoreML` | |
- Parameter for: Número del que queremos averiguar su doble | |
- Returns: El doble en caso que la predicción se haya realizado bien | |
*/ | |
private func predictResult(for number: Int) -> Int? | |
{ | |
guard let prediction = try? model.prediction(multiplicador: Double(number)) else | |
{ | |
return nil | |
} | |
return Int(prediction.resultado) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment