Set the weight that this data point should carry. The norm is 1.0 @param weight the new weight value @throws ArithmeticException if the weight value is not a number > 0
(double weight)
| 91 | * @throws ArithmeticException if the weight value is not a number > 0 |
| 92 | */ |
| 93 | public void setWeight(double weight) |
| 94 | { |
| 95 | if(Double.isNaN(weight) || Double.isInfinite(weight) || weight <= 0) |
| 96 | throw new ArithmeticException("Invalid weight assignment of " + weight); |
| 97 | this.weight = weight; |
| 98 | } |
| 99 | |
| 100 | /** |
| 101 | * Returns true if this data point contains any categorical variables, false otherwise. |