logSetup: Manipulate the Data for Logistic Regression

Description Usage Arguments Value

View source: R/logisticRegression.R

Description

This function takes in the output of generateData (see parameter data for specifics) and sets it up for logistic regression by mutating the dataframe so reward and transition refer to the last trial's reward and transition type and the stay column means that the (first) action on trial n is equal to the (first) action on trial n = 1. This function gets called in getLogFit and getLogPreds as needed.

Usage

1

Arguments

data

The output of generateData; if pure Q-learning, it manipulateData should be called first. If it's DynaQ, the data should be processed and the Q table removed.

Value

A dataframe with 23 columns. New ones include lastAction1 (numeric) that tracks the action taken in the previous trial, lastReward that tracks whether the last trial was rewarded, (numeric), and stay (factor) which tracks whether trial n and n+1 have the same first action.


jdtrat/dynaq documentation built on July 24, 2020, 7:18 a.m.