3 Confidence Intervals
Definition: Confidence Interval
A confidence interval gives a range of plausible values for a parameter. It depends on a specified confidence level with higher confidence levels corresponding to wider confidence intervals and lower confidence levels corresponding to narrower confidence intervals. Common confidence levels include 90%, 95%, and 99%.
Usually we don’t just begin chapters with a definition, but confidence intervals are simple to define and play an important role in the sciences and any field that uses data. You can think of a confidence interval as playing the role of a net when fishing. Instead of just trying to catch a fish with a single spear (estimating an unknown parameter by using a single point estimate/statistic), we can use a net to try to provide a range of possible locations for the fish (use a range of possible values based around our statistic to make a plausible guess as to the location of the parameter).
Needed packages
Let’s load all the packages needed for this chapter (this assumes you’ve already installed them). If needed, read Section ?? for information on how to install and load R packages.
library(dplyr)
library(ggplot2)
library(mosaic)
library(knitr)
library(ggplot2movies)
3.1 Bootstrapping
Just as we did in Chapter 4 with the Lady Tasting Tea when making hypotheses about a population total with which we would like to test which one is more plausible, we can also use computation to infer conclusions about a population quantitative statistic such as the mean. In this case, we will focus on constructing confidence intervals to produce plausible values for a population mean. (We can do a similar analysis for a population median or other summary measure as well.)
Traditionally, the way to construct confidence intervals for a mean is to assume a normal distribution for the population or to invoke the Central Limit Theorem and get, what often appears to be magic, results. (This is similar to what was done in Section 4.8.) These methods are often not intuitive, especially for those that lack a strong mathematical background. They also come with their fair share of assumptions and often turn Statistics, a field that is full of tons of useful applications to many different fields and disciplines, into a robotic procedural-based topic. It doesn’t have to be that way!
In this section, we will introduce the concept of bootstrapping. It will be a useful tool that will allow us to estimate the variability of our statistic from sample to sample. One neat feature of bootstrapping is that it enables us to approximate the sampling distribution and estimate the distribution’s standard deviation using ONLY the information in the one selected (original) sample. It sounds just as plagued with the magical type qualities of traditional theory-based inference on initial glance but we will see that it provides an intuitive and useful way to make inferences, especially when the samples are of medium to large size.
To introduce the concept of bootstrapping, we again will use the movies
dataset in the ggplot2movies
data frame. Recall that you can also glance at this data frame using the View
function and look at the help documentation for movies
using the ?
function. We will explore many other features of this dataset in the chapters to come, but here we will be focusing on the rating
variable corresponding to the average IMDB user rating.
You may notice that this dataset is quite large: 58,788 movies have data collected about them here. This will correspond to our population of ALL movies. Remember from Chapter ?? that our population is rarely known. We use this dataset as our population here to show you the power of bootstrapping in estimating population parameters. We’ll see how confidence intervals built using the bootstrap distribution perform at including our population parameter of interest. Here we can actually calculate these values since our population is known, but remember that in general this isn’t the case.
Let’s take a look at what the distribution of our population ratings
looks like. We’ll see that we will use the distribution of our sample(s) as an estimate of this population histogram.
movies %>% ggplot(aes(x = rating)) +
geom_histogram(color = "white", bins = 20)
Learning check
(LC9.1) Why was a histogram chosen as the plot to make for the rating
variable above?
(LC9.2) What does the shape of the rating
histogram tell us about how IMDB users rate movies? What stands out about the plot?
It’s important to think about what our goal is here. We would like to produce a confidence interval for the population mean rating
. We will have to pretend for a moment that we don’t have all 58,788 movies. Let’s say that we only have a random sample of 50 movies from this dataset instead. In order to get a random sample, we can use the resample
function in the mosaic
package with replace = FALSE
. We could also use the sample_n
function from dplyr
.
set.seed(2017)
movies_sample <- movies %>%
sample_n(50)
The sample_n
function has filtered the data frame movies
“at random” to choose only 50 rows from the larger movies
data frame. We store information on these 50 movies in the movies_sample
data frame.
Let’s now explore what the rating
variable looks like for these 50 movies:
ggplot(data = movies_sample, aes(x = rating)) +
geom_histogram(color = "white", bins = 20)
Remember that we can think of this histogram as an estimate of our population distribution histogram that we saw above. We are interested in the population mean rating and trying to find a range of plausible values for that value. A good start in guessing the population mean is to use the mean of our sample rating
from the movies_sample
data:
(movies_sample_mean <- movies_sample %>%
summarize(mean = mean(rating)))
# A tibble: 1 x 1
mean
<dbl>
1 5.894
Note the use of the ( )
at the beginning and the end of this creation of the movies_sample_mean
object. If you’d like to print out your newly created object, you can enclose it in the parentheses as we have here.
This value of 5.894 is just one guess at the population mean. The idea behind bootstrapping is to sample with replacement from the original sample to create new resamples of the same size as our original sample.
Returning to our example, let’s investigate what one such resample of the movies_sample
dataset accomplishes. We can create one resample/bootstrap sample by using the resample
function in the mosaic
package.
boot1 <- resample(movies_sample) %>%
arrange(orig.id)
The important thing to note here is the original row numbers from the movies_sample
data frame in the far right column called orig.ids
. Since we are sampling with replacement, there is a strong likelihood that some of the 50 observational units are going to be selected again.
You may be asking yourself what does this mean and how does this lead us to creating a distribution for the sample mean. Recall that the original sample mean of our data was calculated using the summarize
function above.
Learning check
(LC9.3) What happens if we change the seed to our pseudo-random generation? Try it above when we used resample
to describe the resulting movies_sample
.
(LC9.4) Why is sampling at random important from the movies
data frame? Why don’t we just pick Action
movies and do bootstrapping with this Action
movies subset?
(LC9.5) What was the purpose of assuming we didn’t have access to the full movies
dataset here?
Before we had a calculated mean in our original sample of 5.894. Let’s calculate the mean of ratings
in our bootstrapped sample:
(movies_boot1_mean <- boot1 %>% summarize(mean = mean(rating)))
# A tibble: 1 x 1
mean
<dbl>
1 5.686
More than likely the calculated bootstrap sample mean is different than the original sample mean. This is what was meant earlier by the sample means having some variability. What we are trying to do is replicate many different samples being taken from a larger population. Our best guess at what the population looks like is multiple copies of the sample we collected. We then can sample from that larger “created” population by generating bootstrap samples.
Similar to what we did in the previous section, we can repeat this process using the do
function followed by an asterisk. Let’s look at 10 different bootstrap means for ratings
from movies_sample
. Note the use of the resample
function here.
do(10) *
(resample(movies_sample) %>%
summarize(mean = mean(rating)))
mean
1 5.942
2 5.572
3 5.828
4 6.292
5 6.032
6 5.920
7 5.996
8 5.852
9 6.098
10 5.608
You should see some variability begin to tease its way out here. Many of the simulated means will be close to our original sample mean but many will stray pretty far away. This occurs because outliers may have been selected a couple of times in the resampling or small values were selected more than larger. There are myriad reasons why this might be the case.
So what’s the next step now? Just as we repeated the repetitions thousands of times with the “Lady Tasting Tea” example, we can do a similar thing here:
trials <- do(5000) * summarize(resample(movies_sample), mean = mean(rating))
ggplot(data = trials, mapping = aes(x = mean)) +
geom_histogram(bins = 30, color = "white")
The shape of this resulting distribution may look familiar to you. It resembles the well-known normal (bell-shaped) curve. At this point, we can easily calculate a confidence interval. In fact, we have a couple different options. We will first use the percentiles of the distribution we just created to isolate the middle 95% of values. This will correspond to our 95% confidence interval for the population mean rating
, denoted by \(\mu\).
(ciq_mean_rating <- confint(trials, level = 0.95, method = "quantile"))
name lower upper level method estimate
1 mean 5.46 6.3 0.95 percentile 5.894
It’s always important at this point to interpret the results of this confidence interval calculation. In this context, we can say something like the following:
Based on the sample data and bootstrapping techniques, we can be 95% confident that the true mean rating of ALL IMDB ratings is between 5.46 and 6.3.
This statement may seem a little confusing to you. Another way to think about this is that this confidence interval was constructed using the sample data by a procedure that is 95% reliable in that of 100 generated confidence intervals based on 100 different random samples, we expect on average that 95 of them will capture the true unknown parameter. This also means that we will get invalid results 5% of the time. Just as we had a trade-off with \(\alpha\) and \(\beta\) with hypothesis tests, we have a similar trade-off here with setting the confidence level.
To further reiterate this point, the graphic below from Diez, Barr, and Çetinkaya-Rundel (2014) shows us that if we repeated a confidence interval process 25 times with 25 different samples, we would expect about 95% of them to actually contain the population parameter of interest. This parameter is marked with a dotted vertical line. We can see that only one confidence interval does not overlap with this value. (The one marked in red.) Therefore 24 in 25 (96%), which is quite close to our 95% reliability, do include the population parameter.
Remember that we are pretending like we don’t know what the mean IMDB rating for ALL movies is. Our population here is all of the movies listed in the movies
data frame from ggplot2movies
. So does our bootstrapped confidence interval here contain the actual mean value?
movies %>% summarize(mean_rating = mean(rating))
# A tibble: 1 x 1
mean_rating
<dbl>
1 5.933
We see here that the population mean does fall in our range of plausible values generated from the bootstrapped samples.
We can also get an idea of how the theory-based inference techniques would have approximated this confidence interval by using the formula \[\bar{x} \pm (2 * SE),\] where \(\bar{x}\) is our original sample mean and \(SE\) stands for standard error and corresponds to the standard deviation of the bootstrap distribution. The value of 2 here corresponds to it being a 95% confidence interval. (95% of the values in a normal distribution fall within 2 standard deviations of the mean.) This formula assumes that the bootstrap distribution is symmetric and bell-shaped. This is often the case with bootstrap distributions, especially those in which the original distribution of the sample is not highly skewed.
Definition: standard error
The standard error is the standard deviation of the sampling distribution. The sampling distribution may be approximated by the bootstrap distribution or the null distribution depending on the context. Traditional theory-based methodologies for inference also have formulas for standard errors, assuming some conditions are met.
To compute this type of confidence interval, we only need to make a slight modification to the confint
function seen above. (The expression after the \(\pm\) sign is known as the margin of error.)
(cise_mean_rating <- confint(trials, level = 0.95, method = "stderr"))
name lower upper level method estimate margin.of.error
1 mean 5.467 6.316 0.95 stderr 5.894 0.4247
Based on the sample data and bootstrapping techniques, we can be 95% confident that the true mean rating of ALL IMDB ratings is between 5.4667 and 6.3161.
Learning check
(LC9.6) Reproduce the bootstrapping above using a sample of size 50 instead of 25. What changes do you see?
(LC9.7) Reproduce the bootstrapping above using a sample of size 5 instead of 25. What changes do you see?
(LC9.8) How does the sample size affect the analysis above?
(LC9.9) Why must bootstrap samples be the same size as the original sample?
3.1.1 Review of bootstrapping
We can summarize the process to generate a bootstrap distribution here in a series of steps that clearly identify the terminology we will use (R. Lock et al. 2012).
- Generate bootstrap samples by sampling with replacement from the original sample, using the same sample size.
- Compute the statistic of interest, called a bootstrap statistic, for each of the bootstrap samples.
- Collect the statistics for many bootstrap samples to create a bootstrap distribution.
Visually, we can represent this process in the following diagram.
3.2 Relation to hypothesis testing
Recall that we found a statistically significant difference in the sample mean of romance movie ratings compared to the sample mean of action movie ratings. We concluded Chapter 4 by attempting to understand just how much greater we could expect the population mean romance movie rating to be compared to the population mean action movie rating. In order to do so, we will calculate a confidence interval for the difference \(\mu_r - \mu_a\). We’ll then go back to our population parameter values and see if our confidence interval contains our parameter value.
We could use bootstrapping in a way similar to that done above, except now on a difference in sample means, to create a distribution and then use the confint
function with the option of quantile
to determine a confidence interval for the plausible values of the difference in population means. This is an excellent programming activity and the reader is urged to try to do so.
Recall what the randomization/null distribution looked like for our simulated shuffled sample means:
(movies_trimmed <- movies %>% select(title, year, rating, Action, Romance))
# A tibble: 58,788 x 5
title year rating Action Romance
<chr> <int> <dbl> <int> <int>
1 $ 1971 6.4 0 0
2 $1000 a Touchdown 1939 6.0 0 0
3 $21 a Day Once a Month 1941 8.2 0 0
4 $40,000 1996 8.2 0 0
5 $50,000 Climax Show, The 1975 3.4 0 0
6 $pent 2000 4.3 0 0
7 $windle 2002 5.3 1 0
8 '15' 2002 6.7 0 0
9 '38 1987 6.6 0 0
10 '49-'17 1917 6.0 0 0
# ... with 58,778 more rows
movies_trimmed <- movies_trimmed %>%
filter(!(Action == 1 & Romance == 1))
movies_trimmed <- movies_trimmed %>%
mutate(genre = ifelse(Action == 1, "Action",
ifelse(Romance == 1, "Romance",
"Neither"))) %>%
filter(genre != "Neither") %>%
select(-Action, -Romance)
set.seed(2017)
movies_genre_sample <- movies_trimmed %>%
group_by(genre) %>%
sample_n(34) %>%
ungroup()
mean_ratings <- movies_genre_sample %>%
group_by(genre) %>%
summarize(mean = mean(rating))
obs_diff <- diff(mean_ratings$mean)
shuffled_ratings <- #movies_trimmed %>%
movies_genre_sample %>%
mutate(genre = shuffle(genre)) %>%
group_by(genre) %>%
summarize(mean = mean(rating))
diff(shuffled_ratings$mean)
[1] -0.1324
set.seed(2017)
many_shuffles <- do(5000) *
(movies_genre_sample %>%
mutate(genre = shuffle(genre)) %>%
group_by(genre) %>%
summarize(mean = mean(rating))
)
rand_distn <- many_shuffles %>%
group_by(.index) %>%
summarize(diffmean = diff(mean))
head(rand_distn, 10)
# A tibble: 10 x 2
.index diffmean
<dbl> <dbl>
1 1 -0.132353
2 2 -0.197059
3 3 -0.026471
4 4 0.714706
5 5 -0.473529
6 6 -0.120588
7 7 -0.173529
8 8 -0.208824
9 9 -0.008824
10 10 -0.332353
ggplot(data = rand_distn, mapping = aes(x = diffmean)) +
geom_histogram(color = "white", bins = 20)
With this null distribution being quite symmetric and bell-shaped, the standard error method introduced above likely provides a good estimate of a range of plausible values for \(\mu_r - \mu_a\). Another nice option here is that we can use the standard deviation of the null/randomization distribution we just found with our hypothesis test.
(std_err <- rand_distn %>% summarize(se = sd(diffmean)))
# A tibble: 1 x 1
se
<dbl>
1 0.3404
We can use the general formula of \(statistic \pm (2 * SE)\) for a confidence interval to obtain the following result for plausible values of the difference in population means at the 95% level.
(lower <- obs_diff - (2 * std_err))
se
1 0.2692
(upper <- obs_diff + (2 * std_err))
se
1 1.631
We can, therefore, say that we are 95% confident that the population mean rating for romance movies is between 0.269 and 1.631 points higher than for that of action movies.
The important thing to check here is whether 0 is contained in the confidence interval. If it is, it is plausible that the difference in the two population means between the two groups is 0. This means that the null hypothesis is plausible. The results of the hypothesis test and the confidence interval should match as they do here. We rejected the null hypothesis with hypothesis testing and we have evidence here that the mean rating for romance movies is higher than for action movies.
3.3 Effect size
The phrase effect size has been thrown around recently as an alternative to \(p\)-values. In combination with the confidence interval, it can be often more valuable than just looking at the results of a hypothesis test. It depends on the scientific discipline exactly what is meant by “effect size” but, in general, it refers to the magnitude of the difference between group measurements. For our two sample problem involving movies, it is the observed difference in sample means obs_diff
.
It’s worthy of mention here that confidence intervals are always centered at the observed statistic. In other words, if you are looking at a confidence interval and someone asks you what the “effect size” is you can simply find the midpoint of the stated confidence interval.
Learning check
(LC9.10) Check to see whether the difference in population mean ratings for the two genres falls in the confidence interval we found here. Are we guaranteed that it will fall in the range of plausible values?
(LC9.11) Why do you think many scientific fields are shifting to preferring inclusion of confidence intervals in articles over just \(p\)-values and hypothesis tests?
(LC9.12) Why is 95% related to a value of 2 in the margin of error? What would approximate values be for 90% and for 99%?
(LC9.13) Why is a 95% confidence interval wider than a 90% confidence interval? Explain by using a concrete example from everyday life about what is meant by “confidence.”
(LC9.14) How would confidence intervals correspond to one-sided hypothesis tests?
(LC9.15) There is a relationship between the significance level and the confidence level. What do you think it is?
(LC9.16) The moment the phrase “standard error” is mentioned, there seems to be someone that says “The standard error is \(s\) divided by the square root of \(n\).” This standard error formula is used in the theory-based procedure for an inference on one mean. But… does it always work? For samp1
, samp2
, and samp3
below, do the following:
- produce a bootstrap distribution based on the sample
- calculate the standard deviation of the bootstrap distribution
- compare this value of the standard error to what you obtain when you calculate the standard deviation of the sample \(s\) divided by \(\sqrt{n}\).
df1 <- data_frame(samp1 = rexp(50))
df2 <- data_frame(samp2 = rnorm(100))
df3 <- data_frame(samp3 = rbeta(20, 5, 5))
Describe how \(s / \sqrt{n}\) does in approximating the standard error for these three samples and their corresponding bootstrap distributions.
3.4 Conclusion
3.4.1 What’s to come?
This concludes the Inference unit of this book. You should now have a thorough introduction into topics in both data science and statistics. In the last chapter of the textbook, we’ll summarize the purpose of this book as well as present an excellent example of what goes into making an effective story via data.
3.4.2 Script of R code
An R script file of all R code used in this chapter is available here.


