Post

Replies

Boosts

Views

Activity

init()' is deprecated: Use init(configuration:) instead and handle errors appropriately.
import Foundation struct HeartDiseasePrediction { func predict(input: HeartDiseaseInput) -> (output:Int, probability: Double){ let model = heartDiseasePredictor() let prediction = try? model.prediction(age: input.age, sex: input.sex, cp: input.cp, trestbps: input.trestbps, chol: input.chol, fbs: input.fbs, restecg: input.restecg, thalach: input.thalach, exang: input.exang, oldpeak: input.oldpeak, slope: input.slope, ca: input.ca, thal: input.thal) return (Int(prediction!.target), prediction!.targetProbability[Int64(Int(prediction!.target))]! * 100) } }
2
0
405
Oct ’23