Notes on Perl PDL - PowerPoint PPT Presentation

1 / 10
About This Presentation
Title:

Notes on Perl PDL

Description:

Notes on Perl PDL – PowerPoint PPT presentation

Number of Views:77
Avg rating:3.0/5.0
Slides: 11
Provided by: Madi1
Category:
Tags: pdl | notes | perl | rand

less

Transcript and Presenter's Notes

Title: Notes on Perl PDL


1
Notes on Perl PDL
  • David Madigan

2
(No Transcript)
3
(No Transcript)
4
I zeroes(3, 3) I-gtdiagonal(0, 1) . 1
diagonal between dimensions 0 and 1
assignment operator
x used for matrix multiplication
b pdl 1,2,3,7,8,9 c b x b c b x
I
5
What you probably mean is b
a-gtcopy (or b pdl a)
6
(No Transcript)
7
(No Transcript)
8
slicing and dicing... (y,_at_x) rcols
'simulated.txt' x transpose(cat(ones(y),_at_x))
a 1_at_x number of predictor variables my
numObs y-gtnelem first five rows of x a
x-gtslice(",04")
9
cross-validation example
if (K gt 1) for (i0 iltnumObs i)
cvRandomrand(1) i i 1 j
1 foreach temp (sort keys cvRandom)
cvcvRandomtemp i j if (j gt
int(numObs/K)) j 1 i i1
if (i gt K) i K the last fold
gets whatever is left over
averageAccuracy 0 cv pdl(_at_cv)
undef _at_cv
10
idxTrain which(cv ! cvIndex) xTrain
X-gtdice_axis(1,idxTrain)-gtcopy yTrain
Y-gtdice(idxTrain) idxTest which(cv
cvIndex) xTest X-gtdice_axis(1,idxTest)-gtco
py yTest Y-gtdice(idxTest) matinv(
xTrain-gttranspose x xTrain )
Write a Comment
User Comments (0)
About PowerShow.com