Constructor
new ConstantPrior(c)
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
c |
number | the constant prior value |
Classes
Members
c :number
- Source:
Type:
- number
Methods
fit(_inputs, outputs)
- Description:
Fits the prior to the arithmetic mean of
outputs. Matches Rustfit(_, training_outputs) { self.c = training_outputs.mean() }. nalgebra'smean()divides by N (element count), matching JS arithmetic mean.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
_inputs |
Array.<Array.<number>> | ignored |
outputs |
Array.<number> | training output values |
prior(inputs) → {Array.<number>}
- Description:
Returns a constant vector of length
inputs.length, each entry = this.c. Matches Rustprior(input) → DVector::from_element(input.nrows(), self.c).
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
inputs |
Array.<Array.<number>> | one sample per row |
Returns:
constant array, length = inputs.length
- Type
- Array.<number>
(static) default(_inputDimension) → {ConstantPrior}
- Description:
Creates the default ConstantPrior with c = 0. Matches Rust
ConstantPrior::default(_input_dimension) → Self::new(0f64).
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
_inputDimension |
number | ignored |
Returns:
- Type
- ConstantPrior