|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.knowceans.corpus.analysis.TopicsConverter org.knowceans.corpus.analysis.AtmTopicsConverter
public class AtmTopicsConverter
ActorMediaTopicAnalyser analyses the results of an LS-AMQ run. It performs the same operations as TopicAnalyser but replaces documents by actors.
Field Summary | |
---|---|
private java.util.Vector<java.lang.String> |
allActors
|
private java.util.HashSet<java.lang.Integer> |
queryActors
|
Constructor Summary | |
---|---|
AtmTopicsConverter()
|
Method Summary | |
---|---|
protected void |
analyseMatching(java.lang.String modelname,
java.lang.String suffix)
Analyse binary actor--topic relations using KL divergence. |
private static double |
kl(double[] p,
double[] q)
KL-divergence between distributions p and q. |
static void |
main(java.lang.String[] args)
|
private double[][] |
matchActors(double[][][] psi,
int p,
int q,
boolean queryActorsOnly)
Build matrix of actor--actor matches according to the Kullback-Leibler-divergence, M_ij = KL(demand_i||supply_j). |
private java.util.HashSet<java.lang.Integer> |
readActors(java.lang.String modelname)
read the actor indices of all actors and those that posted queries. |
void |
run(java.lang.String directory,
java.lang.String model,
java.lang.String suffix)
performs topic analysis, including query topics |
static void |
saveMatching(java.lang.String filename,
java.util.Vector<org.knowceans.map.TreeMultiMap<java.lang.Double,java.lang.Integer>> actors,
java.lang.String comment,
java.lang.String additional)
save the matching information between actors. |
private org.knowceans.map.TreeMultiMap<java.lang.Double,java.lang.Integer> |
sort(double[] ds,
int i,
double d)
sort the array in descending order. |
Methods inherited from class org.knowceans.corpus.analysis.TopicsConverter |
---|
analyse, extractTopics, normaliseRows, posterior, posterior, printMatrix, run, saveTopics, test, truncateMap |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private java.util.Vector<java.lang.String> allActors
private java.util.HashSet<java.lang.Integer> queryActors
Constructor Detail |
---|
public AtmTopicsConverter()
Method Detail |
---|
public static void main(java.lang.String[] args)
public void run(java.lang.String directory, java.lang.String model, java.lang.String suffix)
protected void analyseMatching(java.lang.String modelname, java.lang.String suffix)
modelname
- model file name without extensionsuffix
- of binary files added to model namecomment
- for original matrixpublic static void saveMatching(java.lang.String filename, java.util.Vector<org.knowceans.map.TreeMultiMap<java.lang.Double,java.lang.Integer>> actors, java.lang.String comment, java.lang.String additional)
filename
- actors
- comment
- additional
- private org.knowceans.map.TreeMultiMap<java.lang.Double,java.lang.Integer> sort(double[] ds, int i, double d)
ds
- arrayi
- maximum elements in return type or -1d
- minimum element value
private double[][] matchActors(double[][][] psi, int p, int q, boolean queryActorsOnly)
psi
- matrix[][][] of actor--topic associations, by relations in
first indexp
- relation of left KL argumentq
- relation of right KL argumentqueryActorsOnly
- set KL divergence to Double.INF for all
non-querying actors
private static double kl(double[] p, double[] q)
p
- discrete pdfq
- discrete pdf (q.length = p.length)
private java.util.HashSet<java.lang.Integer> readActors(java.lang.String modelname)
modelname
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |