Question
Can someone help me or point me in the right direction for finishing the following pieces of code: ---------------------------------------------------------------------------------------------------------------------------------------- 1: GenomeMetric.java /** * Compute the
Can someone help me or point me in the right direction for finishing the following pieces of code: ---------------------------------------------------------------------------------------------------------------------------------------- 1: GenomeMetric.java
/** * Compute the Increasing Confidence Similarity Metric between (item) profiles. */
package similarity.metric.profile;
import profile.Profile; import similarity.metric.SimilarityMetric;
public class GenomeMetric implements SimilarityMetric
}
} ---------------------------------------------------------------------------------------------------------------------------------------- 2: IncConfidenceMetric.java
/** * Compute the Increasing Confidence Similarity Metric between (item) profiles. */
package similarity.metric.profile;
import java.util.Set; import similarity.metric.SimilarityMetric; import profile.Profile;
public class IncConfidenceMetric implements SimilarityMetric
/** * constructor - creates a new CosineMetric object */ public IncConfidenceMetric() { } /** * computes the similarity between profiles * @param profile 1 * @param profile 2 */ @Override public double getSimilarity(final Profile p1, final Profile p2) { // calculate similarity using conf(X => Y) / conf(!X => Y) return 0.0;
}
} ---------------------------------------------------------------------------------------------------------------------------------------- To be used by the: BrowsedItemRecommender.java class
package alg.np;
import java.util.List; import java.util.ArrayList;
import alg.Recommender; import profile.Profile; import similarity.SimilarityMap; import similarity.metric.SimilarityMetric; import util.reader.DatasetReader; import util.Item;
public class BrowsedItemRecommender extends Recommender { private SimilarityMap
/** * constructor - creates a new BrowsedItemRecommender object */ public BrowsedItemRecommender(DatasetReader reader, final Integer itemId,final SimilarityMetric
return scores; }
/** * @returns the recommendations based on the target item * @param itemId - the target item ID */ public List
// User profile Profile userProfile = reader.getUserProfiles().get(userId); if (scores==null || scores.getIds().size()==0) { return new ArrayList
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started