Learn R Programming

OptHoldoutSize (version 0.1.0.1)

plot.optholdoutsize: Plot estimated cost function

Description

Plot estimated cost function, when parametric method is used for estimation.

Draws cost function as a line and indicates minimum. Assumes a power-law form of k2 unless parameter k2 is set otherwise.

Usage

# S3 method for optholdoutsize
plot(x, ..., k2form = powerlaw)

Value

No return value; draws a plot only.

Arguments

x

Object of type optholdoutsize

...

Other arguments passed to plot() and lines()

k2form

Function governing expected cost to an individual sample given a predictive score fitted to n samples. Must take two arguments: n (number of samples) and theta (parameters). Defaults to a power-law form powerlaw(n,c(a,b,c))=a n^(-b) + c.

Examples

Run this code

# Simple example

N=100000;
k1=0.3
A=8000; B=1.5; C=0.15; theta=c(A,B,C)

res1=optimal_holdout_size(N,k1,theta)

plot(res1)

Run the code above in your browser using DataLab