This interface is for multi-class classification problems where there may be K or K-1 weight vectors for K classes. For regression problems it is treated as K = 1 and there should be only one weight vector. @author Edward Raff
| 12 | * @author Edward Raff |
| 13 | */ |
| 14 | public interface SimpleWeightVectorModel |
| 15 | { |
| 16 | /** |
| 17 | * Returns the raw weight vector associated with the given class index. If |
| 18 | * the given class is an implicit zero vector, a {@link ConstantVector} |
| 19 | * object may be returned. <br> |
| 20 | * Do not alter the returned weight vector, as it will change the model's |
| 21 | * values. <br> |
| 22 | * <br> |
| 23 | * If a regression problem, only {@code index = 0} should be used |
| 24 | * |
| 25 | * @param index the class index to get the weight vector for |
| 26 | * @return the weight vector used for the specified class |
| 27 | */ |
| 28 | public Vec getRawWeight(int index); |
| 29 | |
| 30 | /** |
| 31 | * Returns the bias term used with the weight vector for the given class |
| 32 | * index. If the model does not support or was not trained with bias |
| 33 | * weights, {@code 0} will be returned.<br> |
| 34 | * <br> |
| 35 | * If a regression problem, only {@code index = 0} should be used |
| 36 | * |
| 37 | * @param index the class index to get the weight vector for |
| 38 | * @return the bias term for the specified class |
| 39 | */ |
| 40 | public double getBias(int index); |
| 41 | |
| 42 | /** |
| 43 | * Returns the number of weight vectors that can be returned. For binary |
| 44 | * classification problems the value may be 1 if only a single weight |
| 45 | * vector's sign is used to determine the class. For multi-class problems, |
| 46 | * the weight vector count includes the implicit zero vector (if one is |
| 47 | * being used). |
| 48 | * @return the number of weight vectors for which |
| 49 | * {@link #getRawWeight(int) } can be called. |
| 50 | */ |
| 51 | public int numWeightsVecs(); |
| 52 | } |
no outgoing calls
no test coverage detected