predict_tweaked: Tweaked predict to take into account levels that are not in...

View source: R/predict_tweaked.R

predict_tweakedR Documentation

Tweaked predict to take into account levels that are not in the training set but in the test set and remove these rows.

Description

This function applies the logistic regression predict after carefully removing observations of categorical features' levels absent from the training set..

Usage

predict_tweaked(model, df, c_iter)

Arguments

model

The logistic regression model to use to predict on a test set.

df

The whole test set which class has to be predicted.

c_iter

The segment considered (given by the tree).

Value

A dataframe of predictions (in rows: the observations, in cols: the class probabilities) given by the model given in input, eventually tweaked if some levels are unknown to it.

Author(s)

Adrien Ehrhardt


glmtree documentation built on May 29, 2024, 9:37 a.m.