categ_analysis: Profiling analysis of categorical vs. target variable

View source: R/target_profiling.R

categ_analysisR Documentation

Profiling analysis of categorical vs. target variable

Description

Retrieves a complete summary of the grouped input variable against the target variable. Type of target variable must be binary for now. A positive case will be the less representative one. It returns the total positive cases (sum_target)); pecentage of total positive cases (perc_target) that fell in that category (this column sums 1); likelihood or mean of positive cases (mean_target) measured by the total positive cases over total cases in that category; quantity of rows of that category (q_rows) and in percentage (perc_rows) -this column sums 1.

Usage

categ_analysis(data, input, target)

Arguments

data

input data containing the variable to describe

input

string input variable (if empty, it runs for all categorical variable), it can take a single character value or a character vector.

target

string target variable. Binary or two class is only supported by now.

Value

if input has 1 variable, it retrurns a data frame indicating all the metrics, otherwise prints in console all variable results.

Examples

categ_analysis(data_country, "country", "has_flu")

funModeling documentation built on May 29, 2024, 3:24 a.m.