I am refactoring some code and want the classes a little higher in the inheritance chain to be a bit more strict with their parameters. Since I'm not sure I'm explaining this correctly, here is what I have:
public interface ISvdPredictor
{
List<string> Users { get; set; }
List<string> Artists { get; set; }
float PredictRating(ISvdModel model, string user, string artist);
float PredictRating(ISvdModel model, int userIndex, int artistIndex);
}
ISvdPredictoruses ISvdModel:
public interface ISvdModel
{
float[,] UserFeatures { get; set; }
float[,] ArtistFeatures { get; set; }
}
Now I want to implement another variation:
public interface IBiasSvdPredictor : ISvdPredictor
{
float PredictRating(IBiasSvdModel model, string user, string artist);
float PredictRating(IBiasSvdModel model, int userIndex, int artistIndex);
}
Uses IBiasSvdModelthat comes from ISvdModel:
public interface IBiasSvdModel : ISvdModel
{
float GlobalAverage { get; set; }
float[] UserBias { get; set; }
float[] ArtistBias { get; set; }
}
IBiasSvdPredictorwill not work with ISvdModel.
The problem is that during implementation IBiasSvdPredictorI would have to implement 2 pairs of PredictRating methods. One of ISvdPredictor, and the other of IBiasSvdPredictor. What do I need to do to be able to simply implement those from IBiasSvdPredictor?
generics, PredictRating BiasSvdPredictor IBiasSvdModel where. , . , , .
EDIT: - , . https://github.com/gligoran/RecommendationSystem. BSc.