Interpolate bad channel 1, epoch 1:2 using planar interpolation:
= plinterpolate_channel(e10, ch=1, ep=1:2)
e10pl plot(e10.data[1, :, 1])
Plots.plot!(e10pl.data[1, :, 1]) Plots.
(!) Planar interpolation requires electrode locations. Only a single channel may be interpolated at the same time. Channel may be interpolated across more than 1 epoch.
Interpolate bad channel 5, epoch 25 using linear regression, use epochs 17:24 as reference:
= lrinterpolate_channel(e10, ch=5, ep=25)
e10lr iview(e10, e10lr)
Output:
[ Info: Accuracy report:
[ Info: R²: 0.853
[ Info: RMSE: 0.059
[ Info: MAE: 2.884
[ Info: AIC: 36.318
[ Info: BIC: 174.991
(!) Linear regression interpolation requires ≥ 1 epoch of good signal in interpolated channel, as linear regressor is trained using good epochs. The more epochs with good signal, the better interpolation results. Only a single channel at one epoch may be interpolated at the same time.
Interpolate bad channel 5, epoch 25 using RandomForestRegressor, use epochs 17:24 as reference:
using MLJ
using MLJDecisionTreeInterface
= @MLJ.load RandomForestRegressor pkg=DecisionTree verbosity=0
rfr = rfr(max_depth = -1,
rfr_model = 1,
min_samples_leaf = 2,
min_samples_split = 0.0,
min_purity_increase = -1,
n_subfeatures = 500,
n_trees = 1.0,
sampling_fraction = :split)
feature_importance = mlinterpolate_channel(e10, ch=5, ep=25, ep_ref=17:24, model=rfr_model)
e10ml iview(e10, e10ml)
Output:
[ Info: Training machine(RandomForestRegressor(max_depth = -1, …), …).
[ Info: Accuracy report:
[ Info: R²: 0.9834
[ Info: RMSE: 0.4798
(!) Machine learning-based interpolation requires ≥ 1 epoch of good signal in interpolated channel, as the regressor is trained using good epochs. The more epochs with good signal, the better interpolation results. Only a single channel at one epoch may be interpolated at the same time.