Skip to content

Commit

Permalink
Merge pull request DataScienceSpecialization#25 from bcaffo/master
Browse files Browse the repository at this point in the history
Worked on several lectures in the data products directory
  • Loading branch information
jtleek committed May 6, 2014
2 parents 09b7154 + 12f895e commit e44f504
Show file tree
Hide file tree
Showing 588 changed files with 23,149 additions and 1,752 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file removed 07_RegressionModels/productionLectures/fig/lsm.png
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
20 changes: 10 additions & 10 deletions 09_DevelopingDataProducts/manipulate/index.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ mode : selfcontained # {standalone, draft}
---
## Documentation
- Manipulate is well documented at the Rstudio web site here
- (http://www.rstudio.com/ide/docs/advanced/manipulate)
- http://www.rstudio.com/ide/docs/advanced/manipulate
- From there, try this
```
library(manipulate)
Expand All @@ -34,14 +34,14 @@ manipulate(plot(1:x), x = slider(1, 100))
---
## Example from the regression class
```
freqData <- as.data.frame(table(galton$child, galton$parent))
names(freqData) <- c("child", "parent", "freq")
plot(as.numeric(as.vector(freqData$parent)),
as.numeric(as.vector(freqData$child)),
pch = 21, col = "black", bg = "lightblue",
cex = .05 * freqData$freq,
xlab = "parent", ylab = "child")
lm1 <- lm(galton$child ~ galton$parent)
lines(galton$parent,lm1$fitted,col="red",lwd=3)
library(manipulate)
myHist <- function(mu){
hist(galton$child,col="blue",breaks=100)
lines(c(mu, mu), c(0, 150),col="red",lwd=5)
mse <- mean((galton$child - mu)^2)
text(63, 150, paste("mu = ", mu))
text(63, 140, paste("MSE = ", round(mse, 2)))
}
manipulate(myHist(mu), mu = slider(62, 74, step = 0.5))
```

20 changes: 10 additions & 10 deletions 09_DevelopingDataProducts/manipulate/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ <h2>Documentation</h2>
<li>Manipulate is well documented at the Rstudio web site here

<ul>
<li>(<a href="http://www.rstudio.com/ide/docs/advanced/manipulate">http://www.rstudio.com/ide/docs/advanced/manipulate</a>)</li>
<li><a href="http://www.rstudio.com/ide/docs/advanced/manipulate">http://www.rstudio.com/ide/docs/advanced/manipulate</a></li>
</ul></li>
<li>From there, try this
<code>
Expand All @@ -90,15 +90,15 @@ <h2>Documentation</h2>
<h2>Example from the regression class</h2>
</hgroup>
<article data-timings="">
<pre><code>freqData &lt;- as.data.frame(table(galton$child, galton$parent))
names(freqData) &lt;- c(&quot;child&quot;, &quot;parent&quot;, &quot;freq&quot;)
plot(as.numeric(as.vector(freqData$parent)),
as.numeric(as.vector(freqData$child)),
pch = 21, col = &quot;black&quot;, bg = &quot;lightblue&quot;,
cex = .05 * freqData$freq,
xlab = &quot;parent&quot;, ylab = &quot;child&quot;)
lm1 &lt;- lm(galton$child ~ galton$parent)
lines(galton$parent,lm1$fitted,col=&quot;red&quot;,lwd=3)
<pre><code>library(manipulate)
myHist &lt;- function(mu){
hist(galton$child,col=&quot;blue&quot;,breaks=100)
lines(c(mu, mu), c(0, 150),col=&quot;red&quot;,lwd=5)
mse &lt;- mean((galton$child - mu)^2)
text(63, 150, paste(&quot;mu = &quot;, mu))
text(63, 140, paste(&quot;MSE = &quot;, round(mse, 2)))
}
manipulate(myHist(mu), mu = slider(62, 74, step = 0.5))
</code></pre>

</article>
Expand Down
20 changes: 10 additions & 10 deletions 09_DevelopingDataProducts/manipulate/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ mode : selfcontained # {standalone, draft}
---
## Documentation
- Manipulate is well documented at the Rstudio web site here
- (http://www.rstudio.com/ide/docs/advanced/manipulate)
- http://www.rstudio.com/ide/docs/advanced/manipulate
- From there, try this
```
library(manipulate)
Expand All @@ -34,14 +34,14 @@ manipulate(plot(1:x), x = slider(1, 100))
---
## Example from the regression class
```
freqData <- as.data.frame(table(galton$child, galton$parent))
names(freqData) <- c("child", "parent", "freq")
plot(as.numeric(as.vector(freqData$parent)),
as.numeric(as.vector(freqData$child)),
pch = 21, col = "black", bg = "lightblue",
cex = .05 * freqData$freq,
xlab = "parent", ylab = "child")
lm1 <- lm(galton$child ~ galton$parent)
lines(galton$parent,lm1$fitted,col="red",lwd=3)
library(manipulate)
myHist <- function(mu){
hist(galton$child,col="blue",breaks=100)
lines(c(mu, mu), c(0, 150),col="red",lwd=5)
mse <- mean((galton$child - mu)^2)
text(63, 150, paste("mu = ", mu))
text(63, 140, paste("MSE = ", round(mse, 2)))
}
manipulate(myHist(mu), mu = slider(62, 74, step = 0.5))
```

Loading

0 comments on commit e44f504

Please sign in to comment.