MQTT Module
- Version:
-
- 2.0
- Source:
Members
-
<static> Client
-
MQTT Client var
- Source:
-
<static> clientId
-
MQTT clientId var
- Source:
Methods
-
<static> addSubscription(profileNum)
-
MQTT Addsubscription to new NodeServer
Parameters:
Name Type Description profileNum
number add new subscription to NodeServer with profileNum.
- Source:
-
<static> addSubscriptions()
-
MQTT Addsubscriptions to Polyglot topics and existing NodeServer topics.
- Source:
-
<static> makeResponse(topic, command, message)
-
MQTT Make Response
Parameters:
Name Type Description topic
string topic to publish to. Should be either 'connections' or the profileNum of the NodeServer
command
string Command to send, e.g 'status', etc.
message
object Dictionary object of message to send. JSON format.
- Source:
-
<static> parse(topic, message)
-
MQTT Parse incoming message from MQTT
Parameters:
Name Type Description topic
string topic received on.
message
object Dictionary object of message. JSON parsed into object.
- Source:
-
<static> publish(topic, message, options, callback)
-
MQTT Once MakeResponse is complete, publish the message to MQTT
Parameters:
Name Type Description topic
string topic to publish to. Should be either 'connections' or the profileNum of the NodeServer
message
object Dictionary object of message to send. JSON format.
options
object Typically used for {retain: True/False} to retain the last message. [Optional]
callback
function Callback when publish is complete. [Optional]
- Source:
-
<static> startService(callback)
-
MQTT Start Service and Connect via .env MQTT_HOST and MQTT_PORT provided.
Parameters:
Name Type Description callback
function Callback when connected or if already started.
- Source:
-
<static> stopService(callback)
-
MQTT Stop Service
Parameters:
Name Type Description callback
function Callback when service is and conneciton is clear.
- Source:


People love watching videos. Youtube, Netflix and many more new video services have changed how and what people watched everyday in recent years. However, documentary videos have been less covered in these new platforms. Compared with movies and TV programs, documentary videos has much less population. But there are always people interested in them and lots of great documentary videos are in lack of exposure. With the trending that people watch videos more often on smartphones during leisure time, documentary videos, usually shorter and less addictive, could be a good candidate for such mobile users to consume.
DocuWorld is targeting at mobile users with two major scenarios. The first scenario is for people who love documentary or work in this industry. They usually have their favorites topics or authors and would like to keep update with the most recent videos. Sometimes, they will dig into the topic or author so they can find more interesting contents. The second scenario is for general public who know less of documentary videos but have some fragment time to watch something. While sitting in a bus or waiting for the train, they pull up their smartphones to watch something hot at the moment.
DocuWorld is designed for better recommending documentary videos for users to cultivate their interests in documentary world. The design goal is to make it really easy for users to quickly find something great to watch. There are three feeds available according to different use cases. The home feed recommends videos based on topics and authors user followed. The hot feed simply lists documentary videos based on population in different timeframes. The event feed provides hand picked videos grouped into collection that is relevant to what is happening around the world. For example, an olympic collection can be presented while the world’s attention is on Rio 2016. On top of all three feeds, a time filter is available to help user select videos short enough to watch in their mobile contexts.


pdfcrawl¶
pdfcrawl utility is meant for searching vast pdf files for certain policy and extract the pages where the match is found.
Getting Started¶
Installation
The utility can be installed and run in multiple ways.
Running
- Help
Note
usage: app.py [-h] [-d] -f FILES [FILES …] [-l LOGFILE] [-n NUM] -g SEARCH_LIST [SEARCH_LIST …] -s STATE
A commandline utility to crawl on pdf files.
- optional arguments:
- -h, --help
show this help message and exit
- -d, --debug
Enable debug output
- -f
FILES [FILES …], –files FILES [FILES …] The absolute path to all files separated by white space.
- -l LOGFILE, --log LOGFILE
Log file name.
- -n NUM, --num NUM
Number of files to operate on simultaneously. Should not be a number greater than processor in your computer. Default is 4.
- -g
SEARCH_LIST [SEARCH_LIST …], –grep SEARCH_LIST [SEARCH_LIST …] Strings to search. The order of the string is preserved.
- -s STATE, --state STATE
State for which policy needs to be extracted.
Running the executable.
Note
pdfcrawl -f “pdf_file1”,”pdf_file2”,pdf_file3 -g Headline of Insurance Document -s state
Running from source code.
Note
C:Workspace> python -m pdfcrawl.pdfcrawl.app -f “pdf_file1”,”pdf_file2”,pdf_file3 -g Headline of Insurance Document -s state


Boxes represent classes and lines represent inheritance relationship. Lower boxes inherit from higher boxes.


Acronis Disk Director 12 Home Updating To The Latest Build Knowledge Base
Acronis Disk Director 12 Free Download
Download Acronis Disk Director 12 Build 12 5 163
Download Acronis Disk Director 2020 12 5 Techspot
Acronis Disk Director V12 5 163 Free Download Software Reviews Downloads News Free Trials Freeware And Full Commercial Software Downloadcrew
Acronis Disk Director Download 2021 Latest For Windows 10 8 7
Acronis Disk Director 12 Crack Plus Serial Key Download
Acronis Disk Director 12 0 96 Boot Cd Free Download
Acronis Disk Director 12 0 3270 Firstfasr
Acronis Disk Director 12 5 How To Create Bootable Media Knowledge Base
Acronis Disk Director 12 Download Bootable Media Knowledge Base
Download Acronis Disk Director 12 Full With Serial Key Graphictutorials
Acronis Disk Director Crack 12 Download With Key Life Time Key
Acronis Disk Director 12 5 How To Install Knowledge Base
Acronis Disk Director 64 Bit Download For Windows 10 Pc Laptop 2021
Acronis Disk Director 12 Crack Serial Key Full Free Download
Acronis Disk Director 12 Installation Over An Older Version Knowledge Base
Download Acronis Disk Director 11 Home 64 Bit Buy Online Version
How To Download Acronis Product In Another Language Knowledge Base
Acronis Disk Director 12 5 デモからフルバージョンに切り替える方法 Knowledge Base
Acronis Disk Director Crack 12 5 Serial Key 2021 Download
Acronis Disk Director 12 Serial Key Treetechnologies
Acronis Disk Director 12 Build 12 0 0 3270 Support Windows 10 Download Act 3
Acronis Disk Director 12 1 Pc Newegg Com
Acronis Disk Director 12 Creating Acronis Bootable Media Knowledge Base


Members
adminRoles :Array.<string>
Array of admin role names
Type:
- Array.<string>
- Source:
admins :Array.<string>
Array of admin user IDs
Type:
- Array.<string>
- Source:
djRoles :Array.<string>
Array of DJ role names
Type:
- Array.<string>
- Source:
owner :Array.<string>
Array of owner user IDs
Type:
- Array.<string>
- Source:
Methods
hasRoles(roles, user, guild) → {boolean}
Checks if a user has certain roles (by name).
Note: Only one of the roles passed is required for this to return a positive value.
Parameters:
| Name | Type | Description |
|---|---|---|
roles |
string | Array.<string> | Role name(s) to check. |
user |
Discord.GuildMember | Discord.User | The user to check. Can also be a Discord.GuildMember. |
guild |
Discord.Guild | The guild to check. Not needed if user is a GuildMember. |
- Source:
Returns:
- Type
- boolean
isAdmin(user, guild, globalOnly) → {boolean}
Checks if a user has admin rights.
Parameters:
| Name | Type | Description |
|---|---|---|
user |
Discord.GuildMember | Discord.User | The user to check. Can also be a Discord.GuildMember. |
guild |
Discord.Guild | The guild to check. Not needed if user is a GuildMember. |
globalOnly |
boolean | Check only for global admins. |
- Source:
Returns:
- Type
- boolean
isDJ(user, guild) → {boolean}
Checks if a user has DJ roles.
Parameters:
| Name | Type | Description |
|---|---|---|
user |
Discord.GuildMember | object | The user to check. Can also be a Discord.GuildMember. |
guild |
Duscord.Guild | The guild to check. Not needed if user is a GuildMember. |
- Source:
Returns:
- Type
- boolean
isGuildOwner(user, guild) → {boolean}
Checks if a user is the guild owner.
Parameters:
| Name | Type | Description |
|---|---|---|
user |
Discord.GuildMember | Discord.User | The user or member to check |
guild |
Discord.Guild | The guild to check |
- Source:
Returns:
- Type
- boolean
isOwner(user) → {boolean}
Check if a user is the bot owner
Parameters:
| Name | Type | Description |
|---|---|---|
user |
Discord.User | User to check |
- Source:
Returns:
- Type
- boolean