Format: ControlStyle "Text|Text",
Example: ControlStyle "AUTOTRACK|HIGHLIGHTONFOCUS|HIGHLIGHTONMOUSEOVER",
Example: ControlStyle "AUTOTRACK",
Example: ControlStyle "AUTOTRACK|HIGHLIGHTONMOUSEOVER",
AUTOTRACK: Mouse Clicks onto the button won't affect the world below the button. An Unit can not be ordered at a target below it nor units can be selected below the button.
HIGHLIGHTONMOUSEOVER: Enables the usage of ControlMouseOverHighlight.
HIGHLIGHTONFOCUS: Enables the usage of ControlFocusHighlight.
CLICKONMOUSEDOWN: FRAMEEVENT_CONTROL_CLICK & Audio click sound happen on click instead of release
ATLEASTONE:
EXCLUSIVE: Used in RADIOGROUP: only one checkbox can be checked at a time (each user can check a different one).
SHIFTDESELECT:
DRAG:
RELEASENOTIFY:
AUTODOWN:
MULTISELECT:
Used in: BUTTON, GLUEBUTTON, TEXTBUTTON, GLUETEXTBUTTON, GLUECHECKBOX


Subscribe to CSB Bank: ICICI Direct
ICICI Direct has come out with its report on CSB Bank. The research firm has recommended to "Subscribe'' the IPO in its research report as on November 21, 2019
ICICI Direct's IPO report on CSB Bank
CSB Bank (CSB) is one of the oldest private sector banks in India with a history of over 98 years and a strong base in Kerala along with a significant presence in Tamil Nadu and Karnataka. The bank is promoted by FIH Mauritius Investments Ltd (FIHM). FIHM is a wholly-owned subsidiary of Fairfax India Holdings Corporation. The bank offers a wide range of products and services to its customer base of 13 lakh (as on FY19) aided by 412 branches, with focus on SME, retail and NRI customers. As of September 30, 2019, CSB has advances of | 11298 crore. Geographically, the company has ~83% exposure towards three states viz. Kerala, Tamil Nadu and Karnataka. CSB has 412 branches across 16 states and four union territory with employee base of 3001 as of FY19. The bank has healthy CASA deposits of ~| 4372 crore with CASA ratio of 28.2% as of September 30, 2019.
Valuation and Outlook
CSB’s performance has not been encouraging in the past with rise in NPA level. However, new promoter and strong management brings capital and execution strength on the table which bodes well for future growth as well as earnings. Therefore, we assign a SUBSCRIBE recommendation to the stock. Further, at the IPO price band of Rs 193-195, the stock is available at a P/BV of ~2.2x at the upper band on H1FY20 basis.
For all IPO stories, click here
Disclaimer: The views and investment tips expressed by investment experts/broking houses/rating agencies on moneycontrol.com are their own, and not that of the website or its management. Moneycontrol.com advises users to check with certified experts before taking any investment decisions.


