In the membership_weights function we compute the inverse of the covariance. This returns a Result which we call expect on - leading to a panic if the inverse could not be computed.
We should instead make the membership_weights function return a LearningResult which we try! to unwrap in the train function. To do this we'll need to map the rulinalg error returned by the inverse function to a rusty-machine error.
In the
membership_weights
function we compute the inverse of the covariance. This returns aResult
which we callexpect
on - leading to a panic if the inverse could not be computed.We should instead make the
membership_weights
function return aLearningResult
which wetry!
to unwrap in thetrain
function. To do this we'll need to map the rulinalg error returned by theinverse
function to a rusty-machine error.