fn evaluate(&self) -> f64
	{
		//calculate mean squared error
		let mut mse = 0.0;
		for point in self.target.iter()
		{
			let error = point.1 - calc_f(&self.fct, point.0);
			mse += error * error;
		}
		mse /= self.target.len() as f64;
		
		//add regularization
		let reg = REGULARIZATION * (self.fct.len() - 1) as f64; //regularization
		
		//return
		-(mse + reg)
	}
//evaluate as inverted mean squared error to target (we want to minimize instead of maximize)
evaluate as inverted mean squared error to target (we want to minimize instead of maximize)
evaluate as inverted mean squared error to target ( we want to minimize instead of maximize )
fn evaluate(&self) -> f64
	{
		//calculate mean squared error
		let mut mse = 0.0;
		for point in self.target.iter()
		{
			let error = point.1 - calc_f(&self.fct, point.0);
			mse += error * error;
		}
		mse /= self.target.len() as f64;
		//add regularization
		let reg = REGULARIZATION * (self.fct.len() - 1) as f64; //regularization
		//return
		-(mse + reg)
	}
fn evaluate ( & self ) -> f64 { //calculate mean squared error let mut mse = 0.0 ; for point in self . target . iter ( ) { let error = point . 1 - calc_f ( & self . fct , point . 0 ) ; mse += error * error ; } mse /= self . target . len ( ) as f64 ; //add regularization let reg = REGULARIZATION * ( self . fct . len ( ) - 1 ) as f64 ; //regularization //return - ( mse + reg ) }
evaluate as inverted mean squared error to target (we want to minimize instead of maximize)
evaluate as inverted mean squared error to target ( we want to minimize instead of maximize )
&self
&self