AWS::IAM::ManagedPolicy
AWS::IAM::ManagedPolicy
creates an AWS Identity and Access Management (IAM) managed policy for your
AWS account, which you can use to apply permissions to IAM users, groups, and roles.
For more
information about managed policies, see Managed Policies and Inline
Policies in the IAM User Guide guide.
Topics
Syntax
To declare this entity in your AWS CloudFormation template, use the following syntax:
JSON
{ "Type": "AWS::IAM::ManagedPolicy", "Properties": { "Description" :
String
, "Groups" : [String, ...
], "Path" :String
, "PolicyDocument" :JSON object
, "Roles" : [String, ...
], "Users" : [String, ...
], "ManagedPolicyName" :String
} }
YAML
Type: AWS::IAM::ManagedPolicy Properties: Description:
String
Groups: -String
Path:String
PolicyDocument:JSON object
Roles: -String
Users: -String
ManagedPolicyName:String
Properties
Description
-
A description of the IAM policy. For example, describe the permissions that are defined in the policy.
Required: No
Type: String
Update requires: Replacement
Groups
-
The names of IAM groups to attach to this policy.
Required: No
Type: List of String values
Update requires: No interruption
Path
-
The path for the IAM policy. By default, the path is
/
. For more information, see IAM Identifiers in the IAM User Guide.Required: No
Type: String
Update requires: Replacement
PolicyDocument
-
Policies that define the permissions for this managed policy. For more information about policy syntax, see IAM Policy Elements Reference in IAM User Guide.
Required: Yes
Type: JSON object
Note
AWS Identity and Access Management (IAM) requires that policies be in JSON format. However, for templates formatted in YAML, you can create an IAM policy in either JSON or YAML format. AWS CloudFormation always converts a policy to JSON format before submitting it to IAM.
Update requires: No interruption
Roles
-
The names of IAM roles to attach to this policy.
Note
If a policy has a
Ref
to a role and if a resource (such asAWS::ECS::Service
) also has aRef
to the same role, add aDependsOn
attribute to the resource so that the resource depends on the policy. This dependency ensures that the role's policy is available throughout the resource's lifecycle. For example, when you delete a stack with anAWS::ECS::Service
resource, theDependsOn
attribute ensures that theAWS::ECS::Service
resource can complete its deletion before its role's policy is deleted.Required: No
Type: List of String values
Update requires: No interruption
Users
-
The names of users to attach to this policy.
Required: No
Type: List of String values
Update requires: No interruption
ManagedPolicyName
-
A custom, friendly name for your IAM managed policy. For valid values, see the PolicyName parameter of the
CreatePolicy
action in the IAM API Reference.If you don't specify a
PolicyName
, AWS CloudFormation generates a unique physical ID and uses that ID for the policy name. For more information, see Name Type.Important
If you specify a name, you cannot perform updates that require replacement of this resource. You can perform updates that require no or some interruption. If you must replace the resource, specify a new name.
Required: No
Type: String
Update requires: Replacement
Return Values
Ref
When the logical ID of this resource is provided to the Ref
intrinsic function, Ref
returns the ARN.
In the following sample, the Ref
function returns the ARN of the
CreateTestDBPolicy
managed policy, such as
arn:aws:iam::123456789012:policy/teststack-CreateTestDBPolicy-16M23YE3CS700
.
{ "Ref": "CreateTestDBPolicy" }
For more information about using the Ref
function, see Ref.
Example
The following example creates a managed policy and associates it with the
TestDBGroup
group. The managed policy grants users permission to create
t2.micro database instances. The database must use the MySQL database engine and the
instance
name must include the prefix test
.
JSON
"CreateTestDBPolicy" : { "Type" : "AWS::IAM::ManagedPolicy", "Properties" : { "Description" : "Policy for creating a test database", "Path" : "/", "PolicyDocument" : { "Version":"2012-10-17", "Statement" : [{ "Effect" : "Allow", "Action" : "rds:CreateDBInstance", "Resource" : {"Fn::Join" : [ "", [ "arn:aws:rds:", { "Ref" : "AWS::Region" }, ":", { "Ref" : "AWS::AccountId" }, ":db:test*" ] ]}, "Condition" : { "StringEquals" : { "rds:DatabaseEngine" : "mysql" } } }, { "Effect" : "Allow", "Action" : "rds:CreateDBInstance", "Resource" : {"Fn::Join" : [ "", [ "arn:aws:rds:", { "Ref" : "AWS::Region" }, ":", { "Ref" : "AWS::AccountId" }, ":db:test*" ] ]}, "Condition" : { "StringEquals" : { "rds:DatabaseClass" : "db.t2.micro" } } }] }, "Groups" : ["TestDBGroup"] } }
YAML
CreateTestDBPolicy: Type: AWS::IAM::ManagedPolicy Properties: Description: "Policy for creating a test database" Path: "/" PolicyDocument: Version: "2012-10-17" Statement: - Effect: "Allow" Action: "rds:CreateDBInstance" Resource: Fn::Join: - "" - - "arn:aws:rds:" - Ref: "AWS::Region" - ":" - Ref: "AWS::AccountId" - ":db:test*" Condition: StringEquals: rds:DatabaseEngine: "mysql" - Effect: "Allow" Action: "rds:CreateDBInstance" Resource: Fn::Join: - "" - - "arn:aws:rds:" - Ref: "AWS::Region" - ":" - Ref: "AWS::AccountId" - ":db:test*" Condition: StringEquals: rds:DatabaseClass: "db.t2.micro" Groups: - "TestDBGroup"


Digital Clock (default HH:mm:ss)
Digital Clock (default HH:mm:ss) border
Digital Clock (default HH:mm:ss) and digitalStyle
Digital Clock (hh:mm:ss A) by class
Digital Clock (HH:mm a) by class
Analog Clock default
Analog Clock image 1
Analog Clock image 2 and digital time
Analog Clock by class and image 3 and analogStyle and digital time


As you cast the spell, you draw a 10-foot-diameter circle on the ground inscribed with sigils that link your location to a permanent teleportation circle of your choice w hose sigil sequence you know and that is on the same plane of existence as you. A shimmering portal opens within the circle you drew and remains open until the end of your next turn. Any creature that enters the portal instantly appears within 5 feet of the destination circle or in the nearest unoccupied space if that space is occupied.
Many m ajor temples, guilds, and other important places have permanent teleportation circles inscribed somewhere within their confines. Each such circle includes a unique sigil sequence—a string of magical runes arranged in a particular pattern. When you first gain the ability to cast this spell, you learn the sigil sequences for two destinations on the Material Plane, determined by the DM. You can learn additional sigil sequences during your adventures. You can commit a new sigil sequence to memory after studying it for 1 minute.
You can create a permanent teleportation circle by casting this spell in the same location every day for one year. You need not use the circle to teleport when you cast the spell in this way.


ExternalTypeSymbol Class
Definition
Line
6
of
cppsymbols/ExternalTypeSymbol.cm
Inheritance
Constructors & Destructor
public
nothrow
ExternalTypeSymbol
(
const
Span
& span_,
const
String
<
uchar
>& name_)
Member Functions
public
override
void
Accept
(
SymbolVisitor
& visitor)
public
override
nothrow
String
<
uchar
>
FullName
()
const
Constructor& Destructor Details
ExternalTypeSymbol Constructor
public
nothrow
ExternalTypeSymbol(
const
Span
& span_,
const
String
<
uchar
>& name_)
Definition
Line
8
of
cppsymbols/ExternalTypeSymbol.cm
Member Function Details
Accept Member Function
public
override
void
Accept(
SymbolVisitor
& visitor)
Definition
Line
15
of
cppsymbols/ExternalTypeSymbol.cm
FullName Member Function
public
override
nothrow
String
<
uchar
> FullName()
Definition
Line
11
of
cppsymbols/ExternalTypeSymbol.cm


Workout Tips:
For many, starting a regular exercise routine may seem like a scary task. Here are some tips on how to get off on the right foot:
- Start Small-Pushing yourself beyond your limit right off the bat will lead to a fast failure. Yoga, for example, is a great way to start off getting into a habit of exercising. Here is an easy yoga routine for beginners.
- Build a Routine-Make working out a weekly habit. It may seem like an impossible task to some, but working out for 3-4 days a week, at least 30 minutes a session, is essential for beginner success.
- Diet, diet, diet-Diets are not all just eating celery sticks and drinking lemon water.  A good start is reducing the amount of PROCESSED food in your diet. Here is a list of processed foods to avoid in your daily diet.
- Ask Questions-As a beginner in anything, you are bound to have questions. Do not be afraid to reach out to more experienced people or post in online forums. Collaboration is a great way to share ideas and be successful together by being held accountable. Reach out to your local gym - there are trainers and coaches that could advise you toward the best workout program for you.
Below is a 14 week program which is used in preparation for Air Force Boot Camp. Do not be intimidated! This program is designed for beginners.
14 Week Program


Xiu Xiu: The Sent Down Girl ****
rated R Stratosphere Entertainment 99 minutes in Mandarin with English subtitles starring Lu Lu, Lopsang, Jie Gao, Wenqiang Wang, Jiangchi Min, Qin Lao, Fang Huang, Luoyong Wang based on the novel "Tian Yu" by Geling Yan written by Joan Chen and Geling Yan directed by Joan Chen
"Xiu Xiu", the astonishing debut film from Chinese actress Joan Chen, has been banned in its native country because of "inappropriate" political and sexual content. This ban is expected, since Chen's film is so bold and provocative, and because its target is the corrupt Chinese government. The beautiful Lu Lu stars as Xiu Xiu(no more confusion), a young girl who is "sent down" out of her city in a program called Educated Youth. The Chinese government believes that this is a way to keep lower-class families out of their cities. Xiu Xiu ends up as an apprentice to an older man named Lao Jin, learning how to herd horses. She is told that after six months she will be able to return to her home. But as those months pass, she learns that the only way to have any chance of returning is to let the men at headquarters have sex with her. This leads to a tragic, cathartic outcome which reflects the sad truth. Xiu Xiu learns that her fate is indeed in her hands. The scenes involving Lao Jin and Xiu Xiu are done with a subtle grace requiring little dialogue. Although "Xiu Xiu" clocks in at 99 minutes, it is indeed an epic; a tale of fate, corruption and heartbreak. The performances are excellent, and Joan Chen shows depth far surpassing any other first filmmaker I've seen in ages. The film's heartbreaking score adds to the drama, but "Xiu Xiu" would be fine even without it. Daring and breathtaking, "Xiu Xiu" is one of the year's very best offerings.
a capsule review by Akiva Gottlieb, The Teenage Movie Critic<EMAIL_ADDRESS>http://teenagemoviecritic.8m.com
The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).
The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.
Please direct comments/criticisms of the review to relevant newsgroups.
Broken URLs inthe reviews are the responsibility of the author.
The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.
Related links: index of all rec.arts.movies.reviews reviews


Sorry, something went wrong! Please, try again later
{{champ.caption}}
Current Matchday: {{champ.currentMatchday}}
Matchdays: {{champ.numberOfMatchdays}}
Teams: {{champ.numberOfTeams}}
Games: {{champ.numberOfGames}}


