172 m_featureImportances.resize(inputs);
176 auto batch =
subBatch(view, oobIndices[m]);
177 double errorBefore = this->loss(batch.label,this->model(m)(batch.input));
178 for(std::size_t i=0; i!=inputs;++i) {
179 RealVector vOld= column(batch.input,i);
181 std::shuffle(v.begin(), v.end(), rng);
182 noalias(column(batch.input,i)) = v;
183 double errorAfter = this->loss(batch.label,this->model(m)(batch.input));
184 noalias(column(batch.input,i)) = vOld;
185 m_featureImportances(i) += this->
weight(m) * (errorAfter - errorBefore) / batch.size();