|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objecttypes.StaticUtils
public class StaticUtils
Some methods that are useful to have in linear models.
| Constructor Summary | |
|---|---|
StaticUtils()
|
|
| Method Summary | |
|---|---|
static void |
add(double[] u,
double[] v,
double[] w,
double d)
u = v + d*w |
static int |
argmax(double[] v)
computes arg max_i v[i] |
static double |
computeAccuracy(LinearClassifier h,
ArrayList<ClassificationInstance> data)
The accuracy of classifier h on the data set data. |
static double |
computeAccuracyS(LinearTagger h,
ArrayList<SequenceInstance> data)
The accuracy of classifier h on the data set data. |
static double |
dotProduct(double[] v,
double[] w)
|
static double |
dotProduct(SparseVector v,
double[] w)
the dot product between a sparse vector v and a dense vector w. |
static double[] |
exp(double[] vec)
res = exp(vec) |
static double[][] |
exp(double[][] vec)
res = exp(vec) |
static double[][][] |
exp(double[][][] vec)
res = exp(vec) |
static LinearTagger |
loadTagger(String fname)
|
static SparseVector |
lookupCollection(Collection<String> in,
Alphabet a)
|
static void |
plusEquals(double[] w,
double[] v,
double d)
w <- w + d*v |
static void |
plusEquals(double[] w,
SparseVector v)
update: w = w + v |
static void |
plusEquals(double[] w,
SparseVector v,
double d)
w <- w + d*v |
static void |
plusEquals(SparseVector w,
SparseVector v)
w <- w + v |
static void |
saveTagger(LinearTagger h,
String fname)
|
static void |
shuffle(ArrayList list,
long seed)
shuffle a list (intended as a list of instances) in place using seed as the random seed. |
static ArrayList<ClassificationInstance>[] |
split(ArrayList<ClassificationInstance> l,
int splitAt)
|
static ArrayList<SequenceInstance>[] |
splitS(ArrayList<SequenceInstance> l,
int splitAt)
|
static double |
sum(double[] probs)
|
static double |
twoNormSquared(double[] w)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public StaticUtils()
| Method Detail |
|---|
public static double dotProduct(SparseVector v,
double[] w)
public static double dotProduct(double[] v,
double[] w)
public static void shuffle(ArrayList list,
long seed)
public static double computeAccuracyS(LinearTagger h,
ArrayList<SequenceInstance> data)
public static double computeAccuracy(LinearClassifier h,
ArrayList<ClassificationInstance> data)
public static ArrayList<ClassificationInstance>[] split(ArrayList<ClassificationInstance> l,
int splitAt)
public static ArrayList<SequenceInstance>[] splitS(ArrayList<SequenceInstance> l,
int splitAt)
public static void plusEquals(double[] w,
SparseVector v)
public static double[] exp(double[] vec)
public static double[][] exp(double[][] vec)
public static double[][][] exp(double[][][] vec)
public static double twoNormSquared(double[] w)
w -
public static double sum(double[] probs)
probs -
public static void plusEquals(SparseVector w,
SparseVector v)
public static void plusEquals(double[] w,
SparseVector v,
double d)
public static void plusEquals(double[] w,
double[] v,
double d)
public static void add(double[] u,
double[] v,
double[] w,
double d)
public static int argmax(double[] v)
public static SparseVector lookupCollection(Collection<String> in,
Alphabet a)
public static void saveTagger(LinearTagger h,
String fname)
throws IOException
IOException
public static LinearTagger loadTagger(String fname)
throws IOException,
ClassNotFoundException
IOException
ClassNotFoundException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||