5-bostonhousing-mixturemodel-regression

简介
  • 利用 Boston houseing 属性预测房价, 变量可能会存在交互作用
  • 所以考虑使用混合模型

1. load package

Code
import MLJ:predict
using MLJ

2. load data

Code
X, y= @load_boston;

3. MLJ workflow

3.1 define model

Code
modelType= @load GaussianMixtureRegressor pkg = "BetaML"
gmr= modelType()

(fitResults, cache, report) = MLJ.fit(gmr, 1, X, y);
import BetaML ✔
Iter. 1:    Var. of the post  21.74887448784977       Log-likelihood -21687.09917379566
[ Info: For silent loading, specify `verbosity=0`. 

3.2 results

Code
y_res= predict(gmr, fitResults, X)
rmse(y_res,y)
7.9566567641159605