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)
            
}

}

how to correct program init()' is deprecated: Use init(configuration:) instead and handle errors appropriately.

You don't actually state where the error is, but it looks like you're trying to create an object and the the init() method is deprecated, so you need to use the init(configuration:) method instead.

init()' is deprecated: Use init(configuration:) instead and handle errors appropriately.
 
 
Q