Skip to content

Instantly share code, notes, and snippets.

@fitomad
Last active January 21, 2018 20:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fitomad/9feb4211ca08a397f60e6ff7d2ee7613 to your computer and use it in GitHub Desktop.
Save fitomad/9feb4211ca08a397f60e6ff7d2ee7613 to your computer and use it in GitHub Desktop.
//
// 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