Request a driving route from A to B and display it on the map
This example calculates the fastest car route from the Brandenburg Gate in the centre of Berlin (52.51605°N, 13.37787°E) to Friedrichstraße Railway Station (52.52058°N, 13.38615°E), and displays it on the map.
Access to the routing service is obtained from the H.service.Platform
by calling
getRoutingService()
. The calculateRoute()
method is used to calculate the fastest
car (mode:fastest;car
) route by passing in the relevant parameters as defined in
Routing API.
The styling and display of the response is under the control of the developer.


PIC2GRAPH(1) PIC2GRAPH(1) NAME pic2graph - convert a PIC diagram into a cropped image SYNOPSIS pic2graph [ -unsafe ] [ -format fmt ] [ -eqn delim ] DESCRIPTION Reads a PIC program as input; produces an image file (by default in Por‐ table Network Graphics format) suitable for the Web as output. Also translates eqn(1) constructs, so it can be used for generating images of mathematical formulae. PIC is a rather expressive graphics minilanguage suitable for producing box-and-arrow diagrams of the kind frequently used in technical papers and textbooks. The language is sufficiently flexible to be quite useful for state charts, Petri-net diagrams, flow charts, simple circuit schematics, jumper layouts, and other kinds of illustration involving repetitive uses of simple geometric forms and splines. Because PIC descriptions are procedural and object-based, they are both compact and easy to modify. The PIC language is fully documented in Making Pictures With GNU PIC, a document which is part of the groff(1) distribution. Your input PIC code should not be wrapped with the .PS and .PE macros that normally guard it within groff(1) macros. The output image will be clipped to the smallest possible bounding box that contains all the black pixels. Older versions of convert(1) will produce a black-on-white graphic; newer ones may produce a black-on- transparent graphic. By specifying command-line options to be passed to convert(1) you can give it a border, force the background transparent, set the image's pixel density, or perform other useful transformations. This program uses pic(1), eqn(1), groff(1), gs(1), and the ImageMagick convert(1) program. These programs must be installed on your system and accessible on your $PATH for pic2graph to work. OPTIONS -unsafe Run pic(1) and groff(1) in the `unsafe' mode enabling the PIC macro sh to execute arbitrary commands. The default is to forbid this. -format fmt Specify an output format; the default is PNG (Portable Network Graphics). Any format that convert(1) can emit is supported. -eqn delim Change the fencepost characters that delimit eqn(1) directives ($ and $, by default). This option requires an argument, but an empty string is accepted as a directive to disable eqn(1) process‐ ing. Command-line switches and arguments not listed above are passed to convert(1). FILES /usr/share/groff/1.21/tmac/eqnrc The eqn(1) initialization file. ENVIRONMENT GROFF_TMPDIR The directory in which temporary files will be created. If this is not set pic2graph searches the environment variables TMPDIR, TMP, and TEMP (in that order). Otherwise, temporary files will be created in /tmp. BUGS Due to changes in the behavior of ImageMagick convert(1) that are both forward and backward-incompatible, mismatches between your pic2graph and convert(1) versions may produce zero-sized or untrimmed output images. For this version of pic2graph you will need a version of convert(1) that supports the -trim option; older versions of pic2graph used -crop 0x0, which no longer has trimming behavior. SEE ALSO eqn2graph(1), grap2graph(1), pic(1), eqn(1), groff(1), gs(1), convert(1). AUTHOR Eric S. Raymond<EMAIL_ADDRESS>based on a recipe by W. Richard Stevens. Groff Version 1.21 31 December 2010 PIC2GRAPH(1)


About Me
My name is Bree (short for BreeAnna). I was born and raised in western Washington, and one of my favorite things about the area is all of the awesome outdoor activities! I love hiking, traveling to one of our many coastal towns, and even taking the ferry to out beautiful islands. I have two goofy dogs named Leon & Ronan. When I have free time, I like to volunteer at a local animal rescue. I love trying new foods and will never turn down a good beer!
Education and Work Experience
- Pierce Community College
- CodeFellow: Code 101, 102, 201
- 2013 - Present: Sound Credit Union
- Digital Systems Analyst
- Lending Support Specialist
- Consumer Loan Processor
- Member Service Consultant
- 2008 - 2013: TwinStar Credit Union
Top 10 List of Things That Make Me Happy
- Traveling with my husband
- Playing with my pups
- Hiking and camping on the Olympic Peninsula
- Spending time with my two little nieces
- Attending beer and food festivals
- Trying new things (recently learned how to wakeboard!)
- Yoga
- Coding!
- Playing Pokemon Go
- Making new friends


Tribal Gallery an applicatiuon for quality art images.
Search for art on interest based on various categories and view the pictures by location.
Art lives in us, we live in art.


func runtime.unlockextra
6 uses
runtime (current package)
proc.go#L1846: unlockextra(mp.schedlink.ptr())
proc.go#L1885: unlockextra(mp)
proc.go#L1936: unlockextra(mp)
proc.go#L1988: unlockextra(mp)
proc.go#L2038: func unlockextra(mp *m) {
proc.go#L5014: unlockextra(mp)
The pages are generated with Golds v0.2.7-preview. (GOOS=darwin GOARCH=amd64)


We are pleased to announce the latest development release, Click 2.3.0 RC1.
Download is available
here.
This release provides full server-side Ajax support and
Stateful pages have been deprecated in favour of light-weight Stateful
controls.
Please see the official
announcement
and
changelog for more details.
If you are upgrading from 2.2.0 or earlier, please refer to the
upgrade path.


|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object junit.framework.Assert junit.framework.TestCase android.test.InstrumentationTestCase android.test.ActivityTestCase android.test.ActivityUnitTestCase<ActivityType> roboguice.test.RoboActivityUnitTestCase<ActivityType>
public class RoboActivityUnitTestCase<ActivityType extends android.app.Activity>
A new instance of your activity is constructed for each test method in your RoboActivityUnitTestCase,
so this is a great way to run many tests on an Activity in isolation. Note, however, that Activities
instantiated by RoboActivityUnitTestCase won't be running in a "normal" system, it may not be
appropriate for every kind of test case. See the ActivityUnitTestCase docs for specifics.
Here's an example to get you started.
public class MyActivityUnitTest extends ActivityUnitTestCase
Note that, as for RoboUnitTestCase, you'll need to add a constructor like the following to your
Application class:
public MyApplication( Context context ) {
super();
attachBaseContext(context);
}
| Constructor Summary | |
|---|---|
RoboActivityUnitTestCase(java.lang.Class<ActivityType> activityClass)
|
| Method Summary |
|---|
| Methods inherited from class android.test.ActivityUnitTestCase |
|---|
getActivity, getFinishedActivityRequest, getRequestedOrientation, getStartedActivityIntent, getStartedActivityRequest, isFinishCalled, setActivityContext, setApplication, setUp, startActivity, tearDown |
| Methods inherited from class android.test.ActivityTestCase |
|---|
scrubClass, setActivity |
| Methods inherited from class android.test.InstrumentationTestCase |
|---|
getInstrumentation, injectInsrumentation, injectInstrumentation, launchActivity, launchActivityWithIntent, runTest, runTestOnUiThread, sendKeys, sendKeys, sendRepeatedKeys |
| Methods inherited from class junit.framework.TestCase |
|---|
countTestCases, createResult, getName, run, run, runBare, setName, toString |
| Methods inherited from class junit.framework.Assert |
|---|
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail, failNotEquals, failNotSame, failSame |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public RoboActivityUnitTestCase(java.lang.Class<ActivityType> activityClass)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |


service --status-all- Start/Stop/Restart/Reload service (start/stop should always be available):
service service_name start|stop|restart|reload- Do a full restart (runs script twice with start and stop):
service service_name --full-restart- Show the current status of a service:
service service_name status


My Personalised Web Page!
Financial Calculator
This is a simple financial calculator, that can be used to calculate per month retirement savings, the amount you have invested and loan pay off.
This can be very helful for planning the savings for retirement.
Retirement Amount - Savings Per Month
| Parameter Name |
Description |
Example Value |
| yearsUntilRetirement |
This parameter shows years untill retirement. |
10 years |
| amountSavingPerMonth |
This parameter shows amount to be saved per month. |
200$ |
| yearlyInterestRateOfInvestment |
This parameter shows yearly interest rate. |
0.05 |
Invested Amount - After Some Years
| Parameter Name |
Description |
Example Value |
| yearsInvesting |
This parameter shows years of investment. |
5 years |
| initialAmount |
This parameter shows the initial amount of investment. |
300$ |
| yearlyInterestRateOfInvestment |
This parameter is used for Interest Rate of saving |
0.05 |
Loan Payoff
| Parameter Name |
Description |
Example value |
| monthlyPaymentAmount |
This shows monthly payment amount. |
200$ |
| initialLoanAmount |
This shows the initial investment amount. |
1000$ |
| yearlyInterestRateOfLoan |
This shows the yearly rate of interest. |
0.05 |
Jayshree Kanse
I am a master's student at Stevens Institute of Technology. I have four years of IT experience. I love to learn new technologies,
which is one of the resons of taking this course. I really like the way this course is structured, Lab's are very helpful for clearning
the concepts taught in the lecture.
This is me...!!!!!!
- Major - Computer Science
- Favourite song - Numb by Linkin Park
- Hope to learn from CS546 - Javascript, JQuery
- Programming languages I like to use - Java
- Favourite animal - Dog


Here is a chance to get the Sherlock Holmes out of you!!
Get set go for a LIVE CRIMINAL CASE and disclose the mysterious murder!!....come and
show your detective mind to the world!!! Prove yourself as real Sherlock Holmes!!!
Create an interesting on-campus murder story. This event will have multiple participating
teams. Hidden clues tracing back to the murder on the campus. The clues should lead to
witnesses (volunteers should be asked to role play) and the one who finds out the real
murderer first wins!
Event will have a back story and hidden clues all around the campus, along with dummies
acting as dead bodies, and have some volunteers act as witnesses.
►Each team consists of 2 members.
►This event tests the general aptitude of the participants on their basic logical skills.
►The team have to collect the scattered evidences in a pre-organized crime
scene.You are supposed to build up the sequence of crime based on the evidences
collected, thus describing the crime scene.
►If any two teams score the same, then winner will be that team which took less time.
►You can participate at a nominal fee of 50 INR per team (or Free if you have workshop's pass).
Top 2 winners will get cash prizes worth upto INR 500 , excititing coupons & gift
vouchers.


Of course, if you're going to cross-compile Mach, you need the appropriate cross-development tools. See the section on cross-compilation below.
To learn more of the gory details of how the new build environment works, see the page on the build environment.
To configure the system, unpack the machine-independent and machine-dependent source trees (e.g. "mach4" and "mach4-i386") somewhere, create a separate object directory to build into, and run the configure script in the machine-dependent source tree from within the object directory. (Currently the object directories MUST be SEPARATE FROM the source directories.) If you're using a version of Mach4 earlier than UK02p21, then you'll have to specify the location of the machine-independent source tree on the configure command line with a "--with-mach4=DIR" option. Finally, type `make -r' or `make -r install' to build the kernel and optionally install it. (You don't actually have to use `-r', but GNU make runs faster if you do.) For example:
tar xvzf /tmp/mach4.tar.gz tar xvzf /tmp/mach4-i386.tar.gz mkdir obj cd obj ../mach4-i386/configure --with-mach4=../mach4 make -r make -r install
All installed files will go into directories named relative to the prefix you specify on the configure command line, or `/usr/local' by default, as per normal GNU conventions. If all goes well, an appropriate boot image should be created in the object directory, which you can use to boot Mach.
For machine-specific details on installing and booting Mach, see the following pages:
--enable-debug: Turns on various kernel debugging features, such as extensive sanity checks and (on the i386) the kernel debugger.
--enable-libmach: Enables generation of the CMU UX server-specific library libmach.a. Generally only needed in order to compile programs in the CMU USER distribution. Other Mach servers, such as those in Lites and the Hurd, only use the (more) personality-neutral standalone library libmach_sa.a.
With the new build environment you can easly cross compile Mach from a different architecture and/or OS. To cross compile from a different (non-Mach) OS but on the same processor architecture, you normally shouldn't have to do anything special; the "normal" procedure above is known to work on Linux anyway. If you have any problems, try the cross compilation procedure described below.
To cross compile from a different architecture, you will have to have all the standard cross-development tools built. In particular, Mach requires cross development versions of gcc, gas, ld, ar, and ranlib. You can get all these from prep.ai.mit.edu:/pub/{gcc-*,gas-*,binutils-*}. Just build and install them as the INSTALL files say to, using the `--target=' option to specify the target architecture and OS (e.g. `--target=i386-gnu'). It will probably be easiest if you install them in the same place your ordinary compiler is located: for example, use `--prefix=/usr' if gcc et al is in /usr/bin. As long as the new tools are configured for cross development, they will not overwrite the native tools that are already there, because they are given names prefixed with the target specification, e.g. `i386-gnu-gcc'.
Be sure to build and install gas and binutils before GCC. Even then, GCC may fail to compile completely because of missing header files (probably stdio.h). If it fails while trying to build libgcc2.a, then you've gotten far enough for the purposes of Mach - the compiler has already been built, and you can just `make install' at that point and go back to Mach.
To cross compile Mach itself, the only additional thing you need to do is tell the Mach build environment where to find the cross compilation tools. The normal GNU way to do this, I understand, is to specify the tools as variable overrides on the `make' command line; e.g. `make CC=i386-gnu-gcc LD=...' You can do it this way if you want; if you do, you'll need to set the variables CC, LD, AR, STRIP, and RANLIB.
However, with this Mach distribution, there's an easier way. If you specify a --target option on the command line when running Mach's configure script, (e.g. `--target=i386-gnu'), then the makefiles will automatically be set up with the default names of the development tools it uses prefixed with the target name (e.g. `i386-gnu-gcc' etc.). You can still override those defaults on the `make' command line, but it should not be necessary to if your tools are named according to the standard conventions and are in your path.
Note that the LILO boot configuration requires an as86 and ld86 to assemble. These are available on linux, but I do not know of any cross versions of these programs. (I haven't yet tried to compile them anywhere other then linux.) Therefore, if you want your kernel to be bootable with LILO, you must find a way to get bootsetup (in mach4-i386/boot) assembled and linked. A cross build that does not have the x86 tools available will simply fail to make LILO-compatible boot images for you; the resulting boot images will still boot from NetBSD or Mach boot blocks however.


{{docs.content.intro.subtitle}}
by {{docs.content.intro.author}} — created on {{docs.content.intro.createdOn}}


Setup: STT APIs
There are two options for speech to text APIs that you can use with this system.
- One is the IBM Watson STT
- the Other is the open source Gentle STT.
Overview
IBM Watson STT Service
Pros:
- 16 hours a month included in service
- 0.02 cent a minute after that see pricing
- generally pretty accurate (my opinion, judge for yourself)
- supports a number of languages see here including distiction between british and american english
Cons:
- Need to provide card details for pay as you go fee.
- is in the cloud so no offline support.
Gentle Open Source STT
Pros:
- Free as in free speech as well as in free beer.
- working locally on your machine. no internet connection needed
- because of that, good for sensitive material.
- Open source github repo and I made a node module to work with the API .
Cons:
- Not as accurate as IBM one (in my opinion, but decide for yourself).
- Only support english STT.
- At the moment not as fast as IBM one.
Setup
GET IBM Bluemix Speech To Text API Keys
Here to get API keys for IBM Bluemix Watson Speech To Text service
Add the API keys to the app at startup
When you first launch the app by double clicking on it a prompt asks for IBM Watson username and password API keys, these are then stored inside the app.
That’s it. the API keys are now stored inside the app with this one time setup. and you can now use the it.
Now you are ready to chose IBM as an option when adding a new transcription. Go back to the user manual to continue.
Gentle STT, Open Source, free and offline
first time setup
Frist time you launch this version of the app it will download the …
-
1.Download Gentle version 0.9.1 about
104mb
-
2.start the Gentle app
-
3.click
Enable full transcription
, this will dowload the language model comonent to be able to work offline.
-
4.restart the app
-
5.the Gentle server is now up and running.
Future times, you just need to launch gentle anche check local host is working.
Launching Gentle’s local server
If you already done the initial setup downloading the language model as described above, all you need to do when using gentle is click open in browser
this will open your default browser with this page, and this means the Gentle server is running locally.
Now you are ready to chose Gentle as an option when adding a new transcription. Go back to the user manual to continue.


Twitchcon
Home
Event Information
About Us
Contact Us
❮
❯
Announcements
Tickets on sale now!
Get your TwitchCon 2018 tickets today!
Twitch
Twitter
Facebook


Unscramble
What does a stone become when in the water?
Think you figured it out? Click
NEXT
to reveal the answer.


---
layout: post
title: Do Some People Really Believe a Dead Man Came Back to Life?
subtitle: How have different traditions understood the story of the resurrection of Jesus of Nazareth?
description: Christians have been celebrating Good Friday and Easter for nearly 2,000 years. But why? That Jesus of Nazareth was executed is a given, but what does the Easter holiday celebrate? Was Jesus really raised from the dead? Was that even the message first Christians sought to spread? Or did they know, even then, that this was a metaphorical tale? How has the story been understood since those first days of the Christian movement? Join us as we consider how different traditions have historically understood the story of the resurrection of Jesus of Nazareth. All are welcome!
event_image: images/empty-tomb.png
long_date: Saturday, April 7th, 10:00—11:30 a.m.
short_date: April 7, 2012
10:00—11:30am
location: Indianapolis Public Library
DISABLED_address: 7898 N. Hague Road
Indianapolis, Indiana, 46256
DISABLED_map: https://www.google.com/maps/preview?authuser=0#!q=Indianapolis+Public+Library+-++Lawrence+Branch&data=!4m15!2m14!1m13!1s0x0%3A0x4aa45a25e075dcdf!3m8!1m3!1d2706!2d-86.033417!3d39.8978866!3m2!1i1044!2i679!4f13.1!4m2!3d39.8978866!4d-86.0334172
speaker: Nicholas Piotrowski
speaker_image: images/Nicholas.jpg
DISABLED_bio: Nicholas is a resident of Lawrence and a professor at Crossroads Bible College. He earned his PhD at Wheaton College where he studied the way 1st century communities used sacred traditions to form their self-identity and navigate their cultural milieu.
DISABLED_disclaimer: This program is not sponsored by the Indianapolis Public Library.
---


Far ArmBar From Side Control
Side control, op turns in to face toward you so left arm is now higher than right.
Cup ops left shoulder with your right hand, work for an underhook. Reach left arm around ops head for a chin strap.
Step left leg around ops head and all the way over to their waist,chest position as you turn 180 into an armbar position
sit on shoulder, control arm, sit back and grab leg or pants and armbar.


Indian Celebrity’s Tweet on Ex-CJI Leaves Netizens Furious, Demanding Ban on His Work
New Delhi (Sputnik): The Indian music composer, in a tweet, targeted the legacy of former chief justice of India (CJI) Ranjan Gogoi, calling it “disgraceful” and “cowardly”
Indian celebrity Vishal Dadlani’s comment about the country’s former CJI, who was a part of various key judgements until last week, before retiring, has left a section of netizens furious.
The post by Dadlani, who has made music for acclaimed films like "Bajirao Mastani", "Yeh Jawaani Hai Deewani", and "Taare Zameen Par", didn’t go down well with social media users, who expressed their opinion on the same, demanding that the entertainment channel Sony sack him as a judge in the ongoing singing reality show “Indian Idol”, an Indian adaptation of “American Idol”.
During his tenure as CJI, which lasted until last week, Justice Gogoi gave various key landmark judgments, with the most crucial among them being his last one related to the decades-old contentious Ayodhya land dispute title case. The 1950 Ram Janmabhoomi-Babri Masjid case’s verdict was awaited by millions of Hindus and Muslims in the country.
The Ayodhya land dispute, a decades-old religious conflict between the Hindu and Muslim communities in India, flared up following the 1992 demolition of a mosque by Hindus in Ayodhya town in the Indian state of Uttar Pradesh.
After the demolition of the mosque on 6 December 1992, Hindus constructed a makeshift temple in the name of Lord Ram, who is believed to have been born at the site.
The mosque's destruction followed Hindu-Muslim violence. Subsequent years witnessed groups belonging to both religions bickering in courts over who should have control over the historic site.
On 9 November, the Justice Gogoi as the then CJI headed the Supreme Court Bench in a historic verdict that gave the disputed area of land in Ayodhya town to a trust to build a temple for Hindus and the Muslims received an alternate area to build a mosque at any prominent place in the town.


Hangman v0.9.6 Hangman.Web
Module provides access to a http web server for playing Hangman
games via a tool such as curl or HTTPoison.
Query params are specified after /hangman?
These are name :: String.t, secret :: String.t | [String.t], random :: pos_integer
The name at all times must be specified along with either a secret value or random value: true = name and (secret | random)
The random param specifies how many secret words to generate. Hence, random=5, will generate 5 secret game words for a total of 5 hangman games.
If the secrets collection vector is only 1 item we show the game history if greater we show the word and score summary only
Example
iex> HTTPoison.get("http://<IP_ADDRESS>:3737/hangman?name=julio&secret=kiwi")
{:ok,
%HTTPoison.Response{body: "(H) ----; score=1; status=KEEP_GUESSING (H) ----; score=2; status=KEEP_GUESSING (H) ----; score=3; status=KEEP_GUESSING (H) -I-I; score=4; status=KEEP_GUESSING (H) -I-I; score=5; status=KEEP_GUESSING (H) -I-I; score=6; status=KEEP_GUESSING (H) -I-I; score=25; status=GAME_LOST (H) Game Over! Average Score: 25.0, Games: 1, Scores: (KIWI: 25) ",
headers: [{"server", "Cowboy"}, {"date", "Mon, 14 Mar 2016 04:27:39 GMT"},
{"content-length", "345"},
{"cache-control", "max-age=0, private, must-revalidate"},
{"content-type", "text/plain; charset=utf-8"}], status_code: 200}}
iex> HTTPoison.get("http://<IP_ADDRESS>:3737/hangman?name=julio&random=1")
{:ok,
%HTTPoison.Response{body: "(H) --E-----------; score=1; status=KEEP_GUESSING (H) --E--------O--; score=2; status=KEEP_GUESSING (H) --E--------O--; score=3; status=KEEP_GUESSING (H) --E----C---O--; score=4; status=KEEP_GUESSING (H) PREVARICATIONS; score=4; status=GAME_WON (H) Game Over! Average Score: 4, Games: 1, Scores: (PREVARICATIONS: 4) ",
headers: [{"server", "Cowboy"}, {"date", "Mon, 14 Mar 2016 04:29:05 GMT"},
{"content-length", "601"},
{"cache-control", "max-age=0, private, must-revalidate"},
{"content-type", "text/plain; charset=utf-8"}], status_code: 200}}
Summary
Functions
Callback implementation for c:Plug.call/2
Callback implementation for c:Plug.init/1
Retrieves connection params name
and either a secret
or random
. Runs web game. Returns complete game results in connection response body
Starts the cowboy web server
Functions
Specs
run(Plug.Conn.t) :: Plug.Conn.t | no_return
Retrieves connection params name
and either a secret
or random
. Runs web game. Returns complete game results in connection response body


This page is served by Quarkus. The source is in src/main/resources/META-INF/resources/index.html.
src/main/resources/META-INF/resources/index.html


Puppet Class: appd_db_agent::install
- Defined in:
- manifests/install.pp
Overview
This class handles the installation.
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
# File 'manifests/install.pp', line 3
class appd_db_agent::install
{
$version = $::appd_db_agent::version
$source = $::appd_db_agent::source
$checksum = $::appd_db_agent::checksum
$checksum_type = $::appd_db_agent::checksum_type
$user = $::appd_db_agent::user
$group = $::appd_db_agent::group
$manage_user = $::appd_db_agent::manage_user
include java
if $manage_user {
group { $group:
ensure => present,
}
user { $user:
ensure => present,
gid => $group,
home => '/opt/appdynamics',
managehome => false,
shell => '/sbin/nologin',
system => true,
}
}
file { '/opt/appdynamics':
ensure => directory,
owner => $user,
group => $group,
mode => '0640',
}
file { "/opt/appdynamics/dbagent-${version}":
ensure => directory,
owner => $user,
group => $group,
mode => '0640',
}
archive { "/tmp/dbagent-${version}.zip":
ensure => present,
source => $source,
extract => true,
extract_path => "/opt/appdynamics/dbagent-${version}",
creates => "/opt/appdynamics/dbagent-${version}/db-agent.jar",
cleanup => true,
user => $user,
group => $group,
require => File["/opt/appdynamics/dbagent-${version}"],
}
file { '/opt/appdynamics/dbagent':
ensure => link,
owner => $user,
group => $group,
target => "/opt/appdynamics/dbagent-${version}",
mode => '0640',
}
}
|


class: center, middle ### W4995 Applied Machine Learning # Linear Models for Classification 02/05/18 Andreas C. Müller ??? Today we're going to talk about linear models for classification, and in addition to that some general principles and advanced topics surrounding general models, both for classification and regression. FIXME: in regularizing SVM, long vs short normal vectors. --- class: center, middle # Linear models for
binary
classfication ??? We'll first start with linear models for binary classification, so if there are only two classes. That makes the models much easier to understand. --- .center[ ![:scale 55%](images/linear_boundary_vector.png) ] $$\hat{y} = \text{sign}(w^T \textbf{x} + b) = \text{sign}\left(\sum\limits_{i}w_ix_i + b\right)$$ ??? Similar to the regression case, basically all linear models for classification have the same way to make predictions. As with regression, they compute an inner product of a weight vector w with the feature vector x, and add some bias b. The result of that is a real number, as in regression. For classification, however, we only look at the sign of the result, so whether it is negative or positive. If it's positive, we predict one class, usually called +1, if it's negative, we predict the other class, usually called -1. If the result is 0, by convention the positive class is predicted, but because it's a floating point number that doesn't really happen in practice. You'll see that sometimes in my notation I will not have a $b$. That's because you can always add a constant feature to x to achieve the same effect (thought you would then need to leave that feature out of the regularization). So when I write $w^Tx$ without a $b$ assume that there is a constant feature added that is not part of any regularization. Geometrially, what the formula means is that the decision boundary of a linear classifier will be a hyperplane in the feature space, where w is the normal vector of that plane. In the 2d example here, it's just a line separating red and blue. Everything on the right hand side would be classified as blue by this classifier, and everything on the left-hand side as red. Questions? So again, the learning here consists of finding parameters w and b based on the training set, and that is where the different algorithms differ. There are quite a lot of algorithms out there, and there are also quite a lot in scikit-learn, but we'll only discuss the most common ones. The most straight-forward way to approach finding w and b is to use the framework of empirical risk minimization that we talked about last time, so finding parameters that minimize some loss o the training set. Where classification differs quite a bit from regression is on how we want to measure misclassifications. --- # Picking a loss? $$\hat{y} = \text{sign}(w^T \textbf{x} + b)$$ `$$\min_{w \in ℝ^{p}} \sum_{i=1}^n 1_{y_i \neq \text{sign}(w^T \textbf{x} + b)}$$` .center[ ![:scale 40%](images/binary_loss.png) ] ??? So we need to define a loss function for given w and b that tell us how well they fit the training set. Obvious Idea: Minimize number of misclassifications aka 0-1 loss but this loss is non-convex, not continuous and minimizing it is NP-hard. So we need to relax it, which basically means we want to find a convex upper bound for this loss. This is not done on the actual prediction, but on the inner product $w^T x$, which is also called the decision function. So this graph here has the inner product on the x axis, and shows what the loss would be for class 1. The 0-1 loss is zero if the decision function is positive, and one if it's negative. Because a positive decision function means a positive predition, means correct classification in the case of y=1. A negative prediction means a wrong classification, which is penalized by the 0-1 loss with a loss of 1, i.e. one mistake. The other losses we'll talk about are mostly the hinge loss and the log loss. You can see they are both upper bounds on the 0-1 loss but they are convex and continuous. Both of these losses care not only that you make a correct prediction, but also "how correct" your prediction is, i.e. how positive or negative your decision function is. We'll talk a bit more about the motivation of these two losses, starting with the logistic loss. --- # Logistic Regression .left-column[ $$\log\left(\frac{p(y=1|x)}{p(y=0|x)}\right) = w^T\textbf{x}$$ $$p(y|\textbf{x}) = \frac{1}{1+e^{-w^T\textbf{x}}}$$ `$$\min_{w \in ℝ^{p}} -\sum_{i=1}^n \log(\exp(-y_iw^T \textbf{x}_i) + 1)$$` $$\hat{y} = \text{sign}(w^T\textbf{x} + b)$$ ] .right-column[ ![:scale 100%](images/img_3.png)] ??? Logistic regression is probably the most commonly used linear classifier, maybe the most commonly used classifier overall. The idea is to model the log-odds, which is log p(y=1|x) - log p(y=0|x) as a linear function, as shown here. Rearranging the formula, you get a model of p(y=1|x) as 1 over 1 + ... This function is called the logistic sigmoid, and is drawn to the right here. Basically it squashed the linear function $w^Tx$ between 0 and 1, so that it can model a probability. Given this equation for p(y|x), what we want to do is maximize the probability of the training set under this model. This approach is known as maximum likelihood. Basically you want to find w and b such that they assign maximum probability to the labels observed in the training data. You can rearrange that a bit and end up with this equation here, which contains the log-loss as seen on the last slide. The prediction is the class with the higher probability. In the binary case, that's the same as asking whether the probability of class 1 is bigger or smaller than .5. And as you can see from the plot of the logistic sigmoid, the probability of the class +1 is greater than .5 exactly if the decision function $w^T x$ is greater than 0. So predicting the class with maximum probability is the same as predicting which side of the hyperplane given by w we are on. Ok so this is logistic regression. We minimize this loss and get a w which defines a hyper plane. But if you think back to last time, this is only part of what we want. This formulation tries to fit the training data, but it doesn't care about finding a simple solution. --- # Penalized Logistic Regression `$$\min_{w \in ℝ^{p}}C \sum_{i=1}^n\log(\exp(-y_iw^T \textbf{x}_i) + 1) + ||w||_2^2$$` `$$\min_{w \in ℝ^{p}}C \sum_{i=1}^n\log(\exp(-y_iw^T \textbf{x}_i) + 1) + ||w||_1$$` - C is inverse to alpha (or alpha / n_samples) - Both versions strongly convex, l2 version smooth (differentiable). - All points contribute to $w$ (dense solution to dual). ??? So we can do the same we did for regression: we can add regularization terms using the L1 and L2 norm. The effects are the same as for regression: both push the coefficients towards zero, but the l1 norm encourages coefficients to be exactly zero, for the same reasons we discussed last time. You could also use a mixed penalty to get something like the elasticnet. That's not implemented in the logisticregression class in scikit-learn right now, but it's certainly a sensible thing to do. Here I used a slightly different notation as last time, though. I'm not using alpha to multiply the regularizer, instead I'm using C to multiply the loss. That's mostly because that's how it's done in scikit-learn and it has only historic reasons. The idea is exactly the same, only now C is 1 over alpha. So large C means heavy weight to the loss, means little regularization, while small C means less weight on the loss, means strong regularization. Depending on the model, there might be a factor of n_samples in there somewhere. Usually we try to make the objective as independent of the number of samples as possible in scikit-learn, but that might lead to surprises if you're not aware of it. Some side-notes on the optimization problem: here, as in regression, having more regularization makes the optimization problem easier. You might have seen this in your homework already, if you decrease C, meaning you add more regularization, your model fits more quickly. One particular property of the logistic loss, compared to the hinge loss we'll discuss next is that each data point contributes to the loss, so each data point has an effect on the solution. That's also true for all the regression models we saw last time. --- # (soft margin) linear SVM .larger[ `$$\min_{w \in ℝ^{p}}C \sum_{i=1}^n\max(0,1-y_iw^T \textbf{x}_i) + ||w||_2^2$$` `$$\min_{w \in ℝ^{p}}C \sum_{i=1}^n\max(0,1-y_iw^T \textbf{x}_i)+ ||w||_1$$` ] - Both versions strongly convex, neither smooth. - Only some points contribute (the support vectors) to $w$ (sparse solution to dual). ??? Moving from logistic regression to linear SVMs is just a matter of changing the loss from the log loss to the hinge loss. The hinge-loss is defined as ... And we can penalize using either l1 or l2 norm, or again, in principle also elastic net. This formulation with the hinge loss doesn't really make sense without the penalty, because of the formulation of the hinge loss. What this loss says is basically "if you predict the right class with a margin of 1, there is no loss". Otherwise the loss is linear in the decision function. So you need to be on the right side of the hyperplane by a given amount, and then there is no more loss. That's the reason you need the penalty, for the 1 to make sense. Otherwise you could just scale up $w$ to make it far enough on the right side. But the regularization penalizes growing $w$. The hinge loss has a kink, same as the l1 norm, and so it's not a smooth optimization problem any more, but that's not really a big deal. What's interesting is that all the points that are classified correctly with a margin of at least 1 have a loss of zero, and so they don't influence the solution any more. All the point that are not classified correctly by this margin are the ones that do influence the solution and they are called the support vectors. FIXME graph of not influencing the solution? FIXME: motivate SVM? we'll do it in two lectures... --- class: center # Logistic Regression vs SVM .compact[ `$$\min_{w \in ℝ^{p}}C \sum_{i=1}^n\log(\exp(-y_iw^T \textbf{x}_i) + 1) + ||w||_2^2$$` `$$\min_{w \in ℝ^{p}}C \sum_{i=1}^n\max(0,1-y_iw^T \textbf{x}_i) + ||w||_2^2$$` ![:scale 45%](images/binary_loss.png) ] ??? So this is the main difference between logistic regression and linear SVMs: Does it penalize misclassifications according to the green line, or according to the blue line? In practice it doesn't make a big difference. --- # SVM or LogReg? .center[ ![:scale 80%](images/svm_or_lr.png) ] - Need compact model or believe solution is sparse? Use L1 ??? So which one of them should you use? If you need probability estimates, you should use logistic regression. If you don't, you can pick either, and it doesn't really matter. Logistic regression can be a bit faster to optimize in theory. If you're in a setting where there's many more feature than samples, it might make sense to use linear SVMs and solve the dual, but you can actually solve either of the problems in the dual, and we'll talk about what that means in practice in a little bit. --- # Effect of regularization .center[ ![:scale 90%](images/linear_svm_regularization.png) ] - Small C (a lot of regularization) limits the influence of individual points! ??? So I spared you with coefficient plots, because they looks the same as for regression. All the things I said about model complexity and dependency on the number of features and samples is as true for classification as it is for regression. There is another interesting way to thing about regularization that I found helpful, though. I'm not going to walk through the math for this, but you can reformulate the optimization problem and find that what the C parameter does is actually limit the influence of individual data points. With very large C, we said we have no regularization. It also means individual data points can have basically unlimited influence, as you can see here. There are two outliers here, which basically completely tilt the decision boundary. But if we decrease C, and therefore increase the regularization, what happens is that the influence of these outlier points becomes limited, and the other points get more influence. FIXME illustration for support vectors? --- class: center, middle # Multiclass classification ??? Ok, so I think that's enough on the two loss functions and regularization, and hopefully you have a bit of a feel for how these two classifiers work, and also an understanding that they are in fact quite similar in practice. Next I want to look at how to go from binary classification to multi-class classification. Basically there is a simple but hacky way, and there's a slightly more complicated but theoretically sound way. --- class: center # Reduction to Binary Classification .padding-top[ .left-column[ ## One vs Rest ] .right-column[ ## One vs One ] ] ??? The slightly hacky way is using what's known as a reduction. We're doing a reduction like in math: reducing one problem to another. In this case we're reducing the problem of multi-class classification into several instances of the binary classification problem. And we already know how to deal with binary classification. There are two straight-forward ways to reduce multi-class to binary classification. the first is called one vs rest, the second one is called one-vs-one. --- class: spacious # One Vs Rest For 4 classes: 1v{2,3,4}, 2v{1,3,4}, 3v{1,2,4}, 4v{1,2,3} In general: n binary classifiers - each on all data ??? Let's start with One vs Rest. here, we learn one binary classifier for each class against the remaining classes. So let's say we have 4 classes, called 1 to 4. First we learn a binary classifier of the points in class 1 vs the points in the classes 2, 3 and 4. Then, we do the same for class 2, and so on. The way we end up building as many classifiers as we have classes. --- class: spacious # Prediction with One Vs Rest "Class with highest score" $$\hat{y} = \text{arg}\max_{i \in Y} \textbf{w}_i\textbf{x}$$ Unclear why it works, but work well. ??? To make a prediction, we compute the decision function of all classifiers, say 4 in the example, on a new data point. The one with the highest score for the positive class, the single class, wins, and that class is predicted. It's a little bit unclear why this works as well as it does. Maybe there's some papers about that now, but I'm not So in this case we have one coefficient vector w and one bias b for each class. --- # One vs Rest Prediction .center[ ![:scale 80%](images/ovr_lines.png) ] ??? Here is an illustration of what that looks like. Unfortunately it's a bit hard to draw 4 classes in general position in 2 dimensions, so I only used 3 classes here. So each class has an associated coefficient vector and bias, corresponding to a line. The line tries to separate this class from the other two classes. # Fixme draw ws? --- # One vs Rest Prediction .center[ ![:scale 80%](images/ovr_boundaries.png) ] ??? Here are the decision boundaries resulting from the these three binary classifiers. Basically what they say is that the line that is closest decides the class. What you can not see here is that each of the lines also have a magnitude associated with them. It's not only the direction of the normal vector that matters, but also the length. You can think of that as some form of uncertainty attached to the line. --- class: some-space # One Vs One - 1v2, 1v3, 1v4, 2v3, 2v4, 3v4 - n * (n-1) / 2 binary classifiers - each on a fraction of the data - "Vote for highest positives" - Classify by all classifiers. - Count how often each class was predicted. - Return most commonly predicted class. - Again - just a heuristic. ??? The other method of reduction is called one vs one. In one vs one, we build one binary model for each pair of classes. In the example of having four classes that is one for 1 vs 2, one for 1v3 and so on. So we end up with n * (n - 1) /2 binary classifiers. And each is trained only on the subset of the data that belongs to these classes. To make a prediction, we again apply all of the classifiers. For each class we count how often one of the classifiers predicted that class, and we predict the class with the most votes. Again, this is just a heuristic and there's not really a good theoretical explanation why this should work. --- class: center # One vs One Prediction ![:scale 80%](images/ovo_lines.png) ??? Here is an example for predicting on three classes in 2d using the one-vs-one heuristic. In the case of three classes, there's also three pairs. Three is a bit of a special case, with any more classes there would be more classifiers than classes. The dashed lines are colored according to the pair of classes they separate. So the green and blue line separates the green and blue classes. The data points belonging to the grey class were not used in building this model at all. --- class: center # One vs One Prediction ![:scale 80%](images/ovo_boundaries.png) ??? Looking at the predictions made by the one vs one classifier the correspondence to the binary decision boundaries is a bit more clear than for the one vs rest heuristic, because it only takes the actual boundaries into account, not the length of the normal vectors. That makes it easier to visualize the geometry, but it's also a bit of a downside of the method because it means it discards any notion of uncertainty that was present in the binary classifiers. The decision boundary for each class is given by the two lines that this class is involved in. So the grey class is bounded by the green and grey line and the blue and grey line. There is a triangle in the center in which there is one vote for each of the classes. In this implemenatation the tie is broken to just always predict the first class, which is the green one. That might not be the best tie breaking strategy, but this is a relatively rare case, in particular if there's more than three classes. OVR and OVO are general heuristics not restricted to linear models. They can be used whenever a binary model for classification needs to be extended to the multi-class case. For logistic regression, there is actually a natural extension of the formulation, and we don't have to resort to these hacks. --- class: spacious .left-column[ ## One vs Rest - n_classes classifiers - trained on imbalanced datasets of original size - Retains some uncertainty? ![:scale 80%](images/ovr_boundaries.png) ] .right-column[ ## One vs One - n_classes * (n_classes - 1)/2 classifiers - trained on balanced subsets - No uncertainty propagated ![:scale 80%](images/ovo_boundaries.png) ] ??? If original problem was balanced, that is... --- # Multinomial Logistic Regression Probabilistic multi-class model: $$p(y=i|x) = \frac{e^{\textbf{w}_i^T\textbf{x}}}{\sum_j e^{\textbf{w}_j^T\textbf{x}}}$$ `$$\min_{w \in ℝ^{p}} \sum_{i=1}^n \log(p(y=y_i|x_i))$$` $$\hat{y} = \text{arg} \max_{i \in Y} \textbf{w}_i\textbf{x}$$ - Same prediction rule as OvR ! ??? The binary logistic regression case can be generalized to multinomial logistic regression, in which we model the probability that i is one of the classes using this formula, which is also known as softmax. The probability is proportional to e to the minus $w^t x$ which is the same as in the binary case. But now we need to normalize it so that the sum over all classes is one. So we just divide it by this sum. --- class: some-space # In sckit-learn - OvO: only SVC - OvR: default for all linear models, even LogisticRegression - `LogisticRegression(multinomial=True)` - `clf.decision_function` = $w^Tx$ - `logreg.predict_proba` - `SVC(probability=True)` not great ??? All the models in scikit-learn have multi-class built-in and most of them use One versus Rest. There's only one model that uses One versus One which is SVC. The Kernel SVM uses One versus One because of the authors of the SVM like that. For historical reasons, logistic regression also uses One versus Rest by default in scikit-learn. That's probably not a good idea, but we can’t really change the default easily. Usually, if you do multiclass you probably want to use multinomial logistic regression and so you set multinomial to true and then it does multinomial logistic regression. Question: Does that make it run faster? Answer: Its unlikely to make it run faster, but it makes it more theoretically sound and gives you better probabilities. The probabilities that come out of it, if you do OvR, are a complete hack in the multi-class case but in the binary case, it’s the same. Logistic regression also has a predict_prob method. This method gives the probability estimates, so you get a vector of length number of classes for each data point. You might be tempted to do SVC (probability) equal to true. That is something we're going to talk about in a couple of weeks. This is is running calibration. Basically, this does the One versus One SVM and then it builds a second model on top that tries to estimate probabilities using built-in cross-validation. This will take forever and the outcome will probably be not that great. Don't do this unless you're really sure this is what you want to do.  If you call predict_proba, it will give you an array that has number of samples times number of classes and these entries will sum to one. And the prediction is just the arg max of these. You can call predict which will give you arg max while predict_proba will give you the probabilities as given by the model. --- # Multi-Class in Practice OvR and multinomial LogReg produce one coef per class: .center[ ![:scale 80%](images/img_9.png) ] SVC would produce the same shape, but with different semantics! ??? In practice, I'm using logistic regression on the iris dataset. We have 50 data points, 4 features, 3 classes, each class has 50 samples, and we’re trying to classify different kinds of irises. Here, I'm looking at logistic regression and linear SVM, I built the model. So the coefficient W is stored in coef on this score. Everything in scikit-learn that's estimated from the data ends with an underscore. If it doesn't, it wasn't learned from the data. So coef_ are the coefficient that is learned by the model. They’re for logistic regression and linear Support Vector Machine, they're the same shape, three classes times four features but they have different semantics --- class: center ![:scale 80%](images/img_10.png) ![:scale 80%](images/img_11.png) (after centering data, without intercept) ??? Here I’ve interpreted them. You can see the four features, for each feature and for each class, you have a coefficient. If the sepal width is big, then the setosa classifier is happy. If the sepal with is small then versicolor will have a large response. If the petal width is big then virginica will have a large response. This is a bar plot after coefficient vector here. This tells you what the classifier has learned. This is maybe for a very simple problem this is little much to look at but it's still way less to look at for any other model. If you used a random forest or something like that, there would be no way to visualize what's happening. --- class: center, middle # Computational Considerations #(for all linear models) ??? Now I want to talk about more general things, how to make your homework run faster, also called Computational Considerations. --- class: some-space # Solver choices - Don’t use `SVC(kernel='linear')`, use `LinearSVC` - For `n_features >> n_samples`: Lars (or LassoLars) instead of Lasso. - For small n_samples (<10.000?), don’t worry. - `LinearSVC`, `LogisticRegression`: `dual=False` if `n_samples >> n_features` - `LogisticRegression(solver="sag")` for `n_samples` large. - Stochastic Gradient Descent for `n_samples` really large ??? Some of the things here are specific to scikit-learn and some are not. Scikit-learn has SVC and the linear SVC, and they're both support vector machines. SVC uses One versus One while linear SVC uses one versus rest. SVC uses the hinged loss while linear SVC uses squared hinge loss. Linear SVC will provide faster results than SVC. If you want to do regression with a large number of features, you should probably use Lars or LassoLars, which allows you to do feature selection much more quickly than Lasso. Generally, if you have a few samples, don't worry, any model will find and everything will be sparse. If you have, let's say 10,000 samples all linear models will be fast all the time. Otherwise, use this for regression. For classification, if the number of samples is much greater than the number of features use dual=false. Basically, solving a dual problem means solving something where there are as many variables as the number of samples, that's the default. Whereas solving the primal problem, so dual=false means solving something that's with the number of variables as the same number of features. If the number of features is big, dual should be true, and if the number of samples is big dual should be false. If you have really a whole lot of samples you can use a recent solver called sag. This works really for really large samples. So LogisticRegression(solver=”sag”) that can use L1 or L2 penalties or whatever you want. Then finally, if you have an extremely large amount of data you can use Stochastic Gradient Descent. It has the STD classifier, STD regressor, and hopefully, we'll have enough time to talk about these today. But generally often setting dual to false will help you a lot and setting the solver to something else might help you. All of these basically give you the same solution but only at different speeds. I want to talk about some tips for getting cross-validation. There are some built-in tools for doing quicker cross-validation for linear models. --- class: middle # Efficient Cross-Validation ??? The idea is that we can exploit the model in doing cross-validation. --- class: spacious # Models with build-in cross-validation - LarsCV(), LassoLarsCV(), ElasticNetCV()
Use path-algorithms to compute the full solution path. - LogisticRegressionCV() uses warm-starts, doesn’t support all solvers. - All have reasonable build-in parameter grids. - RidgeCV() - does GCV, approximation to LOO
So you can’t pick the “cv”! ??? There’s a couple of models that have that. Lars, LassoLars, Elastic Net, Logistic Regression and Ridge have a thing called named “the model name”+ “CV”. It means it has built-in cross-validation to adjust the parameters. They do different things behind the scenes and they always make things much faster. For the Lars, Lasso Lars, Elastic Net they compute this coefficient passes that we looked at. They compute the solution for all possible values of the parameter by computing the whole path and that means it's much faster to fit this than trying for each parameter setting to fit it individually. For Logistic Regression that uses warm-starts which means it starts with one parameter setting like C equal to very small with a lot of regularization that’s fast to compute. Then once it has a solution it'll use the solution as a starting point for the solution for the next biggest C. But that only works with some of us solvers. All of them have sort of reasonable built-in parameter grids so you don't need to actually worry too much about how to set the parameters. RidgeCV actually works differently. For the discussed four, you can tell it what cross-validation to use and it will use that cross-validation but it will use something like a path algorithm to compute the solution for many of the regularization parameters at once. On the contrary, RidgeCV independently solves each regularization parameter, but it has a trick to make the cross-validation go faster. You can actually approximate Leave One Out Cross-Validation in Ridge in closed form. Leave One Out cross-validation is basically Leave One Out at one point at a time and built a model. So to compute these exactly, usually, I need to build the number of samples, many models. Also, it has a very high variance. For Ridge, I can actually compute exactly in closed form, given the model. So you can’t pick the CV, it will always do something that's equivalent to Leave One Out but you can pick any grid because it'll just evaluate the grid using a for loop. --- class: center # Using EstimatorCV .center[ ![:scale 100%](images/img_12.png) ] ??? Here's a very small example of how this would look like. Here I use GridSearchCV with Ridge with like. It does 10 fold cross-validation. This builds 10 models times 10 parameter settings. RidgeCV by default has the same parameter settings but instead of doing 10 times 10 models, we only do 10 models because we get the Leave One Out cross-validation for free and they come up with the same result. They both have the same tested score and they have the same alpha that is selected. Only the second one is 10 times faster. This is pretty helpful. It's a little bit tricky if you have multiple pre-processing steps, and we'll talk about this later in the course. The problem here is that if you have pre-processing, you want to pre-process to be inside the cross-validation and if you use something like RidgeCV or LassoCV, you can really put any preprocessing inside this cross-validation and that's not so great. --- class: center, middle # Stochastic Gradient Descent ( see http://leon.bottou.org/projects/sgd and http://leon.bottou.org/papers/bottou-bousquet-2008 and http://scikit-learn.org/stable/modules/scaling_strategies.html ) ??? The last thing I want to talk about today is Stochastic Gradient Descent. This is just another solver to solve linear models or neural networks. But it's good to understand a little bit more in detail because it comes up a lot in particular with very large data sets. --- class: right # Decomposing Generalization Error .center[ ![:scale 100%](images/img_13.png) ] Bottou et. al. ??? The idea here is that if you have a lot of data, maybe solving the problem exactly isn't as important as looking at all of the data. Let's say I want to find a good function that generalizes well over to test dataset and I have a budget of how many data points I can look at it and I want to approximate the best possible function on the training set with an accuracy of epsilon. What we want is a model of generalized as well, what we do in practice is we pick a family of functions, like the linear functions, we estimate the best function using the training set, we want one that's the best on the true distribution, but instead we're using the training set and then we need to have some numeric optimization procedure that optimizes it until the error is smaller than epsilon for whatever loss, the loss could be regularized or anything but still we need to minimize optimization problem to some precision and we can only use at most as much data points as their dataset. And we've only a particular budget of time that it can use. So these are sort of the restrictions we have. And we want to find the best model. --- class: center, middle .center[ ![:scale 100%](images/img_14.png) ] ??? So now let's look at what happens to these three errors in the time if we increase different parts. If we make the family of functions bigger, so let's say we use from linear function to neural networks or we go to a high dimensional space, the approximation error, that’s the error that we get by restricting ourselves to do class goes down because we have a richer class. The estimation error which means the error we get by using the training set, instead of having access to the true distribution gets larger because we have more flexibility in our model, so the distance between what the ideal will be on the true distribution and the training data set becomes bigger. And if we have a larger family of functions obviously it's going to take longer. If you have more data points, the estimation error will go down. So our optimization will be closer to what is the true distribution, but it will take more time. The final row represents the precision to which I want to optimize, the epsilon in which I want to stop optimizing the problem that I'm optimizing. The optimization error will go up, but the time will go down. It's faster if I optimize less strongly. --- class: spacious # The Trade-off .center[ ![:scale 100%](images/img_math_1.png) ] - If `$n_\text{max}$` is large, we are constraint by $T_\max$! - Use a worse algorithm but look at more data! ??? If the number of data points is really large, the thing that we really constraint is by the runtime. If constrained by the runtime, can't we just subsample the data? Yes, you could. Then you would run faster. But the point that he's making is it's better to look at all of the data and so we're decreasing estimation error but we don't find a precise solution. So now we say it's more important to minimize the estimation error, which we can do by looking at a lot of data than actually optimizing it very precisely because the thing that we are optimizing is a training set error, which is not really the thing that we're interested in the first place. So we look at the algorithm that does worst in terms of optimization, but it's much faster. This is the algorithm that’s most commonly used and the algorithm is Stochastic Gradient Descent. --- # Reminder: Gradient Descent .right-column[![:scale 1-0%](images/img_15.png)] Want: $$\arg \min_w F(w)$$ Initialize $w_0$ $$w^{(i+1)} \leftarrow w^{(i)} - \eta_i\frac{d}{dw}F(w^{(i)})$$ Converges to local minimum ??? First, let's talk about Gradient Descent. So we have some function we want to minimize here the function is Lasso training data set plus the regularizer. F is the objective of the model and I want to find the best parameter setting w.  This converges to a local minimum in the function. For linear models, there's only one global minimum. Basically, any optimization algorithm you can think of will always converge to the same solution, they only converge at different speeds. --- # Reminder: Gradient Descent .center[ ![:scale 40%](images/img_16.png) ] $$w^{(i+1)} \leftarrow w^{(i)} - \eta_i\frac{d}{dw}F(w^{(i)})$$ ??? --- # Pick a learning rate .center[ ![:scale 90%](images/img_17.png) ] $$w^{(i+1)} \leftarrow w^{(i)} - \eta_i\frac{d}{dw}F(w^{(i)})$$ ??? A little bit of an issue here is picking a learning rate which is how big a step are you making.  If you pick the right step size, you can make very quick progress.  This is a very simple optimizer. But it's not great and it’s not very fast because you need to compute gradients over the whole dataset. What you can do instead is you can approximate a gradient by looking only a single data point at a time. --- # Stochastic Gradient Descent - Logistic Regression: `$$F(w) = -C \sum_{i=1}^n\log(\exp(-y_iw^T \textbf{x}_i) +1 ) + ||w||_2^2$$` - Pick $x_i$ randomly, then `$$\frac{d}{dw}F(w) = \frac{d}{dw} -C \log(\exp(-y_iw^T \textbf{x}_i) +1 ) + \frac{1}{n}||w||_2^2$$` - In practice: just iterate over i. ??? Looking at the Logistic Regression, the functional Logistic Regression we want to minimize is the log loss plus the regularizer. Instead of looking at the gradient for the whole sum here, we can get a stochastic approximation of the gradient by looking at only one of the sums at a time. In practice, we iterate over the dataset and go one by one through all the data points. We make sure we shuffle them before. Then we do small gradient steps. This is a very bad optimizer compared to the SAG but it can go very quickly over a lot of data. --- class: spacious # SGD and partial_fit - SGDClassifier(), SGDRegressor() fast on very large datasets - Tuning learning rate and schedule can be tricky. - partial_fit allows working with out-of-memory data! ??? This is implemented in SGD classifier, and SGD regressor and you can use it in very large data sets. It's a little bit tricky to tune the learning rate and so you can either pick as constant learning rate, or you can pick an exponentially decreasing learning rate. There's one that's called optimal. If you scale your data to standard division 1, then the optimal one will often work well but it's not actually optimal on any sense. This will allow you to give you something quickly on a big data set.  If you have like streaming data coming in and you having infinite data, you can just keep giving it more and more data called partial_fit. This method will update the model. In scikit-learn, if you call fit multiple times it will always forget whatever it saw before. Each fit resets the model while partial fit will remember what it saw before and keeps fitting the model. SGDClassifier() and SGDRegressor both have a whole bunch of different loss function penalties so they both can do elastic net penalty and the classifier can do logistic loss and hinge loss and squared hinge loss and the regressor can do Huber loss and squared error and absolute error. So there are many, many different choices for different loss functions. --- class: center, spacious ![:scale 90%](images/img_18.png) ![:scale 90%](images/img_19.png) ??? Fit works just like everywhere else. Partial fit you can call it with different batches of data and this will keep fitting the model. One thing that you should keep in mind for the classifier is that you need to give it the classes at the beginning because it doesn't know how many classes there are and at the first time, not all the classes might be present in the data you give it to. So you need to specify how many classes there are. Partial fit doesn't do loops over a dataset. So if you want to use a partial fit, and you want to loop over dataset multiple times, you have to set the loop yourself. If you loop over a dataset, if you do more of gradient descent, then you get better results. This code is the same code for all combinations of losses and regularizers because it’s very simple to write this down. --- class: center, middle # Questions ?


BroArena is a text based RPG. Enter list at any time to display all the possible actions you can make.
You are Brotimus, an aspiring Bro gladiator. You want to become King Bro. The only way to achieve this goal is through combat in the BroArena.
Type Start to begin the game


Congratulations! You have now mastered the medium difficulty level. In this new module, we will be learning about odd features in galaxies, including: - what is gravitational lensing? why do we see them? - what is a dust lane galaxy? what are their properties?


SC12-520 Motion Amicus Curiae - Florida Supreme Court
Pamela L. Cooper. General Counsel. Florida Bar No. 0302546. Email: pam<EMAIL_ADDRESS>Florida Education Association. 300 East Park Avenue .
http://www.floridasupremecourt.org/pub_info/summaries/briefs/12/12-520/Filed_06-07-2012_Legislature_Motion_Amicus.pdf
Treatment for Herniated or Bulging Discs
Pam Cooper - Cooper Photography
Pam Cooper is an award-winning photographer specializing in weddings, . has earned an Education Degree from Florida Professional Photographers, Inc., .
http://www.cooperphotography.com/pamcooper.html
Elder Care Services, Inc. ~ Tallahassee, Florida
The book highlights the fact that Florida has the highest median age. . One of our Senior Volunteer Program Coordinators, Pamela Cooper, gave me a copy of a .
http://www.ecsbigbend.org/
pam cooper doe florida Herniated or Bulging Discs
Plaintiffs' Motion for Leave to File Amended Complaint
PAMELA L. COOPER. General Counsel. Florida . Email: pam.cooper@?oridaea. org. Florida . Defendant STATE OF FLORIDA DEPARTMENT OF EDUCATION .
http://www.meyerbrookslaw.com/documents/Robinson%20vs%20Robinson/Plaintiffs_Motion_for_Leave_to_File_Amended_Complaint.pdf
Indian River Genealogical Society - Home
Instructor: Pamela J. Cooper, Supervisor, Indian River County Main Library, . for obituaries appearing in Indian River County, Florida newspapers from 1913 .
http://www.irgs.org/
Official Impairment Listing for Spinal Disorders
Pam Bondi - Wikipedia, the free encyclopedia
Assistant State Attorney for the 13th Judicial Circuit of Florida . Pamela Jo "Pam" Bondi (born November 17, 1965) is the current Attorney General of Florida.
http://en.wikipedia.org/wiki/Pam_Bondi
- dirty mississippi mud cake (narrowing of the spine)
SC12-520 Motion Amicus Curiae - Florida Supreme Court
The Florida Association of Counties, Inc., by and through its undersigned counsel . In support of this motion, it does state: 1<EMAIL_ADDRESS>.
http://www.floridasupremecourt.org/pub_info/summaries/briefs/12/12-520/Filed_06-12-2012_FAC_Amicus_Motion.pdfFlorida Lines June 2012 - Florida Genealogical Society (Tampa)
Jun 30, 2012 . Pamela Cooper and the Conference Committee . June 2012The Florida State Genealogical Society, Inc. 2 . And, what does she .
http://fgstampa.org/upload/Newsletters_-_Other_Societies/June_2012_06292012.pdf
Pam Cooper (The Real Estate Center) - Broker Owner - Seymour, IN
ActiveRain real estate profile for Pam Cooper (The Real Estate Center) a Broker Owner in Seymour, IN.
http://activerain.com/cooperp
Pamela Anne Cooper Guest Book: sign their guest book, share your ...
Dec 3, 2012 . Sign and view the Guest Book for Pamela Anne Cooper, leave condolences, send flowers, . Our staff does not correct grammar or spelling.
http://www.legacy.com/guestbooks/starledger/guestbook.aspx?n=pamela-cooper&pid=161358406
Medical-Vocational Allowance for Herniated Disc
SC12-520 Answer Brief Merits - Florida Supreme Court
Jun 28, 2012 . RICK SCOTT, PAM BONDI, and . B. The trial court's decision does not require that the Governor . Email<EMAIL_ADDRESS>Florida .
http://www.floridasupremecourt.org/pub_info/summaries/briefs/12/12-520/Filed_06-28-2012_Answer_Brief_IUPA.pdf
SC12-520 Motion to file Amicus Brief by - Florida Supreme Court
Itself, Does Not Justify Impairing the Obligation of Contract. . C. Defined Benefit Plans, Such as the Florida Retirement System's<EMAIL_ADDRESS>.
http://www.floridasupremecourt.org/pub_info/summaries/briefs/12/12-520/Filed_07-03-2012_Motion_to_File_Amicus_NCPERS.pdf
Appealing a Denial of Benefits
Pamela Cooper Guest Book: sign their guest book, share your ...
Nov 11, 2012 . Online Guest Book for Pamela Cooper. Sign and view the Guest . Our staff does not correct grammar or spelling. Privacy Policy | Terms of Use .
http://www.legacy.com/guestbooks/CapitalGazette/guestbook.aspx?n=pamela-cooper&pid=160968886&nocache=true&cid=addentry&sign=0


1. Hyper-automation
2. Multiexperience
1. Hyper-automation
HyperAutomation
As defined by Gartner, hyper-automation “deals with the application of advanced technologies, including artificial intelligence (AI) and machine learning (ML), to increasingly automate processes and
augment humans. Hyper-automation extends across a range of tools that can be automated,
but also refers to the sophistication of the automation (i.e., discover, analyse, design, automate, measure, monitor, reassess.)” In simple terms, hyper-automation refers to the mixture of automation technologies that exist to augment and expand human capabilities.
How is Hyper-automation Different from Regular Automation? When we think of automation, terms like robotic process automation come to mind. But, hyper-automation takes an ecosystem of technologically advanced tools and combines them to create a new way to work.
It means that low-value tasks are optimally performed with automation tools, machine learning and advanced artificial intelligence so that outputs can be produced automatically and run efficiently
with little to no human intervention. Then, together with humans, hyper-automation can create a workplace that is always informed, agile and able to use data and insights for quick and accurate decision-making.
Multiexperience
For the past decade of modern mobility (since the introduction of iOS and Android in 2007), enterprises have worked in parallel to transform web development for responsive,multichannel support and
to ramp up mobile app development competencies. Over that time, technologies and practices have matured and converged,
such as the common use of HTML5, CSS3, JavaScript and RESTful APIs, along with the adoption of agile methodologies and DevOps.
Now the time has come to consider the merging of web and mobile development activities as “business as usual” for development organizations, and extend this to the next generation of user experiences
Application leaders must adopt an appropriate multiexperience development platform to create and support a plethora of digital user experiences.
A MXDP offers professional and citizen developers a range of front-end development tools and back-end services that enable rapid, scalable development of seamless, targeted and ambient user experiences across devices and channels.Gartner recently published a “Tech Insight for Multiexperience Development Platforms” research note to introduce this concept to our clients. We encourage client inquiries with the authors of this research to learn more.
Distributed cloud
A distributed cloud refers to having computation, storage, and networking in a micro-cloud located outside the centralized cloud.
Examples of a distributed cloud include both fog computing and edge computing. Establishing a distributed cloud situates computing closer to the end user, providing decreased latency and
opportunities for increased security.
Potential security solutions include a blockchain-based security architecture or random auditing of data to check for integrity. A distributed cloud also processes data in real-time.
Edge computing is already a reality. It’s anticipated that a significant increase in connected technology will surge the demand for edge computing to alleviate network traffic.
One major contributor to its growth is the Internet of Things (IoT). Santhosh Rao, Gartner’s senior analyst, commented that “currently, around 10 percent of enterprise-generated data is
created and processed outside a traditional centralized data center or cloud.
By 2025, Gartner predicts this figure will reach 75 percent.”