6. Naive Bayes and Hyperparameter Optimization¶
Hayley Boyce, May 5th, 2021
# Importing our libraries
import pandas as pd
import altair as alt
import numpy as np
from sklearn.tree import DecisionTreeClassifier
from sklearn.dummy import DummyClassifier, DummyRegressor
from sklearn.neighbors import KNeighborsClassifier, KNeighborsRegressor
from sklearn.model_selection import cross_validate, train_test_split
from sklearn.svm import SVR, SVC
import sys
sys.path.append('code/')
from display_tree import display_tree
from plot_classifier import plot_classifier
import matplotlib.pyplot as plt
# Preprocessing and pipeline
from sklearn.impute import SimpleImputer
from sklearn.metrics.pairwise import euclidean_distances
from sklearn.pipeline import Pipeline, make_pipeline
from sklearn.preprocessing import OneHotEncoder, OrdinalEncoder, StandardScaler, MinMaxScaler
6.1. House Keeping¶
Quiz Today!
Result of Polls
Assignment due Monday
Project groups this week
Project instructions next week
Heavy class today, more learning, less practice (sorry!)
6.2. Lecture Learning Objectives¶
Explain the naive assumption of naive Bayes.
Predict targets by hands-on toy examples using naive Bayes.
Use
scikit-learn
’sMultiNomialNB
.Use
predict_proba
and explain its usefulness.Explain the need for smoothing in naive Bayes.
Explain how
alpha
controls the fundamental tradeoff.Explain the need for hyperparameter optimization
Carry out hyperparameter optimization using
sklearn
’sGridSearchCV
andRandomizedSearchCV
.
6.3. Five Minute Recap/ Lightning Questions¶
What kind of preprocessing must I do if I have a feature with categories that have an order to them?
How many columns do I need for a binary feature?
What tool do we use to preprocess all our pipelines and build a model without breaking the golden rule?
Between
Pipeline()
andmake_pipeline()
, which one assigns names to the steps on our behalf?In text data, what are our features made up of?
6.3.1. Some lingering questions¶
How do I tune multiple hyperparameters at once?
What algorithm works well with our
spam
,non spam
problem?
6.4. Naive Bayes introduction - spam/non spam¶
Last lecture we saw this spam classification problem where we used CountVectorizer()
to vectorize the text into features and used an SVC
to classify each text message into either a class of spam
or non spam
.
\(X = \begin{bmatrix}\text{"URGENT!! You have been selected to receive a £900 prize reward!",}\\ \text{"Lol your always so convincing."}\\ \text{"Congrats! 1 year special cinema pass for 2 is yours. call<PHONE_NUMBER>5 now!"}\\ \end{bmatrix}\) and \(y = \begin{bmatrix}\text{spam} \\ \text{non spam} \\ \text{spam} \end{bmatrix}\)
6.5. Naive Bayes from scratch¶
Let’s do some naive Bayes calculations by hand🖐 🤚 .
Yes, there is going to be some math here but it’s going to be really helpful in understanding how this algorithm works!
Below we have a few texts and they are classed as either being spam or non spam.
df = pd.DataFrame({'X': [
"URGENT!! As a valued network customer you have been selected to receive a £900 prize reward!",
"Lol you are always so convincing.",
"Sauder has interesting courses.",
"URGENT! You have won a 1 week FREE membership in our £100000 prize Jackpot!",
"Had your mobile 11 months or more? U R entitled to Update to the latest colour mobiles with camera for Free!",
"Sauder has been interesting so far." ],
'y': ["spam", "non spam", "non spam", "spam", "spam", "non spam"]})
df
| X | y | |
|---|---|---|
| 0 | URGENT!! As a valued network customer you have... | spam |
| 1 | Lol you are always so convincing. | non spam |
| 2 | Sauder has interesting courses. | non spam |
| 3 | URGENT! You have won a 1 week FREE membership ... | spam |
| 4 | Had your mobile 11 months or more? U R entitle... | spam |
| 5 | Sauder has been interesting so far. | non spam |
We know that we need to encode categorical data and transform it to numeric data to use it with machine learning since categoric columns throw an error when we try to fit our model.
This sounds like a job for CountVectorizer()
since we have words that need to be converted into features!
Here we are going to set max_features=4
to make our calculations a little easier and stop_words='english'
so we are getting meaningful words as features and not stop words.
from sklearn.feature_extraction.text import CountVectorizer
count_vect = CountVectorizer(max_features = 4, stop_words='english')
data = count_vect.fit_transform(df['X'])
train_bow_df = pd.DataFrame(data.toarray(), columns=sorted(count_vect.vocabulary_), index=df['X'])
train_bow_df['target'] = df['y'].tolist()
train_bow_df
| free | prize | sauder | urgent | target | |
|---|---|---|---|---|---|
| X | |||||
| URGENT!! As a valued network customer you have been selected to receive a £900 prize reward! | 0 | 1 | 0 | 1 | spam |
| Lol you are always so convincing. | 0 | 0 | 0 | 0 | non spam |
| Sauder has interesting courses. | 0 | 0 | 1 | 0 | non spam |
| URGENT! You have won a 1 week FREE membership in our £100000 prize Jackpot! | 1 | 1 | 0 | 1 | spam |
| Had your mobile 11 months or more? U R entitled to Update to the latest colour mobiles with camera for Free! | 1 | 0 | 0 | 0 | spam |
| Sauder has been interesting so far. | 0 | 0 | 1 | 0 | non spam |
Suppose we are given 2 text messages in and we want to find the targets for these examples, how do we do it using naive Bayes?
First, let’s get a numeric representation of our text messages.
test_texts = ["URGENT! Free!!", "I like Sauder"]
data = count_vect.transform(test_texts).toarray()
test_bow_df = pd.DataFrame(data, columns=count_vect.vocabulary_, index=test_texts)
test_bow_df
| urgent | prize | sauder | free | |
|---|---|---|---|---|
| URGENT! Free!! | 1 | 0 | 0 | 1 |
| I like Sauder | 0 | 0 | 1 | 0 |
Let’s look at the text: “URGENT! Free!!”
Is this spam or non spam?
So what we want to know is:
We really only care which one of these is bigger and whichever probability is larger is how we can classify our sentence as spam or non spam.
Remember our Bayes’ Theorem is the following:
In this case:
\(X\) is the representation of the words in our text ie; \(\text{free} = 1, \text{prize} = 0, \text{sauder} = 0, \text{urgent} = 1\)
\(y\) is our target either spam or non spam
Substituting into Bayes rule we get:
Now, there are two reasons naive Bayes is so easy:
We can cancel out the denominator which leads us to this:
We can simplify the numerator
6.5.1. Naive Bayes’ approximation¶
We assume each feature (word) is conditionally independent. (Assume that all features in \(X\) are mutually independent, conditional on the target class.)
In general, $\(P(\text{message} \mid \text{spam}) = P(w_1, w_2, . . . , w_d \mid \text{spam}) \approx \prod_{i=1}^{d}P(w_i \mid \text{spam})\)$
That means simply:
And for the other class non spam:
So our equation has boiled down to is:
Now we just need to calculate each of those probabilities which is easy!
6.5.2. Estimating \(P(\text{spam} \mid \text{message})\) (The left side of our equation)¶
We need the following:
Prior probability: \(P(\text{spam})\)
Conditional probabilities:
\(P(\text{free} = 1 \mid \text{spam})\)
\(P(\text{prize} = 0 \mid \text{spam})\)
\(P(\text{sauder} = 0 \mid \text{spam})\)
\(P(\text{urgent} = 1 \mid \text{spam})\)
train_bow_df
| free | prize | sauder | urgent | target | |
|---|---|---|---|---|---|
| X | |||||
| URGENT!! As a valued network customer you have been selected to receive a £900 prize reward! | 0 | 1 | 0 | 1 | spam |
| Lol you are always so convincing. | 0 | 0 | 0 | 0 | non spam |
| Sauder has interesting courses. | 0 | 0 | 1 | 0 | non spam |
| URGENT! You have won a 1 week FREE membership in our £100000 prize Jackpot! | 1 | 1 | 0 | 1 | spam |
| Had your mobile 11 months or more? U R entitled to Update to the latest colour mobiles with camera for Free! | 1 | 0 | 0 | 0 | spam |
| Sauder has been interesting so far. | 0 | 0 | 1 | 0 | non spam |
Prior probability
\(P(\text{spam}) = 3/6\)
Conditional probabilities
What is \(P(\text{free} = 1 \mid \text{spam})\) ??
Given target is spam, how often “free”= 1? \(= 2/3\)
\(P(\text{prize} = 0 \mid \text{spam}) = 1/3\)
\(P(\text{sauder} = 0 \mid \text{spam}) = 3/3\)
\(P(\text{urgent} = 1 \mid \text{spam}) = 2/3\)
Now we have everything we need to do our calculations!
spam_prior = 3/6
sauder0_spam = 3/3
free1_spam = 2/3
prize0_spam = 1/3
urgent1_spam = 2/3
spam_prob = spam_prior * sauder0_spam * free1_spam * prize0_spam * urgent1_spam
spam_prob
0.07407407407407407
Ok, So we’ve done our left side! Now we have to do the right!
6.5.3. Estimating \(P(\text{non spam} \mid \text{message})\) (The right side of our equation)¶
Now we need the following:
Prior probability: \(P(\text{non spam})\)
Conditional probabilities:
\(P(\text{free} = 1 \mid \text{non spam})\)
\(P(\text{prize} = 0 \mid \text{non spam})\)
\(P(\text{sauder} = 0 \mid \text{non spam})\)
\(P(\text{urgent} = 1 \mid \text{non spam})\)
Again we use the data to calculate these probabilities.
train_bow_df
| free | prize | sauder | urgent | target | |
|---|---|---|---|---|---|
| X | |||||
| URGENT!! As a valued network customer you have been selected to receive a £900 prize reward! | 0 | 1 | 0 | 1 | spam |
| Lol you are always so convincing. | 0 | 0 | 0 | 0 | non spam |
| Sauder has interesting courses. | 0 | 0 | 1 | 0 | non spam |
| URGENT! You have won a 1 week FREE membership in our £100000 prize Jackpot! | 1 | 1 | 0 | 1 | spam |
| Had your mobile 11 months or more? U R entitled to Update to the latest colour mobiles with camera for Free! | 1 | 0 | 0 | 0 | spam |
| Sauder has been interesting so far. | 0 | 0 | 1 | 0 | non spam |
Prior probability
\(P(\text{non spam}) = 3/6\)
Conditional probabilities
What is \(P(\text{free} = 1 \mid \text{non spam})\) ?
Given the target is non spam, how ofter “free”=1? \(0/3\)
\(P(\text{prize} = 0 \mid \text{non spam}) = 3/3\)
\(P(\text{sauder} = 0 \mid \text{non spam}) =1/3\)
\(P(\text{urgent} = 1 \mid \text{non spam}) = 0/3\)
Time for our calculation:
non_spam_prior = 3/6
sauder0_non_spam = 0/3
free1_non_spam = 1/3
prize0_non_spam = 1/3
urgent1_non_spam = 2/3
non_spam_prob = non_spam_prior * sauder0_non_spam * free1_non_spam * prize0_non_spam * urgent1_non_spam
non_spam_prob
0.0
so our equation:
has been calculated to
0.07407407407407407 > 0.0
Since our left side is greater than the right side, our text is classified as spam!
We could normalize this result and say 100% spam and 0% non spam so that the probabilities add up to 100%.
Now let’s verify our result using sklearn.
6.6. Naive Bayes classifier¶
The main Naive Bayes classifier in sklearn is called MultinomialNB
and exists in the naive_bayes
module.
from sklearn.naive_bayes import MultinomialNB
train_bow_df
| free | prize | sauder | urgent | target | |
|---|---|---|---|---|---|
| X | |||||
| URGENT!! As a valued network customer you have been selected to receive a £900 prize reward! | 0 | 1 | 0 | 1 | spam |
| Lol you are always so convincing. | 0 | 0 | 0 | 0 | non spam |
| Sauder has interesting courses. | 0 | 0 | 1 | 0 | non spam |
| URGENT! You have won a 1 week FREE membership in our £100000 prize Jackpot! | 1 | 1 | 0 | 1 | spam |
| Had your mobile 11 months or more? U R entitled to Update to the latest colour mobiles with camera for Free! | 1 | 0 | 0 | 0 | spam |
| Sauder has been interesting so far. | 0 | 0 | 1 | 0 | non spam |
Let’s split up our data into our features and targets:
X_train = train_bow_df.drop(columns='target')
y_train = train_bow_df['target']
Here I am selecting the first row of our test set which was the URGENT! Free!! text.
test_bow_df.iloc[[0]]
| urgent | prize | sauder | free | |
|---|---|---|---|---|
| URGENT! Free!! | 1 | 0 | 0 | 1 |
Here we get a prediction of spam:
nb = MultinomialNB(alpha=0)
nb.fit(X_train, y_train)
nb.predict(test_bow_df.iloc[[0]])
/usr/local/lib/python3.8/site-packages/sklearn/naive_bayes.py:511: UserWarning: alpha too small will result in numeric errors, setting alpha = 1.0e-10
warnings.warn('alpha too small will result in numeric errors, '
array(['spam'], dtype='<U8')
Instead of using predict
, we can use something called predict_proba()
with Naive Bayes classifier which gives us the probabilities of each class happening.
predict
returns the class with the highest probability.predict_proba
gives us the actual probability scores.Looking at the probabilities can help us understand the model.
We will look more into this in Lecture 7.
prediction = nb.predict_proba(test_bow_df.iloc[[0]])
pd.DataFrame(data =prediction,columns = nb.classes_)
| non spam | spam | |
|---|---|---|
| 0 | 2.250000e-20 | 1.0 |
We get the same probabilities as we did it by hand.
(Ok 2.250000e-20 is essentially 0 but due to computing and storage, python specifies this 0 as an extremely small number.)
What about this warning we see?
‘alpha too small will result in numeric errors’
Well, let’s look at our conditional probabilities again from the right side of our equation.
Conditional probabilities
\(P(\text{free} = 1 \mid \text{non spam}) = 0/3\)
\(P(\text{prize} = 0 \mid \text{non spam}) = 3/3\)
\(P(\text{sauder} = 0 \mid \text{non spam}) = 1/3\)
\(P(\text{urgent} = 1 \mid \text{non spam}) = 0/3\)
Is it wise to say that given a text that is non spam the probability of free occurring is 0?
Not really. We only are using 6 examples here and setting this to 0 (and \(P(\text{urgent} = 1 \mid \text{non spam}) = 0\)) is making the whole right side of the equation equal to 0.
Naive Bayes naively multiplies all the feature likelihoods together, and if any of the terms is zero, it’s going to void all other evidence and the probability of the class is going to be zero.
This is somewhat problematic.
We have limited data and if we do not see a feature occurring with a class, it doesn’t mean it would never occur with that class.
How can we fix this?
6.6.1. A simple solution: Laplace smoothing¶
The simplest way to avoid zero probabilities is to add a value(\(\alpha\)) to all the counts. This is called Laplace smoothing
Generally, we set alpha (\(\alpha\)) equal to 1 and in scikit-learn
we control it using hyperparameter alpha
.
This means that we give an instance of every word appearing once with a target of spam, as well as a target of non spam.
By default alpha=1.0
in scikit-learn
.
Let’s see what our probabilities are now using alpha=1.
nb = MultinomialNB(alpha=1)
nb.fit(X_train, y_train)
pd.DataFrame(data = nb.predict_proba(test_bow_df.iloc[[0]]),
columns = nb.classes_)
| non spam | spam | |
|---|---|---|
| 0 | 0.235849 | 0.764151 |
A bit smoother now, wouldn’t you say?
6.6.2. alpha
hyperparameter and the fundamental tradeoff¶
High alpha \(\rightarrow\) underfitting
means we are adding large counts to everything and so we are diluting the data
Low alpha \(\rightarrow\) overfitting
6.7. Naive Bayes on Real Data¶
let’s try scikit-learn
’s implementation of Naive Bayes on a modified version of Kaggle’s Disaster Tweets.
tweets_df = pd.read_csv("data/tweets_mod.csv")
tweets_df
| text | target | |
|---|---|---|
| 0 | YOU THERE, PACHIRISU PUNK, PREPARE TO BE DESTR... | 0 |
| 1 | Face absolutely flattened against the glass of... | 0 |
| 2 | Bruhhhh I screamed when she said that 😭 MY HEA... | 0 |
| 3 | Granting warrants to "authorise police to ente... | 0 |
| 4 | Ang lala hahaha I woke up to a deluge of death... | 0 |
| ... | ... | ... |
| 3995 | As it seems to be fairly contagious, I'm think... | 1 |
| 3996 | #BoundBrookFire Firefighters from several diff... | 1 |
| 3997 | It is turning out to be a very violent storm a... | 1 |
| 3998 | A raging fire in Bound Brook, New Jersey, on S... | 1 |
| 3999 | Hazardous eruption a possibility after Philipp... | 1 |
4000 rows × 2 columns
Let’s split it into our training and test sets as well as our features and target objects.
train_df, test_df = train_test_split(tweets_df, test_size=0.2, random_state=123)
X_train, y_train = train_df["text"], train_df["target"]
X_test, y_test = test_df["text"], test_df["target"]
train_df.head()
| text | target | |
|---|---|---|
| 1420 | How low have you sunk Alice, just clickbait fo... | 0 |
| 1638 | Watching this tonight as I was working yesterd... | 0 |
| 616 | January 14, 2020 at about 08:30 am, personnel ... | 0 |
| 184 | Next oil spill you drone strike the CEO's neig... | 0 |
| 2075 | Another 6.0 aftershock has hit Puerto Rico aft... | 1 |
Next, we make a pipeline and cross-validate!
pipe_nb = make_pipeline(CountVectorizer(), MultinomialNB(alpha=1))
scores = cross_validate(pipe_nb, X_train, y_train, return_train_score=True)
pd.DataFrame(scores)
| fit_time | score_time | test_score | train_score | |
|---|---|---|---|---|
| 0 | 0.091117 | 0.017300 | 0.796875 | 0.948438 |
| 1 | 0.076795 | 0.015993 | 0.801562 | 0.948438 |
| 2 | 0.071020 | 0.015681 | 0.801562 | 0.946875 |
| 3 | 0.070094 | 0.013736 | 0.837500 | 0.945703 |
| 4 | 0.076934 | 0.014068 | 0.814063 | 0.944531 |
pd.DataFrame(scores).mean()
fit_time 0.077192
score_time 0.015356
test_score 0.810312
train_score 0.946797
dtype: float64
6.8. Let’s Practice¶
Using naive Bayes by hand, what class would naive Bayes predict for the second example “I like Sauder”.
train_bow_df
| free | prize | sauder | urgent | target | |
|---|---|---|---|---|---|
| X | |||||
| URGENT!! As a valued network customer you have been selected to receive a £900 prize reward! | 0 | 1 | 0 | 1 | spam |
| Lol you are always so convincing. | 0 | 0 | 0 | 0 | non spam |
| Sauder has interesting courses. | 0 | 0 | 1 | 0 | non spam |
| URGENT! You have won a 1 week FREE membership in our £100000 prize Jackpot! | 1 | 1 | 0 | 1 | spam |
| Had your mobile 11 months or more? U R entitled to Update to the latest colour mobiles with camera for Free! | 1 | 0 | 0 | 0 | spam |
| Sauder has been interesting so far. | 0 | 0 | 1 | 0 | non spam |
test_bow_df.iloc[[1]]
| urgent | prize | sauder | free | |
|---|---|---|---|---|
| I like Sauder | 0 | 0 | 1 | 0 |
Let’s do some of the steps here:
spam side
1. Prior probability:
\(P(\text{spam}) = \)
2. Conditional probabilities:
2.1 \(P(\text{free} = 0 \mid \text{spam}) = \)
2.2 \(P(\text{prize} = 0 \mid \text{spam}) = \)
2.3 \(P(\text{sauder} = 1 \mid \text{spam}) = \)
2.4 \(P(\text{urgent} = 0 \mid \text{spam}) = \)
3. \(P(\textrm{spam}|\text{free} = 0, \text{prize} = 0, \text{sauder} = 1, \text{urgent} = 0) = \)
non spam side
4. Prior probability:
\(P(\text{non spam}) = \)
5. Conditional probabilities:
5.1 \(P(\text{free} = 0 \mid \text{non spam}) = \)
5.2 \(P(\text{prize} = 0 \mid \text{non spam}) = \)
5.3 \(P(\text{sauder} = 1 \mid \text{non spam}) = \)
5.4 \(P(\text{urgent} = 0 \mid \text{non spam}) = \)
6. \(P(\textrm{non spam}|\text{free} = 0, \text{prize} = 0, \text{sauder} = 1, \text{urgent} = 0) =\)
Final Class
7. CLASS AS:
Solutions!
1/. \(3/6\)
2.1 \(1/3\)
2.2 \(1/3\)
2.3 \(0/3\)
2.4 \(1/3\)
3. \(\frac{1}{3} * \frac{1}{3}* \frac{0}{3} * \frac{1}{3} *\frac{3}{6} = 0\)
4. \(3/6\)
5.1 \(3/3\)
5.2 \(3/3\)
5.3 \(2/3\)
5.4 \(3/3\)
6. \(\frac{3}{3} * \frac{3}{3}* \frac{2}{3} * \frac{3}{3} *\frac{3}{6} = 1/3\)
7. Non spam
6.9. Automated Hyperparameter Optimization¶
We’ve seen quite a few different hyperparameters for different models.
We’ve seen max_depth
and min_samples_split
for decision trees.
We’ve seen n_neighbors
and weights
for K-Nearest Neighbours and we’ve seen gamma
and C
for SVMs with RBF.
We’ve even seen hyperparameters for our transformations like strategy
for our SimpleImputer()
.
They are important and we’ve seen they can really help optimize your model, but we’ve also seen how difficult it can be to figure out how to set them.
6.9.1. The problem with hyperparameters¶
We may have a lot of them. (deep learning!)
Picking reasonable hyperparameters is important -> it helps avoid underfit or overfit models.
Nobody knows exactly how to choose them.
May interact with each other in unexpected ways.
The best settings depend on the specific data/problem.
Can take a long time to execute.
6.9.2. How to pick hyperparameters¶
Manual hyperparameter optimization (What we’ve done so far)
We may have some intuition about what might work.
It takes a lot of work.
OR…
Automated hyperparameter optimization (hyperparameter tuning)
Reduce human effort.
Less prone to error.
Data-driven approaches may be effective.
It may be hard to incorporate intuition.
Overfitting on the validation set.
6.9.3. Automated hyperparameter optimization¶
Exhaustive grid search:
sklearn.model_selection.GridSearchCV
Randomized hyperparameter optimization:
sklearn.model_selection.RandomizedSearchCV
6.9.4. Let’s Apply it¶
Let’s bring back the cities dataset we worked with in previous lectures.
cities_df = pd.read_csv("data/canada_usa_cities.csv")
train_df, test_df = train_test_split(cities_df, test_size=0.2, random_state=123)
X_train, y_train = train_df.drop(columns=['country']), train_df['country']
X_test, y_test = test_df.drop(columns=['country']), test_df['country']
X_train.head()
| longitude | latitude | |
|---|---|---|
| 160 | -76.4813 | 44.2307 |
| 127 | -81.2496 | 42.9837 |
| 169 | -66.0580 | 45.2788 |
| 188 | -73.2533 | 45.3057 |
| 187 | -67.9245 | 47.1652 |
6.10. Exhaustive grid search - Trying ALL the options¶
We import GridSearchCV
from sklearn.model_selection
from sklearn.model_selection import GridSearchCV
We need to first decide on our model and which hyperparameters we want to tune.
We are going to use an SVC classifier.
After that, we built a dictionary called param_grid
and we specify the values we wish to look over for the hyperparameter.
param_grid = {"gamma": [0.1, 1.0, 10, 100]}
Then we initiate our model:
svc = SVC()
grid_search = GridSearchCV(svc, param_grid, verbose=2)
Assigning verbose
tells GridSearchCV
to print some output while it’s running.
grid_search.fit(X_train, y_train)
Fitting 5 folds for each of 4 candidates, totalling 20 fits
[CV] gamma=0.1 .......................................................
[CV] ........................................ gamma=0.1, total= 0.0s
[CV] gamma=0.1 .......................................................
[CV] ........................................ gamma=0.1, total= 0.0s
[CV] gamma=0.1 .......................................................
[CV] ........................................ gamma=0.1, total= 0.0s
[CV] gamma=0.1 .......................................................
[CV] ........................................ gamma=0.1, total= 0.0s
[CV] gamma=0.1 .......................................................
[CV] ........................................ gamma=0.1, total= 0.0s
[CV] gamma=1.0 .......................................................
[CV] ........................................ gamma=1.0, total= 0.0s
[CV] gamma=1.0 .......................................................
[CV] ........................................ gamma=1.0, total= 0.0s
[CV] gamma=1.0 .......................................................
[CV] ........................................ gamma=1.0, total= 0.0s
[CV] gamma=1.0 .......................................................
[CV] ........................................ gamma=1.0, total= 0.0s
[CV] gamma=1.0 .......................................................
[CV] ........................................ gamma=1.0, total= 0.0s
[CV] gamma=10 ........................................................
[CV] ......................................... gamma=10, total= 0.0s
[CV] gamma=10 ........................................................
[CV] ......................................... gamma=10, total= 0.0s
[CV] gamma=10 ........................................................
[CV] ......................................... gamma=10, total= 0.0s
[CV] gamma=10 ........................................................
[CV] ......................................... gamma=10, total= 0.0s
[CV] gamma=10 ........................................................
[CV] ......................................... gamma=10, total= 0.0s
[CV] gamma=100 .......................................................
[CV] ........................................ gamma=100, total= 0.0s
[CV] gamma=100 .......................................................
[CV] ........................................ gamma=100, total= 0.0s
[CV] gamma=100 .......................................................
[CV] ........................................ gamma=100, total= 0.0s
[CV] gamma=100 .......................................................
[CV] ........................................ gamma=100, total= 0.0s
[CV] gamma=100 .......................................................
[CV] ........................................ gamma=100, total= 0.0s
[Parallel(n_jobs=1)]: Using backend SequentialBackend with 1 concurrent workers.
[Parallel(n_jobs=1)]: Done 1 out of 1 | elapsed: 0.0s remaining: 0.0s
[Parallel(n_jobs=1)]: Done 20 out of 20 | elapsed: 0.1s finished
GridSearchCV(estimator=SVC(), param_grid={'gamma': [0.1, 1.0, 10, 100]},
verbose=2)
The nice thing about this is we can do this for multiple hyperparameters simultaneously as well.
param_grid = {
"gamma": [0.1, 1.0, 10, 100],
"C": [0.1, 1.0, 10, 100]
}
svc = SVC()
grid_search = GridSearchCV(svc, param_grid, cv= 5, verbose=2, n_jobs=-1)
grid_search.fit(X_train, y_train)
Fitting 5 folds for each of 16 candidates, totalling 80 fits
[Parallel(n_jobs=-1)]: Using backend LokyBackend with 8 concurrent workers.
[Parallel(n_jobs=-1)]: Done 25 tasks | elapsed: 2.4s
[Parallel(n_jobs=-1)]: Done 80 out of 80 | elapsed: 2.6s finished
GridSearchCV(cv=5, estimator=SVC(), n_jobs=-1,
param_grid={'C': [0.1, 1.0, 10, 100],
'gamma': [0.1, 1.0, 10, 100]},
verbose=2)
The grid in GridSearchCV
stands for the way that it’s checking the hyperparameters.
Since there 4 options for each, grid search is checking every value in each hyperparameter to one another.
That means it’s checking 4 x 4 = 16 different combinations of hyperparameter values for the model.
In GridSearchCV
we can specify the number of folds of cross-validation with the argument cv
.
Since we are specifying cv=5
that means that fit is called a total of 80 times (16 different combinations x 5 cross-validation folds).
Something new we’ve added here is n_jobs=-1
.
This is a little more complex.
Setting this to -1 helps make this process faster by running hyperparameter optimization in parallel instead of in a sequence.
6.10.1. Implement with Pipelines¶
pipe = Pipeline(
steps=[
("imputer", SimpleImputer(strategy="median")),
("scaler", StandardScaler()),
("clf", SVC())])
After specifying the steps in a pipeline, a user must specify a set of values for each hyperparameter in param_grid
as we did before but this time we specify the name of the step followed by two underscores __
and the name of the hyperparameter.
This is because the pipeline would not know which hyperparameter goes with each step. Does gamma
correspond to the hyperparameter in SimpleImputer()
or StandardScaler()
?
This now gives the pipeline clear instructions on which hyperparameters correspond with which step.
param_grid = {
"clf__gamma": [0.1, 1.0, 10, 100],
"clf__C": [0.1, 1.0, 10, 100]
}
Notice that we named our steps in the pipeline, so clf
corresponds to the model initialization of the SVM classifier.
If we used make_pipeline()
remember that the function names the steps by default the lower case name of each transformation or model.
pipe = make_pipeline(SimpleImputer(strategy="median"),
StandardScaler(),
SVC())
pipe
Pipeline(steps=[('simpleimputer', SimpleImputer(strategy='median')),
('standardscaler', StandardScaler()), ('svc', SVC())])
param_grid = {
"svc__gamma": [0.1, 1.0, 10, 100],
"svc__C": [0.1, 1.0, 10, 100]
}
Now when we initiate GridSearchCV
, we set the first argument to the pipeline name instead of the model name this time.
grid_search = GridSearchCV(pipe, param_grid, cv=5, return_train_score=True, verbose=2, n_jobs=-1)
grid_search.fit(X_train, y_train);
Fitting 5 folds for each of 16 candidates, totalling 80 fits
[Parallel(n_jobs=-1)]: Using backend LokyBackend with 8 concurrent workers.
[Parallel(n_jobs=-1)]: Done 25 tasks | elapsed: 2.2s
[Parallel(n_jobs=-1)]: Done 80 out of 80 | elapsed: 2.6s finished
Looking a bit closer these are the steps being performed with GridSearchCV
.
for gamma in [0.1, 1.0, 10, 100]:
for C in [0.1, 1.0, 10, 100]:
for fold in folds:
fit in training portion with the given C and gamma
score on validation portion
compute average score
pick hyperparameters with the best score
In this case, we can see from the output that 80 executions are done, just like we calculated (4 x 4 x 5 = 80).
6.10.2. Why a grid?¶
If we fix C
with a value of 1 and loop over the values of 1, 10 and 100 for gamma
.
This results in 100
having the best score with 0.82.
Next, we fix gamma
at 100
since that was what we found was the most optimal when C
was equal to 1.
When we loop over the values of 1, 10 and 100 for C
we get the most optimal value to be 10.
So naturally, we would pick the values 100
for gamma
and 10
for C
.
HOWEVER - if we had performed every possible combination, we would have seen that the optimal values would have actually been 10
for both gamma
and C
.
The same thing is shown if we did it the other way around, first fixing gamma
at a value of 1 and then looping over all possible values of C
.
This time the most optimal combination is gamma
equal to 1 and C
equal to 100 which is again not the optimal value of 10 for each.
This is why it is so important not to fix either of the hyperparameters since it won’t necessarily help you find the most optimal values.
6.10.3. Now what?¶
How do we know what the best hyperparameter values are after fitting?
We can extract the best hyperparameter values with .best_params_
and their corresponding score with .best_score_
.
grid_search.best_params_
{'svc__C': 10, 'svc__gamma': 1.0}
grid_search.best_score_
0.8208556149732621
We can extract the optimal classifier inside with .best_estimator_
.
best_model = grid_search.best_estimator_
This has already been fully fitted on with all the data and not just a portion from cross-validation so all we need to do is score!
best_model.score(X_train, y_train)
0.8502994011976048
best_model.score(X_test, y_test)
0.8333333333333334
We can either save it as a new model and fit and score on this new one or we can use the grid_search
object directly and it will by default score using the optimal model.
These both give the same results.
grid_search.score(X_train, y_train)
0.8502994011976048
grid_search.score(X_test, y_test)
0.8333333333333334
The same can be done for .predict()
as well, either using the saved model or using the grid_search
object directly.
best_model.predict(X_test)
array(['Canada', 'Canada', 'Canada', 'Canada', 'Canada', 'Canada',
'Canada', 'Canada', 'Canada', 'USA', 'USA', 'Canada', 'Canada',
'Canada', 'Canada', 'USA', 'Canada', 'USA', 'Canada', 'Canada',
'Canada', 'Canada', 'Canada', 'Canada', 'Canada', 'Canada',
'Canada', 'Canada', 'Canada', 'Canada', 'Canada', 'USA', 'Canada',
'Canada', 'Canada', 'Canada', 'Canada', 'USA', 'USA', 'Canada',
'Canada', 'Canada'], dtype=object)
grid_search.predict(X_test)
array(['Canada', 'Canada', 'Canada', 'Canada', 'Canada', 'Canada',
'Canada', 'Canada', 'Canada', 'USA', 'USA', 'Canada', 'Canada',
'Canada', 'Canada', 'USA', 'Canada', 'USA', 'Canada', 'Canada',
'Canada', 'Canada', 'Canada', 'Canada', 'Canada', 'Canada',
'Canada', 'Canada', 'Canada', 'Canada', 'Canada', 'USA', 'Canada',
'Canada', 'Canada', 'Canada', 'Canada', 'USA', 'USA', 'Canada',
'Canada', 'Canada'], dtype=object)
6.10.4. Notice any problems?¶
This seems pretty nice and obeys the golden rule however the new problem is the execution time.
Think about how much time it would take if we had 5 hyperparameters each with 10 different values.
That would mean we would be needing to call cross_validate()
100,000 times!
Exhaustive search may become infeasible fairly quickly.
Enter randomized hyperparameter search!
6.10.5. Randomized hyperparameter optimization¶
from sklearn.model_selection import RandomizedSearchCV
param_grid = {
"svc__gamma": [0.1, 1.0, 10, 100],
"svc__C": [0.1, 1.0, 10, 100]
}
random_search = RandomizedSearchCV(pipe, param_grid, cv=5, verbose=2, n_jobs=-1, n_iter=10)
random_search.fit(X_train, y_train);
Fitting 5 folds for each of 10 candidates, totalling 50 fits
[Parallel(n_jobs=-1)]: Using backend LokyBackend with 8 concurrent workers.
[Parallel(n_jobs=-1)]: Done 50 out of 50 | elapsed: 0.3s finished
Notice that we use the same arguments in RandomizedSearchCV()
as in GridSearchCV()
however with 1 new addition - n_iter
.
This argument gives us more control and lets us restrict how many candidates are searched over.
GridSearchCV()
conducts cross_validate()
on every single possible combination of the hyperparameters specified in param_grid
.
Now we can change that and control that using n_iter
which will pick a random subset containing the specified number of combinations.
The last time when we used exhaustive grid search, we had 80 fits (4 x 4 x 5).
This time we see only 50 fits (10 combinations instead of 16 and 5 folds)!
6.10.6. Continuous values for hyperparameter tuning - optional¶
For randomized grid search we can search over a range of continuous values instead of discrete values like in GridSearchCV()
.
We can specify a range of values instead of a list of values for each hyperparameter.
import scipy
param_grid = {
"svc__C": scipy.stats.uniform(0, 100),
"svc__gamma": scipy.stats.uniform(0, 100)}
random_gs = RandomizedSearchCV(pipe, param_grid, n_jobs=-1, cv=10, return_train_score=True, n_iter=10)
random_gs.fit(X_train, y_train);
random_gs.best_params_
{'svc__C': 30.962086187979253, 'svc__gamma': 17.526459755968204}
random_gs.best_score_
0.7452205882352942
random_gs.score(X_test, y_test)
0.7142857142857143
How differently does exhaustive and random search score?
grid_search.score(X_test, y_test)
0.8333333333333334
random_search.score(X_test, y_test)
0.8333333333333334
Here, (and often) they produce similar scores.
6.11. The problem with hyperparameter tuning - overfitting the validation set¶
Since we are repeating cross-validation over and over again, it’s not necessarily unseen data anymore.
This may produce overly optimistic results.
If our dataset is small and if our validation set is hit too many times, we suffer from optimization bias or overfitting the validation set.
6.11.1. Example: overfitting the validation set¶
Attribution: Mark Scmidt
This exercise helps explain the concept of overfitting on the validation set.
Consider a multiple-choice (a,b,c,d) “test” with 10 questions:
If you choose answers randomly, the expected grade is 25% (no bias).
If you fill out two tests randomly and pick the best, the expected grade is 33%.
overfitting ~8%.
If you take the best among 10 random tests, the expected grade is ~47%.
If you take the best among 100, the expected grade is ~62%.
If you take the best among 1000, the expected grade is ~73%.
You have so many “chances” that you expect to do well.
But on new questions, the “random choice” accuracy is still 25%.
# Code attributed to Rodolfo Lourenzutti
number_tests = [1, 2, 10, 100, 1000]
for ntests in number_tests:
y = np.zeros(10000)
for i in range(10000):
y[i] = np.max(np.random.binomial(10.0, 0.25, ntests))
print(
"The expected grade among the best of %d tests is : %0.2f"
% (ntests, np.mean(y) / 10.0)
)
The expected grade among the best of 1 tests is : 0.25
The expected grade among the best of 2 tests is : 0.33
The expected grade among the best of 10 tests is : 0.47
The expected grade among the best of 100 tests is : 0.62
The expected grade among the best of 1000 tests is : 0.74
If we instead used a 100-question test then:
Expected grade from best over 1 randomly-filled tests is 25%.
Expected grade from best over 2 randomly-filled tests is ~27%.
Expected grade from best over 10 randomly-filled tests is ~32%.
Expected grade from best over 100 randomly-filled tests is ~36%.
Expected grade from best over 1000 randomly-filled tests is ~40%.
# Code attributed to Rodolfo Lourenzutti
number_tests = [1, 2, 10, 100, 1000]
for ntests in number_tests:
y = np.zeros(10000)
for i in range(10000):
y[i] = np.max(np.random.binomial(100.0, 0.25, ntests))
print(
"The expected grade among the best of %d tests is : %0.2f"
% (ntests, np.mean(y) / 100.0)
)
The expected grade among the best of 1 tests is : 0.25
The expected grade among the best of 2 tests is : 0.27
The expected grade among the best of 10 tests is : 0.32
The expected grade among the best of 100 tests is : 0.36
The expected grade among the best of 1000 tests is : 0.40
The optimization bias grows with the number of things we try.
But, optimization bias shrinks quickly with the number of examples.
But it’s still non-zero and growing if you over-use your validation set!
Essentially our odds of doing well on a multiple-choice exam (if we are guessing) increases the more times we can repeat and randomly take the exam again.
Because we have so many chances you’ll eventually do well and perhaps this is not representative of your knowledge (remember you are randomly guessing)
The same occurs with selecting hyperparameters.
The more hyperparameters values and combinations we try, the more likely we will randomly get a better scoring model by chance and not because the model represents the data well.
This overfitting can be decreased somewhat by increasing the number of questions or in our case, the number of examples we have.
TLDR: If your test score is lower than your validation score, it may be because did so much hyperparameter optimization that you got lucky and the bigger data set that you have, the better.
6.12. Let’s Practice¶
1. Which method will attempt to find the optimal hyperparameter for the data by searching every combination possible of hyperparameter values given?
2. Which method gives you fine-grained control over the amount of time spent searching?
3. If I want to search for the most optimal hyperparameter values among 3 different hyperparameters each with 3 different values how many trials of cross-validation would be needed?
\(x= [1,2,3]\)
\(y= [4,5,6]\)
\(z= [7,8,9]\)
True or False
4. A Larger n_iter
will take longer but will search over more hyperparameter values.
5. Automated hyperparameter optimization can only be used for multiple hyperparameters.
Solutions!
Exhaustive Grid Search (
GridSearchCV
)Randomized Grid Search (
RandomizedSearchCV
)\(3 * 3 * 3 = 27\)
True
False
6.13. Let’s Practice - Coding¶
We are going to practice grid search using our basketball dataset that we have seen before.
# Loading in the data
bball_df = pd.read_csv('data/bball.csv')
bball_df = bball_df[(bball_df['position'] =='G') | (bball_df['position'] =='F')]
# Define X and y
X = bball_df.loc[:, ['height', 'weight', 'salary']]
y = bball_df['position']
# Split the dataset
X_train, X_test, y_train, y_test = train_test_split(
X, y, test_size=0.2, random_state=7)
bb_pipe = Pipeline(
steps=[("imputer", SimpleImputer(strategy="median")),
("scaler", StandardScaler()),
("knn", KNeighborsClassifier())])
Using the pipeline
bb_pipe
provided, create a grid of parameters to search overparam_grid
. Search over the values 1, 5, 10, 20, 30, 40, and 50 for the hyperparametern_neighbors
and ‘uniform’ and ‘distance’ for the hyperparameterweights
(make sure to call them appropriately).Use
GridSearchCV
to hyperparameter tune using cross-validate equal to 10 folds. Make sure to specify the argumentsverbose=2
andn_jobs=-1
.Train your pipeline with grid search.
Find the best hyperparameter values. Make sure to print these results.
Lastly, score your model on the test set.
6.14. What We’ve Learned Today¶
How to predict by using naive Bayes.
How to use
scikit-learn
’sMultiNomialNB
.What
predict_proba
is.Why we need smoothing in naive Bayes.
How to carry out hyperparameter optimization using
sklearn
’sGridSearchCV
andRandomizedSearchCV
.


Other projects and interests
I am a geek in more ways than an interest in tech and maths and have a series of side interests and projects over which I can frequently be found talking enthusiastically about.
-
I am quite passionate about music despite no longer playing or composing anything and have a ridiculous large and diverse collection. I like going to concerts and gigs. I have the vinyl eccentricity, particularly classic and jazz LPs, but am completely dependent on the iPod, iTunes & mp3 variants. I endorse DRM free music. I have a bamboo-type flute which broke in a joint and which I plan to mend in the near future: I would welcome suggestions on how best to glue the two parts together and play it.
-
I like travelling and take any opportunity presented to me gladly. I find the idea of documenting (for myself) the places I have been to interesting but I don't seem to have saved many records so far.
-
I am bisexual and ended up in a position in 2006 where I found myself being the birth mother of the bisexual community and representation in Portugal. I am, among other things, the creator and admin of a national webpage, .bi and national mailing list, BiPortugal. I organise monthly local social meetings and occasional workshops in Porto and Braga and often represent the community in diverse situations. I jokingly say that I am also the one that pokes the LGBT community and activism to consider the B in LGBT.
I am frequently asked about the nature of these resources and events and my position in them. It has always been my intent that they are seen as independent initiatives and to downplay my role to a more shadowy support position. Contrary to what is often the case in Portugal, I did not wish to create a formal society or organisation nor have a role of a "president" because I wanted a sense of community and representation to emerge. I wanted to ease and encourage others to come forth to whom I could offer my vast experience and connections as support. On the other hand, it was always my plan to move again out of Portugal one or two years after and any of these initiatives would need to be able to continue without me being present and active. I am very happy to see that they are starting to walk on their own feet.


Exploring a Sentiment Classifier
Or, run your own with examples/glue_demo.py
How well does a sentiment classifier handle negation? We can use LIT to interactively ask this question and get answers. We loaded up LIT the development set of the Stanford Sentiment Treebank (SST), which contains sentences from movie reviews that have been human-labeled as having a negative sentiment (0), or a positive sentiment (1). For a model, we are using a BERT-based binary classifier that has been trained to classify sentiment.
Using the search function in LIT’s data table, we find the 67 datapoints containing the word “not”. By selecting these datapoints and looking at the Metrics Table, we find that our BERT model gets 91% of these correct, which is slightly higher than the accuracy across the entire dataset.
But we might want to know if this is truly robust. We can select individual datapoints and look for explanations. For example, take the negative review, “It’s not the ultimate depression-era gangster movie.”. As shown below, salience maps suggest that “not” and “ultimate” are important to the prediction. We can verify this by creating modified inputs, using LIT’s datapoint editor. Removing “not” gets a strongly positive prediction from “It’s the ultimate depression-era gangster movie.”.
Using the LIT features of data table searching, the metrics table, salience maps, and manual editing, we’re able to show both in aggregate and in a specific instance, that our model handles negation correctly.


SAFE is a new stablecoin that is fully collateralized by USDT, and similar to REX, can only increase in value.
The SAFE smart-contract is open-source, decentralized, and immutable. It has no keys and can only be ammended with a 15/21 producing BP consensus. SAFE combining these features gives it the highest level of security available on EOSIO.
SAFE is minted by sending USDT to the SAFE contract. There is a 5% fee for minting SAFE. 1% will be used to automatically buyback and burn SVX and 4% goes to all SAFE holders equally and instantly. This is done by using the fee to increase the amount of USDT each SAFE is collateralized by, and redeemable for whenever SAFE is minted.
When minting SAFE, the newly minted tokens are also instantly increased in value. Because of this, you always earn back part of your minting fee and it is possible to pay a minting fee as low as 1% (depending on the current SAFE supply and the amount that you mint).
SAFE is converted back to USDT by sending it to the SAFE smart-contract. The SAFE smart-contract will then destroy the received SAFE tokens and send the value in USDT to your account. There are no fees to convert SAFE to USDT.
SAFE is the official stable coin of SOVDEX and will be tradeable in additional markets offering yield farming soon. SAFE minters will also mine SVX as a bonus. The reward is dynamic and will increase and decrease according to minting activity.


In journalism, burying the lead describes the error of putting the key idea of your story somewhere in the middle. Traditionally it was spelled lede, not lead, to distinguish it from the material used for casting metal type.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus volutpat vulputate mattis. Nulla gravida erat ac tincidunt porta. Nullam at malesuada nibh. Proin consequat, leo non hendrerit malesuada, mauris urna commodo nisi, et feugiat nulla mi vel nisi.


Dive deep into your facebook account by visualising it in 3D. Use your mouse to look around and click to fly trough the data. quality: medium | high No support for 3d graphics on this browser, try the latest Chrome or Firefox.
- Log in
- Example data
- More info


Here’s a time server implementation that you can know by heart:
time_server_channel = Cod.tcp_server('<IP_ADDRESS>:4444')
loop do
request, client_channel = time_server_channel.get_ext
case request
when :time
client_channel.put Time.now
when :date
client_channel.put Date.today
else
client_channel.put 'Unknown request!'
end
client_channel.close
end
Here’s the client:
time_chan = Cod.tcp('<IP_ADDRESS>:4444')
time = time_chan.interact(:time)
puts "At the next clock cycle, it is #{time}."
Some.
Here’s the who’s who of the cod universe. This is what you see in the navigation bar as well.
Here, have some YARD documentation as a side dish.
Don’t read the source code. There, I’ve warned you.
Please:
Remember: I test my code, so you should too. Please include relevant rspec tests in all pull requests.
Thanks to all contributors!
cod and associated products (this website) are under an MIT license (see LICENSE file). The cod image is copyright by the Norwegian Institute of Marine Research – thanks for letting us use it!
Need help with some hairy Ruby problems? Maybe an astronaut can show you how to get to safe ground.


Hello, {{name}}!
Fast just got faster with Nexus S.
Total number of phones: 3 {{phones.length}}
The Next, Next Generation tablet.


--- layout: default title: Mergers & Acquisitions ---
This podcast is just like any other: where I say stuff that interest me, and might interest you.
It's mostly science and technology, but there is some other stuff in there, like other podcasts that I listen to, and mini-episodes (sometimes about the weather).


menu
home
power_settings_new
Mobile
home
power_settings_new
Mobile
Meals
Add Meal
Select category
Category:
Name:
Select Type:
Bronze
Silver
Gold
Custom
Type:
Price:
Add
add
All Meals
Name
Type
Available
Price
Added On
Actions
Loading...


© 2019
| axillariflorus axillariflora axillariflorum | leaves in the axil | |||
| axilla | axill | noun/f | armpit | |
| arius | ari | adj | adjective suffix for nouns or numbers: connected to or possessed by | |
| florus | flor | ppar | floreo to bloom, to flower | |
| axillaris axillaris axillare | in leaf axils | |||
| axilla | axill | noun/f | armpit | |
| aris | ar | adj | alis adjective suffix for nouns: of or pertaining to | |
| Cerastium axillare Correll Chrysothamnus axillaris Keck | ||||
| axilliflorus axilliflora axilliflorum | flowers in axils | |||
| axilla | axill | noun/f | armpit | |
| i | i | cnct | connective vowel used by botanical Latin | |
| florus | flor | ppar | floreo to bloom, to flower | |
| Cuphea axilliflora Koehne Chionanthus axilliflorus (Griseb.) Stearn | ||||
| azoricus azorica azoricum | of the Azores | |||
| azoricus | azoric | adj | Azores Azores, Portuguese islands in the Atlantic | |
| icus -ικοϛ adjective suffix for nouns: belonging to, from, of | ||||
| Myosotis azorica H.C. Wats. ex Hook. Jasminum azoricum L. | ||||
| azureus azurea azureum | the color of deep blue | |||
| azure | azur | adj | lazaward Ar->OFr lapis lazuli (initial 'l' dropped as if it were French: l'azaward) | |
| eus | e | adj | adjective suffix for nouns: made from, color, -like | |
| Anchusa azurea P.Mill. Delphinium azureum Michx. Penstemon azureus Benth. |


Want To Collaborate? Contact Me!
I leverage my project management background to delight the client by building a more intuitive user experience. I empower technical and creative teams while promoting agile development best practices to discover, design, iterate and deliver scalable, high-quality products. I build synergy + collaboration among teams and stakeholders in all phases of diverse technology projects. A highly effective communicator, I combine empathy and emotional agility to establish and build trust. I ensure seamless delivery of complex projects on time and at budget. My broad-based background encompasses commitment to organizational objectives and exceptional business acumen within a rapidly changing and highly competitive technical marketplace.
Are you ready to collaborate? Click the button below for my resume.
Oliver NeilManaging Director at Erich Jaeger GmbH + Co. KG
I'm more than happy to recommend Jen as the always reliable, accurate and very responsive partner she has been to me. Jen's positive and always supportive nature was a very important factor to quickly work through issues in our daily work and to help building trusted partnerships with our customers. Jen's excellent inter-personal skills and understanding of complex technical and commercial structures make her a truly outstanding professional in a customer oriented role and I'm sure she will be a true asset for any company.
Rebecca ChiqueteFull Stack Web Development Student, University of Arizona
Together as a team myself and Jen Bates were tasked with creating a fully functional app. I admire her drive to learn and continue to build her full-stack knowledge. Throughout the project Jen had constant updates and was extremely communicative and truly was a great partner. Without her drive and dedication to this project I don't believe it would have been as successful as it was. I am thankful to have worked with Jen on this project and in the future would give no hesitation on working with her again. She is an asset to anyone who gets the chance to work with her.Morris Shawn CEO at Roadpost Inc.
Jen built strong relationships and a high level of trust and respect among all of us here at Roadpost who have worked with her. She has always been responsive, professional and consistently follows through on her commitments. In short, she has acted as a true partner, helping Roadpost and Iridium to build our business together. I would not hesitate to recommend her.
See all of my recommendations on my LinkedIn profile.
I'm looking forward to collaborating, send me a message. I can't wait to hear from you!


management_layer.mappings module¶
This module manages the common permission-related information in convenient formats.
In order to prevent repeated API lookups, data can be loaded when the application is started and refreshed as necessary. We typically store dictionaries where the key is the id of the entity, and the value is the entity itself, as well as a dictionary which maps the text identifier of the entity to its id.
While the use of shared variables to store these values can be problematic in the case where an application is multi-threaded, the same is not true when the application uses an event loop, since it is single-threaded in nature.
The values stored in the mapping class are refreshed when a scheduled job calls one of the refresh_* functions. Typically a refresh will use a cached value from redis, but, if the value is not in redis or it expired, the API will be queried and the cache updated.
If multiple instances of the management-layer is running, typically only one will have to refresh redis, after which the rest will use the cached values.
IMPORTANT: Dictionaries with integer keys that are serialised to JSON will have those keys converted to strings when cached and those keys need to be transformed back to integers after reading from the cache.
-
class
management_layer.mappings.
Mappings
[source]¶ Bases:
object
-
classmethod
all_resource_permissions
()[source]¶ This function returns a list of Management Portal permissions, which are concatenations of the resource URNs and permission names. :return:
-
classmethod
site_id_for
(token_client_id: str) → int[source]¶ Returns the site linked to a client. A token has a “client_id” string, which maps to a client with an integer id. This integer id is used in the “client_id” field of a site definition. So:
token_client_id -> client.id -> site.client_id
Parameters: token_client_id –
-
classmethod
-
management_layer.mappings.
refresh_all
(app: aiohttp.web_app.Application, nocache: bool = False)[source]¶ Refresh all data mappings
-
management_layer.mappings.
refresh_clients
(app: aiohttp.web_app.Application, nocache: bool = False)[source]¶ Refresh the client information Because this information is linked to site information, the site information needs to be loaded before this.
-
management_layer.mappings.
refresh_domains
(app: aiohttp.web_app.Application, nocache: bool = False)[source]¶ Refresh the domain information
-
management_layer.mappings.
refresh_keys
(app: aiohttp.web_app.Application, nocache: bool = False)[source]¶ The call for retrieving the JSON Web Token Key Set (JWKS) is not exposed by the Authentication Service API since it is part of the OIDC Provider Django application. A simple HTTP request (as opposed to using a client library) suffices in this case.
-
management_layer.mappings.
refresh_permissions
(app: aiohttp.web_app.Application, nocache: bool = False)[source]¶ Refresh the permission information
-
management_layer.mappings.
refresh_resources
(app: aiohttp.web_app.Application, nocache: bool = False)[source]¶ Refresh the resources information
-
management_layer.mappings.
refresh_roles
(app: aiohttp.web_app.Application, nocache: bool = False)[source]¶ Refresh the roles information


| Class | Description |
|---|---|
| BenchmarkDataSetIterator |
Dataset iterator for simulated inputs, or input derived from a DataSet example.
|
| BenchmarkMultiDataSetIterator |
MultiDataset iterator for simulated inputs, or input derived from a MultiDataSet example.
|
| Cifar10DataSetIterator |
CifarDataSetIterator is an iterator for CIFAR-10 dataset - 10 classes, with 32x32 images with 3 channels (RGB)
This fetcher uses a cached version of the CIFAR dataset which is converted to PNG images,
see: https://pjreddie.com/projects/cifar-10-dataset-mirror/.
|
| EmnistDataSetIterator |
EMNIST DataSetIterator
EMNIST is similar to the common MNIST dataset (available via MnistDataSetIterator ), with 6 different splits/
variants, specified by EmnistDataSetIterator.Set :COMPLETE: Also known as 'ByClass' split. 814,255 examples total (train + test), 62 classes MERGE: Also known as 'ByMerge' split. 814,255 examples total. 47 unbalanced classes. |
| IrisDataSetIterator |
IrisDataSetIterator: An iterator for the well-known Iris dataset. 4 features, 3 label classes
https://archive.ics.uci.edu/ml/datasets/Iris |
| LFWDataSetIterator |
LFW iterator - Labeled Faces from the Wild dataset
See http://vis-www.cs.umass.edu/lfw/ 13233 images total, with 5749 classes. |
| ListDataSetIterator<T extends DataSet> |
A simple iterator that wraps a
Collection<DataSet> . |
| MnistDataSetIterator |
MNIST data set iterator - 60000 training digits, 10000 test digits, 10 classes.
|
| SingletonDataSetIterator |
A very simple adapter class for converting a single DataSet to a DataSetIterator.
|
| SingletonMultiDataSetIterator |
A very simple adapter class for converting a single MultiDataSet to a MultiDataSetIterator.
|
| TinyImageNetDataSetIterator |
Tiny ImageNet is a subset of the ImageNet database.
|
| UciSequenceDataSetIterator |
UCI synthetic control chart time series dataset.
|
| Enum | Description |
|---|---|
| EmnistDataSetIterator.Set |
EMNIST dataset has multiple different subsets.
|
Copyright © 2020. All rights reserved.


GABC Transcription Tool
Psalm Tone Tool
Readings Tool
Propers Tool
(About)
PDF
Further PDF options
Tone:
Solemn Tone
Clef:
Reciting Tone:
Flex Tone:
Mediant GABC:
Full Stop GABC:
Question GABC:
Conclusion GABC:
Text
English
Load from Vulgate:
Genesis
Exodus
Leviticus
Numeri
Deuteronomium
Josue
Judicum
Ruth
1 Regum
2 Regum
3 Regum
4 Regum
1 Paralipomenon
2 Paralipomenon
Esdræ
Nehemiæ
Tobiæ
Judith
Esther
Job
Psalmi
Proverbia
Ecclesiastes
Canticum Canticorum
Sapientia
Ecclesiasticus
Isaias
Jeremias
Lamentationes
Baruch
Ezechiel
Daniel
Osee
Joel
Amos
Abdias
Jonas
Michæa
Nahum
Habacuc
Sophonias
Aggæus
Zacharias
Malachias
1 Machabæorum
2 Machabæorum
Matthæus
Marcus
Lucas
Joannes
Actus Apostolorum
Ad Romanos
1 Ad Corinthios
2 Ad Corinthios
Ad Galatas
Ad Ephesios
Ad Philippenses
Ad Colossenses
1 Ad Thessalonicenses
2 Ad Thessalonicenses
1 Ad Timotheum
2 Ad Timotheum
Ad Titum
Ad Philemonem
Ad Hebræos
Jacobi
1 Petri
2 Petri
1 Joannis
2 Joannis
3 Joannis
Judæ
Apocalypsis
IN those days a decree went out from Caesar Augustus that the whole world should be enrolled*. This was the first enrollment, when Quirinius was governor of Sy*ria. So all went to be enrolled*,, each to his own town*. And Joseph too went up from Galilee from the town of Nazareth to Judea,, to the city of David that is called Be*thlehem, because he was of the house and family of David, to be enrolled with Mary, his betrothed, who was with child. While they were there,+ the time came for her to have her child*, and she gave birth to her firstborn son*. She wrapped him in swaddling clothes and laid him in a manger, because there was no room for them in the inn*=. Now there were shepherds in that region living in the fields+ and keeping the night watch over their flock*. The angel of the Lord appeared to them+ and the glory of the Lord shone around them, and they were struck with great fear. The angel said* to them, "Do not be afraid*; for behold, I proclaim to you good news of great joy that will be for all the people. For today in the city of David a savior has been born for you who is Christ and Lord*. And this will be a sign* for you: you will find an infant wrapped in swaddling clothes and lying in a manger." And suddenly there was a multitude of the heavenly host with the angel,+ praising God and saying: "Glory to God in the highest, and on earth peace to those on whom his favor rests*."
Format as:
Only format vowels
Use puncta cava
Begin Preparatory Syllable:
End Preparatory Syllable:
Begin Accented Syllable:
End Accented Syllable:
Verse Prefix:
Verse Suffix:
Non-breaking space:
Verses Filename:
GABC


Interface to 'TensorFlow' Estimators <https://www.tensorflow.org/programmers_guide/estimators>, a high-level API that provides implementations of many different model types including linear models and deep neural networks.
| Version: | 1.9.1 |
| Depends: | R (≥ 3.1) |
| Imports: | forge, magrittr, progress, reticulate (≥ 1.10), rlang (≥ 0.3), tensorflow (≥ 1.9), tfruns (≥ 1.1), tidyselect, utils, purrr, tibble, tidyr |
| Suggests: | ggplot2, modelr (≥ 0.1.1), testthat, knitr |
| Published: | 2018-11-07 |
| Author: | JJ Allaire [aut], Yuan Tang [aut], Kevin Ushey [aut], Kevin Kuo [aut, cre], Daniel Falbel [ctb, cph], RStudio [cph, fnd], Google Inc. [cph] |
| Maintainer: | Kevin Kuo <kevin.kuo at rstudio.com> |
| BugReports: | https://github.com/rstudio/tfestimators/issues |
| License: | Apache License 2.0 |
| URL: | https://github.com/rstudio/tfestimators |
| NeedsCompilation: | no |
| SystemRequirements: | TensorFlow (https://www.tensorflow.org/) |
| Citation: | tfestimators citation info |
| Materials: | README NEWS |
| In views: | HighPerformanceComputing, ModelDeployment |
| CRAN checks: | tfestimators results |
| Reference manual: | tfestimators.pdf |
| Vignettes: |
Custom Estimators Dataset API Estimators Basics Feature Columns Input Functions Parsing Utilities Run Hooks TensorBoard Visualization Using Estimators |
| Package source: | tfestimators_1.9.1.tar.gz |
| Windows binaries: | r-devel: tfestimators_1.9.1.zip, r-release: tfestimators_1.9.1.zip, r-oldrel: tfestimators_1.9.1.zip |
| OS X binaries: | r-release: tfestimators_1.9.1.tgz, r-oldrel: tfestimators_1.9.1.tgz |
| Old sources: | tfestimators archive |
| Reverse suggests: | tensorflow, tfdatasets |
Please use the canonical form https://CRAN.R-project.org/package=tfestimators to link to this page.


3452 DKK
230g CO2e
1.23kg CO2e
12
CO2 Emission
How much CO2 do you wish to save?* Only use electricity when the green line is under the black line to reach your target:
50%
Green Energy Production


This is a 15-minute survey by researchers at Heidelberg University in Germany. You can only collect your reward if you complete the survey. To complete the survey, you have to answer
all questions.
Please answer the questions to the best of your ability. Your opinion matters.
In the survey, a few tests have been included to ensure that your answers are consistent among each other.
All hits failing the consistency test will be rejected.
If you complete the survey, you may be invited to a
larger study in the future.
Thank you and enjoy your time here!
Heidelberg University.
Semper apertus.