June 2019
Intermediate to advanced
308 pages
7h 21m
English
Now we can use our created features to fit RandomForestRegressor to our data and see whether we can improve on the previous scores:
rf = RandomForestRegressor() # first we instantiate RandomForestRegressor from scikit-learnrf.fit(X_train, y_train) # train the regressor model with traing set preds = rf.predict(X_test) # making predictin on unseen observation scores = mean_absolute_error(preds, y_test) # Computing MAEprint('Mean Abs Error: {:.2f}'.format(scores))high_imp_feats = utils.feature_importances(X, reg, feats=10) # Printing feature importance
The preceding code block should produce the following output showing the baseline MAE values and statistics about the engine recording cycles:
Mean Abs Error: 31.04 1: LAST(recordings.cycles.LAST(recordings.sensor_measurement_4)) ...
Read now
Unlock full access