Skip to content

Instantly share code, notes, and snippets.

@neomatrixcode
Forked from anonymous/Beaker Share
Created December 7, 2015 07:10
Show Gist options
  • Save neomatrixcode/9164f88383fea33beb59 to your computer and use it in GitHub Desktop.
Save neomatrixcode/9164f88383fea33beb59 to your computer and use it in GitHub Desktop.
Beaker Share
{"beaker":"2","evaluators":[{"name":"Html","plugin":"Html","view":{"cm":{"mode":"htmlmixed"}},"shellID":null},{"name":"Latex","plugin":"Latex","view":{"cm":{"mode":"stex"}},"shellID":null},{"name":"IPython","plugin":"IPython","imports":"","supplementalClassPath":"","view":{"cm":{"mode":"python"}},"shellID":"BEC14821482642AC8E43C866958E93C1","setup":"%matplotlib inline\nimport numpy\nimport matplotlib\nfrom matplotlib import pylab, mlab, pyplot\nnp = numpy\nplt = pyplot\nfrom IPython.display import display\nfrom IPython.core.pylabtools import figsize, getfigs\nfrom pylab import *\nfrom numpy import *\n"},{"name":"JavaScript","plugin":"JavaScript","jsSetting2":"","jsSetting1":"","view":{"cm":{"mode":"javascript","background":"#FFE0F0"}},"shellID":null},{"name":"R","plugin":"R","view":{"cm":{"mode":"r"}},"shellID":"ea4f2bb4-36fc-4535-8461-c0aace63f348"}],"cells":[{"id":"section001","type":"section","level":1,"title":"Hello Notebook","collapsed":false,"evaluatorReader":false},{"id":"code2uVtKX","type":"code","evaluator":"R","input":{"body":"# This cell is for the R language. Try running \"hist(rnorm(100))\".\ntrain <- data.frame(ClaimID = c(1,2,3),\n RearEnd = c(TRUE, FALSE, TRUE),\n Fraud = c(TRUE, FALSE, TRUE))"},"output":{"selectedType":"Table","elapsedTime":961,"state":{"datatablestate":{"pagination":{"use":true,"rowsToDisplay":50,"fixLeft":false,"fixRight":false},"columnNames":["ClaimID","RearEnd","Fraud"],"actualalign":["R","L","L"],"colorder":[0,1,2,3],"getCellSho":[true,true,true]}},"result":{"type":"TableDisplay","subtype":"TableDisplay","hasIndex":"true","columnNames":["Index","ClaimID","RearEnd","Fraud"],"values":[[1,1,true,true],[2,2,false,false],[3,3,true,true]],"types":["integer","double","boolean","boolean"]},"pluginName":"R","shellId":"ea4f2bb4-36fc-4535-8461-c0aace63f348"},"evaluatorReader":true,"lineCount":4},{"id":"code1y4wvE","type":"code","evaluator":"R","input":{"body":"library(rpart)\nmytree <- rpart(Fraud ~ RearEnd, data = train, method = \"class\", minsplit = 2, minbucket = 1)\nmytree"},"output":{"state":{},"result":"n= 3 \n\nnode), split, n, loss, yval, (yprob)\n * denotes terminal node\n\n1) root 3 1 TRUE (0.3333333 0.6666667) \n 2) RearEnd< 0.5 1 0 FALSE (1.0000000 0.0000000) *\n 3) RearEnd>=0.5 2 0 TRUE (0.0000000 1.0000000) *","selectedType":"Text","pluginName":"R","shellId":"ea4f2bb4-36fc-4535-8461-c0aace63f348","elapsedTime":576,"dataresult":"ERROR: invalid object type rpart"},"evaluatorReader":true,"lineCount":3},{"id":"codeVty6AS","type":"code","evaluator":"R","input":{"body":"#library(rattle)\nlibrary(rpart.plot)\n#library(RColorBrewer)\n \n#fancyRpartPlot(mytree)"},"output":{"state":{},"result":{"type":"BeakerDisplay","innertype":"Error","object":["Error in library(rpart.plot) : there is no package called 'rpart.plot'",""]},"selectedType":"BeakerDisplay","pluginName":"R","shellId":"ea4f2bb4-36fc-4535-8461-c0aace63f348","elapsedTime":62,"dataresult":["RColorBrewer","rpart","beaker","base64enc","png","RJSONIO","RCurl","bitops","methods","Rserve","stats","graphics","grDevices","utils","datasets","base"]},"evaluatorReader":true,"lineCount":5},{"id":"markdown188oO3","type":"markdown","body":"Beaker also supports JavaScript, Julia, Groovy, Ruby, Scala, Python3, Java, and Node. To add another language to this notebook, select **Notebook → Language manager** from the menu on top of the screen.\n\nFor general help, see the tutorial notebook under **Help → Tutorial** notebook.","evaluatorReader":false,"mode":"preview"}],"namespace":{}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment