{{ name }}
{{ department_location }} Department Budget for {{ selected_financial_year }} {% if website_url %} {{ website_url }} {% endif %} {% include 'components/department-budgets/IntroSection/index.html' with description=intro datasets=treasury_datasets location=department_location %}{{ selected_financial_year }} Budget
The {{ source_type_revenue }} ({{ source_type_revenue_short }}) is a book published along with the tabling of the budget for the new financial year.
{% assign "View the "|add:source_type_revenue_short|add:" chapter for "|add:chapter_name|add:" (PDF)" as text1 %} {% assign "View tables in the "|add:source_type_revenue_short|add:" chapter (Excel)" as text2 %} {% if pdf_link or excel_link %}-
{% include 'components/LinksList/item.html' with text=text1 url=pdf_link type="download" %}
{% include 'components/LinksList/item.html' with text=text2 url=excel_link type="download" %}
{{ selected_financial_year }} Adjusted Budget
The {{ source_type_adjusted }} ({{ source_type_adjusted_short }}) is a book published along with the tabling of the adjusted budget.
{% assign "View the "|add:source_type_adjusted_short|add:" chapter for "|add:chapter_name|add:" (PDF)." as text1 %} {% assign "View tables in the "|add:source_type_adjusted_short|add:" chapter (Excel)." as text2 %} {% if pdf_link_adjusted or excel_link_adjusted %}-
{% include 'components/LinksList/item.html' with text=text1 url=pdf_link_adjusted type="download" %}
{% include 'components/LinksList/item.html' with text=text2 url=excel_link_adjusted type="download" %}
Department infrastructure projects
Largest infrastructure projects by this department.
| Project name | Status | Estimated completion date | |
|---|---|---|---|
| {{ project.name }} | {{ project.status|default:"Not available" }} | {{ project.estimated_completion_date|default:"Not available" }} | |
| No projects available for this department. |


|
John DillingerOn March 3, 1934, bank robber and cop killer John Dillinger finally went too far. He committed a criminal act so heinous that there was even a federal law against it, ultimately prompting the FBI to hunt him down like a dog.  Once outside, he stole a car and drove to Chicago, crossing into Illinois in the process.In 1934, driving a stolen car across state lines was a federal offense. Robbing banks and killing police officers weren't. The FBI suddenly had jurisdiction to go after Dillinger, and director J. Edgar Hoover immediately made apprehending him the agency's top priority. In Chicago, Dillinger tried to keep a low profile. He hung out with his girlfriend, and they stayed out of public places. But hiding out gets boring real quick, and in late July they decided it would be worth the risk to go see a movie. They figured it wasn't likely that anyone would recognize him in a darkened theater. And they were right -- nobody did recognize him. Except for the FBI agents, who had been tipped off by an anonymous phone call about three hours earlier. They were told that Dillinger and two women would be taking in a movie around 8 o'clock at one of two theaters, the Marbro or the Biograph. So the FBI staked out both places. This was the FBI's second chance. Their prior attempt, at a lodge in rural Wisconsin, had resulted in a bloodbath. The FBI accidentally machinegunned three innocent bystanders, killing one of them. Then the gangsters shot their way out, murdering one agent, wounding another, and also wounding a local cop. And all of the bad guys had gotten away. That debacle took place back in April, and the subsequent press coverage had been an ongoing embarrassment for Hoover. Just before nine o'clock, Dillinger and his female companions arrived at the Biograph. They were spotted by FBI agents, who immediately alerted headquarters. The entire staff of Chicago's FBI office converged on the theater. They made the determination to confront the fugitive upon exiting the building. Agents were stationed outside each of the exits, where they waited for Dillinger to emerge. Around 10:30 the trio finally appeared, and the agents closed in. Dillinger broke into a run and went for his gun. Three of the FBI men gunned him down. Two bullets hit him in the chest, and another round punched through the back of the head and out the right eye socket. Now that the FBI had finally gotten their man, J. Edgar Hoover milked the event for all it was worth. Press photographers were invited to take pictures. The photos reveal what appears to be the entire staff of the Alexian Brothers hospital crowded into the morgue, gawking at the decedent. One particularly famous image of Dillinger's body tilted up on an exam table sparked the lingering rumor that he had possessed a gargantuan penis. The conspicuous lump in the crotchal region was actually the dead man's arm in rigor mortis, captured with an unfortunate camera angle.
|


Directive to display Bootstrap modals.
Use the ngxStrapModal
directive
with an ng-template
to create a Bootstrap modal.
Use the show()
method to show it.
Use the native Bootstrap modal data-
attributes and classes to control the modal's appearance and behavior.
The show method returns a on object with shown
and hidden
promises.


Select a user to assign to the task in the list (current : {{ $ctrl.task.assignee.username }} ) :
{{user.username}} Assign


This is an example page that loads strictly the minimal core styles & scripts required by BUSINESS and the form-validator component
Select at least two topics you would like to receive in the newsletter.


This is
some text and an inline element that spans over many lines to demonstrate
this inline positioning solution, and some more text.
This is some text and an
inline element that
spans over many lines to demonstrate this inline positioning solution , and
some more text.


The annual dinner and dance event will take place on March 26th from 6 - 11 pm at Diamond Ballroom (1495 W8th Avenue). There will be drinks, a photo booth, and not to mention an AWESOME view! Fill out this form to receive tickets and we will send you an email with instructions regarding payment shortly. Fill out the names of your group members if you decide to purchase a group ticket - only one submission is required per group.


Learn exciting technologies from web development, design, game development and more!
Build 3 Awesome Web Applications With React!
From Beginner Javascript To Building Awesome Web Apps and Websites!
Create 3 amazing, well designed and animated websites from scratch!


See the results of the tests below. Be aware that passing the test might not be the solution nor does it guarantee full points:
simpleTest()
as reaction to Event "qwerty".
sumTest(x)
as reaction to Event "qwerty" with x being the sum of a+b.


https://leetcode.com/problems/integer-to-roman/
Roman numerals are represented by seven different symbols: I, V, X, L, C, D and M. Symbol Value I 1 V 5 X 10 L 50 C 100 D 500 M 1000 For example, two is written as II in Roman numeral, just two one's added together. Twelve is written as, XII, which is simply X + II. The number twenty seven is written as XXVII, which is XX + V + II. Roman numerals are usually written largest to smallest from left to right. However, the numeral for four is not IIII. Instead, the number four is written as IV. Because the one is before the five we subtract it making four. The same principle applies to the number nine, which is written as IX. There are six instances where subtraction is used: I can be placed before V (5) and X (10) to make 4 and 9. X can be placed before L (50) and C (100) to make 40 and 90. C can be placed before D (500) and M (1000) to make 400 and 900. Given an integer, convert it to a roman numeral. Input is guaranteed to be within the range from 1 to 3999. Example 1: Input: 3 Output: "III" Example 2: Input: 4 Output: "IV" Example 3: Input: 9 Output: "IX" Example 4: Input: 58 Output: "LVIII" Explanation: L = 50, V = 5, III = 3. Example 5: Input: 1994 Output: "MCMXCIV" Explanation: M = 1000, CM = 900, XC = 90 and IV = 4.
class Solution: def intToRoman(self, num: 'int') -> 'str': pass
class Solution: def intToRoman(self, num: 'int') -> 'str': basic1s = ('I', 'X', 'C', 'M') # 1, 10, 100, 1000 basic5s = ('V', 'L', 'D') # 5, 50, 500 solution = '' for i in range(4): if num == 0: break digit = num % 10 if digit <= 3: solution = basic1s[i] * digit + solution elif digit < 5: solution = basic1s[i] * (5 - digit) + basic5s[i] + solution elif digit <= 8: solution = basic5s[i] + basic1s[i] * (digit - 5) + solution else: solution = basic1s[i] * (10 - digit) + basic1s[i +1] + solution num = int(num / 10) return solution


This is the base package for JCAPTCHAs.
It defines three main interfaces :
- Captcha : the container for challenge, built by a CaptchaFactory, which contains the challenge object (a pix or a sound or whatever), the string question, and has the ability to validate a string answer
- CaptchaFactory : the factory for Captchas :), built by a CaptchaEngine, which have the responsability to build captchas from their constructor passing them builded questions and challenges
- CaptchaEngine : the factory for the CaptchaFactories, which have the responsability to build CaptchaFactories
- CaptchaService : the service for applications : Provides an unique tiket and build a captcha using an engine, then exposes methods to use it


cd upload-server-examples/node
npm install
node upload-server.js
Change Upload URL to: http://localhost:3000/upload
Copy upload-server-examples
into your web accessible directory (e.g: /var/www
or htdocs
)
Change Upload URL to: http://localhost/upload-server-examples/php/upload-server.php


Methods
decode(token) → {DecodedToken}
Decodes a well formed JWT without any verification
Parameters:
| Name | Type | Description |
|---|---|---|
token |
string
|
decodes the token |
validateAccessToken(access_token, alg, atHash, cb)
Validates an access_token based on http://openid.net/specs/openid-connect-core-1_0.html#ImplicitTokenValidation. The id_token from where the alg and atHash parameters are taken, should be decoded and verified before using thisfunction
Parameters:
| Name | Type | Description |
|---|---|---|
access_token |
string
|
the access_token |
alg |
string
|
The algorithm defined in the header of the previously verified id_token under the "alg" claim. |
atHash |
string
|
The "at_hash" value included in the payload of the previously verified id_token. |
cb |
validateAccessTokenCallback
|
callback used to notify the results of the validation. |
verify(token, requestedNonceopt, cb)
Verifies an id_token
It will validate:
- signature according to the algorithm configured in the verifier.
- if nonce is present and matches the one provided
-
if
iss
andaud
claims matches the configured issuer and audience -
if token is not expired and valid (if the
nbf
claim is in the past)
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
token |
string
|
id_token to verify |
|
requestedNonce |
string
|
<optional> |
nonce value that should match the one in the id_token claims |
cb |
verifyCallback
|
callback used to notify the results of the validation |
Type Definitions
DecodedToken
Properties:
| Name | Type | Description |
|---|---|---|
header |
Object
|
content of the JWT header. |
payload |
Object
|
token claims. |
encoded |
Object
|
encoded parts of the token. |
Type:
-
Object
validateAccessTokenCallback(erropt)
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
err |
Error
|
<optional> |
error returned if the validation cannot be performed or the token is invalid. If there is no error, then the access_token is valid. |


{% extends "registration/base.html" %} {% block content %}
You no longer have permission to modify the database or anime records. Please sign in if you are authenticated or return to browsing the animes.


THIS IS THE HEADING TAGS H1 TO H6
This is main Heading.
This is sub Heading
This is h3 Heading
This is h4 Heading
This is h5 Heading
This is h6 Heading
HTML LINKS
This is my Website, please visit.
Target attribute used for open the linked documents in new tab
HTML Images


Chris's posts
You may have heard of Git and Github. The two are intertwined within the developer community. It allows developers to develop programs without the fear of losing their work. It also helps them keep track of changes that are made on the projects they’re working on. Perhaps the biggest advantage to using Git and GitHub is that it allows multiple people to work on a project at the same time without the fear of messing up other people’s work.
First let’s start with the Git. Git is a type of version control software. This particular software allows a person to work on files and save them with the ability to go back to an older version. It’s like going back in time. You can keep track of all these changes using some of the tools built into Git.
GitHub although has the Git in it’s name is a completely different program. It is an online storage space to collect all of your files that you’ve changed with Git online. This allows you to access the files anywhere like dropbox or Google drive. Just like these cloud services, you can let other people view your GitHub collection, called repositories and make changes. This is a very powerful concept. Imagine having the task of creating a video game with 3 people. With GitHub you could have one person work on menus, the other on levels, and the other on sound. GitHub lets them upload their work and have the others review it before putting it in the game. If they needed to take a part of it out, say a level that isn’t working they could do that by reverting to an older version that didn’t include that level.
Dan's body of work
Perhaps there will be an intro post sometime later... but for now, we're going to dive right in. I'll be writing a bit about my experiences with git, GitHub, and the command line, which were the core parts of the curriculum for DBC this first week of Phase 0.
The big theme for this week was that previous exposure to the concepts helped them really sink in this time around. I suspect that will be a recurring pattern through DBC - it may take a few rehearsals before something really becomes intuitive. I think that's actually a pretty fundamental part of learning that I try to weasel my way out of sometimes, but in the end, there is no substitute for practice, or as my boss likes to say, "additional reps." I actually think it's an encouraging sign, very much aligne d with growth-mindset thinking: there is no concept you can't understand as long as you keep at it.
I had been exposed to all three topics previously in my CS adventures, both through chance encounters and through my deliberate attempts to learn them. I've been through at least one mini-CLI course, and I'd read a few git/GitHub tutorials previously. I knew these were fundamental tools in the developer toolkit, but like foreign languages, they don't stick when you don't feel you have a need to use them. Why use version control when you're building small programs that don't play together? Why bother with a command line interface when I have a perfectly good GUI? And I think I could still defend that line of reasoning - the average person probably doesn't need to know the ins and outs of rmdir - but it's certainly the case that I'll need to know them soon.


{{ partial "head/head.html" . }}
{{ partial "header/site-nav.html" . }}
{{- block "main" . }}{{ end }}
{{ partial "widgets/donate-bar.html" . }} {{ partial "footer/scripts.html" . }}


Sun
Co-Leading the Workshop on R, DataONE and open science.
All material on github
Mon
- Ives Plenary
Talking to Dave, Vasilis, Tye,
Lunch Vasilis, Ryan Batt
- 2:30 Chesson L100H / Ryan Batt L100J
- 3:20 O’Regan L100H
- 3:40 Adler L100H
4 Yaekel M100HC
- ropensci meetup, funded by Github. Great turnout, great success. (And rare shot of dev team together in person).
- Theoretical ecology mixer
Hastings Lab dinner
Great discussions with Trevor Hefley on some very nice work dealing with biases in messy data. See Hefley 2013 and 2013b, and more in the works.
Tues
- 8am Carpenter L100B
- M100IB 8am - 10am
- 10am meeting Carpenter, see seperate nodes
- 12am Lunch with Lei Dai
- 2:50pm Drake L100G
Afternoon inteview with Virginia Gewin on Yeakel’s talk. Remarkable challenge to explain generalized modeling for ecological networks in plain english. Virginia gets all the credit for condensing my lengthy verbage into a tweet size summary. Now out in Nature News
- Open Science session in evening
Amazing talk and later discussion with Russell Neches.
- open hardware and 3D printers for scientific research. 3 examples:
- cheaper than alternatives (water quality monitor on rduino chip, tweets data)
- More flexible than alternatives: variable depth 96 well plates to automate concentration of sample. (also cheap gel combs)
- When no alternative exists: measuring gape without harming fish.
- Avoid Nature’s $9000 APC open access option by including a $1000 new genome. (Genome papers are OA by agreement…)
- Choose PhD advisor by Bayesian Classifier…
Weds
- 3:20 David Hoover (missed)
- 3:40 Ingrid
spatial waves maxwell
4pm L Dai 101D
4:20 Anna Gardmark https://eco.confex.com/eco/2013/webprogram/Paper40488.html
Explaining lack of recovery / hysteresis
- Prey competing with (younger life stages of) predators (Bundy Finning 2005 CJFAS, Walters .. , …)
- Prey predating upon younger life stages of codes (Swan and Sinclair 2000 CJFAS)
Prey growth changes due to predation (poor condition, or prey size structure) (vulnerability - deRoos Peerson 2002 PNAS)
4:40 Mark Novak https://eco.confex.com/eco/2013/webprogram/Paper42117.html
Kelp-urchin transition. Otters arrival leads to transitions in Vancouver Island set, resulting in shifts (used as training). San Nicolas Island sets transitions on its own, despite otter introduction in process. Spatial transects and 31 years of data, 5 replicate transects for all sites. Bayesian change-point analysis to identify shifts (e.g. see Erdman & Emerson 2012).
Chatting with Mark after talk.
- SySnc / NCEAS Mixer
- TweetUp
Discussion of semantics and NeXML with Ben Morris (wrote python parser). Sounds like I need to read semantic web for working ontologist
Excellent discussion with Ethan White on what a Institute for Software Sustainability would do.
- Training training training. Materials, workshops.
- Much would be improved with a few best practices: unit tests, version control
- Google Summer of Code style funding
Thurs
- 8am Thurs Dakos
- Discussion with Ryan Batt
- Discussions with Lei Dai and Vasilis. Lei’s Science paper data on Dryad (temporal indicators). Get back to Lei on format for this data.
- Exchange with Bestlemyer - lack of time resolution for warining indicators of spatial study. Data from Ecosphere paper on Harvard’s LTER site.
Excellent discussion with Ben Bolker and Dave Harris on what Software Sustainability Institute would accomplish:
- Tackling archiving / backports of code. CRAN offers only “current” and “devel”, you’re on you’re own getting older stuff running.
- Training! Not just for grad students - Ben would attend. More experienced, but self-taught, developers like Ben would come with their own questions and could guide what training they needed.
- Bringing academics together with experts in hackathon style of improving existing codes would be great.
- One challenge is maintaining accessibility of code styles so that academics can continue to contribute. e.g. most academic R programmers don’t understand S4 classes, would be a potential barrier.
Van Noorden’s data sharing article out, with quotes by Elizabeth, Wolkovich, Heather, Bill Mitchner, yours truly.
- Flight out


astrology
cursive
cyrilc_1
cyrillic
futural
futuram
gothgbt
gothgrt
gothiceng
gothicger
gothicita
gothitt
greek
greekc
greeks
hershey
japanese
markers
mathlow
mathupp
meteorology
minimal
minimallc
music
rowmand
rowmans
rowmant
scriptc
scripts
symbolic
timesi
timesib
timesr
timesrb
SUBMIT
JOB
MEASURE
CUTTER
HOME
TOOL
ALL
CAPS
demo
string
type


Objective
My objective is to obtain an entry level position where I can gain more experience to improve my skills and knowledge.
Education
Postgraduate in Computer Graphics at The Marie Curie Skłodowska University in Lublin, Poland
Degree in Early School Education with English at The Jan Kochanowski in Kielce, Poland
Skills
Experience
DTP Specialist Senior (01.2012 - Present) Print House „Wisła” Poland - preparing files for print, imposition, graphic design, tools: Adobe indesign, Adobe illustrator, Adobe photoshop, MS Office
„Interface” Digital Agency (04.2011 – 07.2011) Lublin Poland- Graphic Designer /DTP Professional web & graphic design, branding + identity, print design.
Freelancing (06.2009 – Present) Cooperations with interactive agency and individual clients. My areas of expertise are all areas of graphic and interface design such as web, mobile, print, logo and branding Portfolio: www.krzysztofdurak.pl
Hobbies
Gym, yoga, pc games, technology.


WITNESS LIST Local Government Ways and Means Committee April 28, 2003-8:00A HB 1098 For: Gadbois, Glenn (Just Transportation Alliances) Utter, Tom (Self and City of Corpus Christi) HB 3223 For: Allen, George B. (Texas Apartment Association) Bettencourt, Paul (Self) Faulk, Peggy (Self) Against: Casey, Daniel (Texas School Alliance) Lavine, Dick (Center for Public Policy Priorities) On: Robinson, Jim (Self) HB 3540 For: Bettencourt, Paul (Self) Salinas, Froy (City of El Paso) HB 3546 For: Aghamalian, Brandon (City of Fort Worth) Allen, Monique (Maple Ave Economic Develop Corp CHDO) Charles, Paul D. (Texas Association of CDCs) Fairfield, Stephen (Self and Houston Association of Community Development Corporations, Covenant Community Capital) Mintz, David (Texas Apartment Association) Moreau, Walter (Foundation Communities) Smith, Rowan (Texas Affordable Housing Congress) Williams, Sandra N. (Alamo Area MHA) On: Fitzgerald, Rodric E. (American Opportunity for Housing, Inc.) Robinson, Jim (Self and Leg. Chair, Texas Assn. of Appraisal Dists) HB 3546 Committee Substitute (Hegar) For: Eaton, Michael (Self and Texas Affordable Housing Congress) Ocanas, Reymundo (TX Assoc of CDCs) Against: Parker, Robert (Self) On: Moore, Wayne (American Housing Foundation) HJR 4 For: Allen, George B. (Texas Apartment Assn.) Allen, George B. (Texas Apartment Association) Bettencourt, Paul (Self) Against: Casey, Daniel (Texas School Alliance) Lavine, Dick (Center for Public Policy Priorities)


Concerts
Reviews
About Us
FAQ
Upcoming Concerts
Laura Marling
Bowery Ballroom
June 15
Buy Tickets
Wilco
Bowery Ballroom
June 15
Buy Tickets
The National
Bowery Ballroom
June 15
Buy Tickets
Arcade Fire
Bowery Ballroom
June 15
Buy Tickets
Hot Chip
Bowery Ballroom
June 15
Buy Tickets


Details1 message: {{Details1.vm.text}}
I have access to my master controller!
{{Master.vm.text}}
So does a shared scope directive
But not an isolate scope directive
I can reassign arrays and my view updates so long as the array isn't a direct property of the controller
Numbers Array: {{num}}


邮箱
密码
Remember me
登陆
Option one is this and that—be sure to include why it's great
Option one is this and that—be sure to include why it's great
Option two can be something else and selecting it will deselect option one
1
2
3
1
2
3
4
5
1
2
3
4
5
@
.00
Go!
Action
...
...
...
Search
Search
Some value here
1
2
3
1
2
3
Save changes
Cancel
Inline help text
A longer block of help text that breaks onto a new line and may extend beyond one line.
选项卡 #1
功能块...
选项卡 #2
功能块...


Before Change
origin: Optional[OriginSpec] = None,
dependencies: Optional[List[Address]] = None,
) -> PythonTargetAdaptorWithOrigin:
input_snapshot = self.request_single_product(Snapshot, InputFilesContent(source_files))
adaptor_kwargs = dict(
sources=EagerFilesetWithSpec(self.source_root, {"globs": []}, snapshot=input_snapshot),
address=Address.parse(f"{self.source_root}:target"),
dependencies=dependencies or [],
)
if interpreter_constraints:
adaptor_kwargs["compatibility"] = interpreter_constraints
if origin is None:
origin = SingleAddress(directory=self.source_root, name="target")
return PythonTargetAdaptorWithOrigin(PythonTargetAdaptor(**adaptor_kwargs), origin)
def run_pylint(
self,
targets: List[PythonTargetAdaptorWithOrigin],
After Change
// We must re-write the files because `create_library` will have over-written the content.
for source_file in source_files:
self.create_file(source_file.path, source_file.content.decode())
target = PythonLibrary(
{
Sources.alias: source_globs,
Dependencies.alias: dependencies,
PythonInterpreterCompatibility.alias: interpreter_constraints,
},
address=Address(self.source_root, name),
)
if origin is None:
origin = SingleAddress(directory=self.source_root, name=name)
return TargetWithOrigin(target, origin)
def run_pylint(
self,
targets: List[TargetWithOrigin],


--- hidden: true layout: page title: Pagination (Page 2) ---
A resultset can be paginated via server side page reloads (i.e. links) or client side page rendering (i.e. buttons).
Please read the documentation to understand how these examples were created.
Use TAB keys to navigate links; ENTER key to activate.
Use TAB keys to navigate buttons; ENTER or SPACEBAR keys to activate. New page will be announced by screen reader.


Compare patient-derived gene expression profiles with perturbational signatures in the Connectivity Map (CMap)
PDEx tests for associations between a feature present in a subset of samples (gene mutation, tumor receptor status, patient drug response, etc) and perturbations profiled in CMap (drug treatments, gene knock-down, gene overexpression). A high positive PDEx score indicates samples with the feature of interest and the perturbation induced similar gene expression changes. A high negative score indicates opposite changes - genes upregulated in one are downregulated in the other. Intermediate scores indicate no detectable association between the two
Tumor Protein 53 (TP53) is a tumor suppressor gene that is frequently inactivated by somatic missense mutation in cancer. TP53 mutations occur in 1931 out of 10147 TCGA samples (19%) across different cancers. How does TP53 mutation in TCGA compare to TP53 knock-down in CMap?
Examine other assoications.KEAP1 functions to keep NRF2 in the cytoplasm and regulates the antioxidant response signalling of NRF2. Upon inactivation of KEAP1 by mutations, we expect to see a signature similar to NRF2 overexpression. This is true for KEAP1 mutations, NRF2 mutations, and NRF2 copy number gains!
Examine other assoications.


This rule checks that classes inheriting from classes with the suffix Eto end with the same suffix.
public class TestClass extends AbstractEto {}
public class TestEto extends AbstractEto {}


Code Quiz
As a coding bootcamp student I want to take a timed quiz on JavaScript fundamentals that stores high scores so that I can gauge my progress compared to my peers.
As a coding bootcamp student I want to take a timed quiz on JavaScript fundamentals that stores high scores so that I can gauge my progress compared to my peers.


As examples, the tokens in the next figure are potential numbers, but they are not actually numbers, and so are reserved tokens; a conforming implementation is permitted, but not required, to define their meaning.
1b5000 777777q 1.7J -3/4+6.7J 12/25/83 27^19 3^4/5 6//7 <IP_ADDRESS> ^-43^ 3.141_592_653_589_793_238_4 -3.7+2.6i-6.17j+19.6k
Figure 2-10. Examples of reserved tokens
The tokens in the next figure are not potential numbers; they are always treated as symbols:
/ /5 + 1+ 1- foo+ ab.cd _ ^ ^/-
Figure 2-11. Examples of symbols
The tokens in the next figure are potential numbers if the current input base is 16, but they are always treated as symbols if the current input base is 10.
bad-face 25-dec-83 a/b fad_cafe f^
Figure 2-12. Examples of symbols or potential numbers


Home
API
About
Room Conditions
Index
34
Some Disconfort
(here i will display a gauge instead of the image)


Girls on holiday in Magaluf spotted signs that saved Chloe's life
Chloe is getting better but fears she may have been left infertile
by Ellie Forbes, Ryan Thom, Neil ShawA young woman has told how a girls' trip to Magaluf saved her life when her friends noticed her anorexia - which had stopped her periods and caused her hair to fall out.
Chloe Frame, 20, became so determined not to eat that she feared even using toothpaste would cause her to put on weight.

Her periods stopped and her hair began to fall out, and she was only sleeping two hours a night.
Chloe’s problems began aged 18 when her parents divorced, and she says she began to starve herself in a bid for attention.
She became fixated with eating one 500 calorie meal a day and began obsessively calorie counting.
But a girls holiday to Magaluf in June last year saved her life when her pals noticed how thin she was and told her parents.
The university student, from Ayr, South Ayrshire, is now recovering with the help of private counselling - but feared her illness may have left her infertile.
Chloe said: “When it started, my mum and dad were getting divorced and I wasn’t getting the attention I was used too.
“I started becoming obsessed with food and thought if I lost weight maybe that would get me the attention from my family.
“I started restricting what I was eating, I would eat three normal meals a day but just not overindulge.
“But the weight wasn’t coming off quick enough.
“So I started starving myself all day and then allowed myself to eat one meal at night time which would be around 500 calories.
“I would weigh everything out and find out exactly how many calories were in each thing so I could get it to 500.
“Even when I brushed my teeth, I would only use a tiny bit of toothpaste because I was so worried it would make me put on weight.”
As the illness took hold, Chloe developed a fear of supermarkets - and each trip would end up lasting three hours as she desperately searched for the lowest calorie foods.
She began trawling online grocery stores in a bid to find foods with no calories.
Chloe said: “I developed a phobia of supermarkets, I would find them totally overwhelming to be in.
“I would spend three hours shopping looking at the calorie content of each thing to make sure I got the one with the least in it.
“When I started getting scared to go in them, I would sit at home instead, spending hours on my phone looking at their websites to find food with zero calories.
“I think I was also taunting myself, looking at all the things I couldn’t have.
“It was the same with restaurants, I was scared to eat out.
“If my friends asked me to go for a meal, I would starve myself beforehand, and know the menu off by heart, so I knew exactly what I could get.
“Even when I did eat, I would normally be sick right afterwards.
“It was exhausting and I was always so hungry but the need to be thin kept me going.
“I was so cold all the time, I was only sleeping for about two hours a night, my periods stopped and my hair fell out in massive clumps.
“At one point I was constipated for four weeks.
“I was so weak and tired but was still trying to do 25,000 steps a day while eating no food.
“I would say ‘I will stop when I get to this weight’, but then when I reached it, I would just keep going.
“Then people started noticing I had lost weight and it felt amazing."
But an intervention finally came following a boozy holiday to Magaluf - when Chloe restricted her eating even further to allow for calories from her alcohol consumption.
She said: “When we went on holiday to Magaluf I was drinking so I really tried not to eat anything at all because I was so determined to stay thin.
“But my friends started noticing, so one of the days I ate three chicken nuggets and was sick right away because I just couldn’t live with the guilt.
“When we got home my friends told my parents and that's when I knew I had to make a change.
“The holiday saved my life because that’s when my friends started noticing.
“I was a really bubbly and happy person, who always enjoyed food, no one could believe this happened to me.”
Last July she began seeing a counsellor, and she has now returned to a healthy weight and is enrolled on a course at Glasgow Caledonian University.
She said: “My periods only came back two months ago and I was really worried that I was going to be infertile.
“I had to cut my hair into a bob because it was so thin, and then get extensions to try and make it look thicker because I lost so much.
“But the counselling has helped me cope and I no longer have anxiety and depression because of my eating disorder.
“I still eat a healthy diet but I don’t weigh myself anymore.
"The thoughts can sometimes be there but it’s gradually getting better.”


I am a senior algorithm engineer (algorithm expert) at Ant Group. I am broadly interested in trustworthy AI (privacy, fairness, robustness, etc) and graph-related machine learning topics.
I obtained my Ph.D. from Department of statistics, Fudan University in 2017, supervised by professor Ming Zheng and professor Wen Yu, working on semiparametric statistics and survival analysis.
wuruofan1989 (at) gmail.com
See also
my Google
scholar profiles.


Print the supported API versions on the server, in the form of "group/version"
Examples:
# Print the supported API versions
kubectl api-versions
kubectl api-versions [options]
Use "kubectl options" for a list of global command-line options (applies to all commands).


Hi there,
Just to confirm - we've received the changes you submitted for your stall. We'll review them and let you know when it has been re-approved
and the map has been updated (this can take up to 48 hours if we're busy).
If you didn't make these changes, please drop us an email at
<EMAIL_ADDRESS>right away.
You submitted the following information:
Polling Place: {POLLING_PLACE_NAME}, {POLLING_PLACE_ADDRESS}
Stall Name: {STALL_NAME}
Stall Description: {STALL_DESCRIPTION}
Stall Opening Hours: {STALL_OPENING_HOURS}
Stall Website: {STALL_WEBSITE}
Deliciousness: {DELICIOUSNESS}
Need to make changes to your stall?
If you need to update your stall's details again at any time just click here to send us your changes.
Promoting your stall
If you'd like to promote your stall by linking back to Democracy Sausage you can use this link:
{STALL_PERMALINK}
Best of luck with your fundraising efforts!
Thanks,
Team Democracy Sausage


An .ILB file (introduced in sDraw) is a compressed .bmp (without alpha-channel) or .tga (with alpha-channel). The compression is a bit lossy, since it initially crunches RGB888 (24-bit color) into RGB565 (16-bit color). The alpha channel stays intact (8-bit), if present.
Currently in sDraw, ILB files are mostly useful for images that have alpha-channel.


This sample web application has three goals:
Besides using AngularJS and ASP.NET MVC, this application will also implement Microsoft's ASP.NET Web API services for creating RESTful services. Microsoft's Entity Framework will be used for generating and updating a SQL-Server Express database. This application will also use some dependency injection using NInject. Additionality, A small validation library for .NET called FluentValidation will be used that uses a fluent interface and lambda expressions for building validation business rules and will reside in the business layer.
Mark Caplin has specialized in Information Technology solutions for 30 years. Specializing in full life-cycle development projects for both enterprise-wide systems and Internet/Intranet based solutions. For the past ten years or so, Mark has specialized in the Microsoft .NET framework using both C# and VB.NET as his tools of choice.
A full list of Mark's most popular Code Project articles can be found here. Thank you.


Voting with their Tax Returns
Find the full code and data for this project at GitHub here.
In thinking about the 2016 election, I had a relatively simple question: did Hillary Clinton win among taxpayers? I started with the logic that Clinton won about 3 million more popular votes in the general election than Donald Trump, and used tax returns as a window into the ways that the areas Trump won are different from the areas Clinton won.
If you took all 3,113 counties in the United States, and wanted to try and guess whether a county would cast more votes for Hillary Clinton or Donald Trump, the most important pieces of information to have be the number of people who claim an education-related deduction or credit.
This finding on student loans is part of my ongoing analysis of the intersection of 2016 voting behavior and tax return information.
This analysis was performed using a random forest classifier, which used 124 variables drawn from county-level 2014 IRS data. Variables included aggregate totals and participant counts for each income type and deduction. The dataset was matched by county with the New York Times report of election night votes. Average cross-validated accuracy score using the model’s classification was approximately 0.89 (good!) and an F1 score of 0.88 (not bad!).
Here’s the full output of this classifier after performing a train-test split on the data and evaluating the resulting confusion matrix.
RandomForestClassifier(bootstrap=True, class_weight=None, criterion='gini',
max_depth=None, max_features='auto', max_leaf_nodes=None,
min_impurity_split=1e-07, min_samples_leaf=1,
min_samples_split=2, min_weight_fraction_leaf=0.0,
n_estimators=10, n_jobs=1, oob_score=False, random_state=None,
verbose=0, warm_start=False)
Accuracy Score: 0.89
Cross Val Scores: [ 0.86538462 0.88782051 0.89423077 0.90996785 0.90996785 0.90032154
0.88424437 0.87459807 0.87459807 0.86173633]
Avg cross val: 0.886286998104
Predicted Totals:
class 0: 2623
class 1: 490
Confusion Matrix:
Predicted 1 Predicted 0
Actual 1 52 71
Actual 0 15 641
Classification Report:
precision recall f1-score support
Clinton Lose 0.90 0.98 0.94 656
Clinton Win 0.78 0.42 0.55 123
avg / total 0.88 0.89 0.88 779
To be sure, these groups of voters are qualitatively different in other measurable ways. For instance, the number of farm returns in a county is the next-most impactful feature in the income dataset behind education credits and deductions. Counties with the highest numbers of these returns were the most likely in the data to cast more returns for Trump than Clinton.
The feature ids here don’t mean much, but four in the top six in terms of importance are related to paying for education.
| Feature ID | Importance | Description |
|---|---|---|
| N03230 | 0.054240 | Number of returns with tuition and fees deduction |
| N10960 | 0.053645 | Number of returns with refundable education credits |
| SCHF | 0.038331 | Number of farm returns |
| N07230 | 0.031493 | Number of returns with nonrefundable education expenses |
| N02300 | 0.026453 | Number of returns with unemployment compensation |
| A03230 | 0.026133 | Tuition and fees deduction amount |
| A09400 | 0.025870 | Self-employment tax amount |
But these findings largely conform to the behaviors we might expect of the electorate. Those with higher levels of education (especially those at high-cost liberal arts colleges) are most likely to inhabit counties that vote for Clinton. Farmers were more likely to vote Trump.
Perhaps more interesting are the distinctions that weren’t found in the dataset. Most importantly, total taxable income did not emerge as an especially valuable predictor.
The figure above demonstrates the distribution of income, as separated by Clinton’s margin over Trump (or vice versa). Each blue dot represents a county in which more people voted for Clinton than Trump, and each red dot shows a county with more Trump votes.
While the sheer numbers for the Trump voters are significantly greater - Trump won about 84 percent of US counties - the distribution of incomes is relatively similar between them.
Of the counties that had the highest proportion of votes for independent candidates, 12 of the top 15 are in Utah (the other three are in Idaho), likely a function of the independent candidacy of Evan McMullin, a member of the Mormon church in Utah.
Counties with the highest total gross income per capita include a small town of 499 voters in Texas called McMullen, of whom Trump won 454 votes. Manhattan, NY also cracks the top 3, and voted for Clinton with 87 percent of the vote. The poorest counties also voted heavily for Clinton. Three counties on South Dakota reservations, and one county in Mississippi all voted for her by margins of at least 3-to-1.
A short note on methodology and assumptions:
- Income calculations is based on IRS county-level data from taxes filed for the year 2014 (those typically due by April 15, 2015).
- Taxpayer-level calculations were conducted by assuming that within a county, taxpayers and non-taxpayers voted at the same rate. Thus, to find the number of taxpayers voting for Clinton within a county, this analysis multiplied Clinton’s margin in that county by the total number of tax returns for the county.


{{ include ('partials/page-header-bg.html', { title: 'Getting emotional support' }) }} {{ include ('partials/intro-block.html', { text: 'Fertility treatment can be an emotional rollercoaster so getting support from healthcare professionals and others who can relate to what you’re going through is very important. This page will help you understand the different types of support available and how to access them. ' }) }} {{ include('partials/section-heading.html', { title: 'I have my partner/family and friends to support me, isn’t that enough?', }) }}
Your partner (if you have one), family and friends can of course be a wonderful source of comfort and for some people that’s enough. However, most people find it helpful to get extra support from a counsellor or people who have direct experience of their situation, particularly if that situation is unusual or rare. Meeting and talking to others who can relate to exactly what you’re going through is a type of support your loved ones might not be able to offer.
{{ include('partials/section-heading.html', { title: 'Where can I go for emotional support?', }) }}Because fertility treatment is such a complicated process, all clinics licensed by us must offer you an opportunity to talk to a counsellor before you start treatment. Some clinics offer this for free whilst others charge for it. When you’re researching clinics you might want to ask about this and whether they offer any support groups or opportunities to chat to other patients who are undergoing similar treatment.
Joining a support group is a great way of meeting people with similar circumstances to your own who will understand what you’re going through. Your GP or fertility clinic should be able to advise you on groups in your area, or you can contact Infertility Network UK.
All clinics licensed by us must offer you an opportunity to talk to a counsellor. This will help you to understand exactly what your treatment will involve and how it might affect you and those close to you – now and in the future. This is especially important if you’re thinking about using donated sperm, eggs or embryos or surrogacy arrangements as they involve a lot of complicated issues.
On top of counselling from your clinic, you might want to consider getting additional counselling on the NHS or privately. This will give you more of an opportunity to explore your feelings around fertility treatment more generally, and is something you ca do on your own or with your partner (if you have one). Talk to your GP about getting counselling on the NHS or if you’d prefer to go private, The British Association for Counselling & Psychotherapy (bacp) has a directory of accredited therapists.
There are lots of different support groups, from well-established national networks to informal coffee groups and online forums. These are just a selection of what’s on offer so check to see what’s in your local area.
Fertility Friends offers people free IVF support, including a popular message board where you can talk to others going through fertility treatment. www.fertilityfriends.co.uk
BICA is a professional association for infertility counsellors and counselling in the UK. www.bica.net
Offers information and support to anyone affected by fertility problems. Also has a regularly updated list of support groups on its website. www.infertilitynetworkuk.com
Mumsnet has very active discussion boards on topics including infertility and trying to conceive. It’s a great place to just browse or ask the community your own questions. www.mumsnet.com


TWICE releases their first original English song "What You Waiting For"
by HelloAnonTWICE's Japanese album "&TWICE"was released earlier today and one of the tracks that several listeners raved about was their first all-English song "What You Waiting For".
Here are some reactions both from fans and casual listeners:
What do you think of the song?


internal link
blog.mmo
outgoing link
other event handler
outgoing link (blank)
outgoing link 2
download
download image
void
test
Name
Email
Phone
password
password2
1
2
this is my textarea
Submit
test
test
test
test
test
test
Test Click
Test Click


Before Change
confusion = calc_semantic_segmentation_confusion(pred_labels, gt_labels)
ious = calc_semantic_segmentation_iou(confusion)
pixel_accuracy = np.diag(confusion).sum() / confusion.sum()
mean_pixel_accuracy = np.mean(
np.diag(confusion) / np.sum(confusion, axis=1))
for iou, label_name in zip(ious, camvid_label_names):
After Change
result = eval_semantic_segmentation(pred_labels, gt_labels)
for iu, label_name in zip(result["iou"], camvid_label_names):
print("{:>23} : {:.4f}".format(label_name, iu))
print("=" * 34)
print("{:>23} : {:.4f}".format("mean IoU", result["miou"]))


4.8.9. HOWTO Manage Workstation Infrastructures¶
This chapter describes how to manage client workstations with a SIMP system including GUIs, repositories, virtualization, Network File System (NFS), printing, and Virtual Network Computing (VNC).
Most of the SIMP workstation Puppet modules are not installed on the puppet server by default.
If using the SIMP RPMs, you will need to add these packages to your SIMP server using something like the following code snippet.
class site::workstation_packages{
$package_list = [
'pupmod-simp-gdm',
'pupmod-simp-simp_nfs',
'pupmod-simp-vnc',
'pupmod-simp-libvirt',
'pupmod-simp-gnome'
]
package { $package_list :
ensure => 'latest',
}
}
<IP_ADDRESS>. User Workstation Setup¶
Below is an example class,
/etc/puppetlabs/code/environments/simp/modules/site/manifests/workstation.pp
, that could be used to
set up a user workstation.
class site::workstation {
include 'site::gui'
include 'site::repos'
include 'site::virt'
include 'site::print::client'
# Make sure everyone can log into all nodes.
# If you want to change this, simply remove this line and add
# individual entries to your nodes as appropriate
pam::access::rule { "Allow Users":
comment => 'Allow all users in the "users" group to access the system from anywhere.',
users => ['(users)'],
origins => ['ALL']
}
# General Use Packages
package { [
'pidgin',
'git',
'control-center-extra',
'gconf-editor',
'evince',
'libreoffice-writer',
'libreoffice-xsltfilter',
'libreoffice-calc',
'libreoffice-impress',
'libreoffice-emailmerge',
'libreoffice-base',
'libreoffice-math',
'libreoffice-pdfimport',
'bluefish',
'gnome-media',
'pulseaudio',
'file-roller',
'inkscape',
'gedit-plugins',
'planner'
]: ensure => 'latest'
}
}
<IP_ADDRESS>. Graphical Desktop Setup¶
Below is an example manifest called
/etc/puppetlabs/code/environments/simp/modules/site/manifests/gui.pp
for setting up a graphical
desktop on a user workstation.
class site::gui {
include 'gdm'
include 'gnome'
include 'vnc::client'
# Compiz Stuff
package { [
'fusion-icon',
'emerald-themes',
'compiz-fusion-extras',
'compiz-fusion-extras-gnome',
'vinagre'
]:
ensure => 'latest'
}
}
<IP_ADDRESS>. Workstation Repositories¶
Below is an example manifest called
/etc/puppetlabs/code/environments/simp/modules/site/manifests/repos.pp
for setting up workstation
repositories.
class site::repos {
# Whatever local yumrepo statements you need for installing
# your packages and keeping your systems up to date
}
<IP_ADDRESS>. Virtualization on User Workstations¶
Below is an example manifest called
/etc/puppetlabs/code/environments/simp/modules/site/manifests/virt.pp
for allowing virtualization
on a user workstation.
# We allow users to run VMs on their workstations.
# If you don't want this, just don't include this class.
# If this is installed, VM creation and management is still limited by PolicyKit
class site::virt {
include 'libvirt::kvm'
include 'libvirt::ksm'
include 'network'
network::eth { "em1":
bridge => 'br0',
hwaddr => $facts['macaddress_em1']
}
network::eth { "br0":
net_type => 'Bridge',
hwaddr => $facts['macaddress_em1'],
require => Network::Eth['em1']
}
exec { 'flush_cache_himem':
command => '/bin/echo 1 > /proc/sys/vm/drop_caches',
onlyif => inline_template("/bin/<%= @facts['memoryfree'].split(/\s/)[0].
to_f/@facts['memorysize'].split(/\s/)[0].to_f < 0.2 ? true : false %>")
}
package { 'virt-manager': ensure => 'latest' }
}
To set swappiness values use hiera:
# Settings for swap for creating/running virtual machines
swap::high_swappiness: 80
swap::max_swappiness: 100
<IP_ADDRESS>. Printer Setup¶
Below are example manifests for setting up a printing environment.
<IP_ADDRESS>.1. Setting up a Print Client¶
Below is an example manifest called
/etc/puppetlabs/code/environments/simp/modules/site/manifests/print/client.pp
for setting up a
print client.
class site::print::client inherits site::print::server {
polkit::local_authority { 'print_support':
identity => ['unix_group:*'],
action => 'org.opensuse.cupskhelper.mechanism.*',
section_name => 'Allow all print management permissions',
result_any => 'yes',
result_interactive => 'yes',
result_active => 'yes'
}
package { 'cups-pdf': ensure => 'latest' }
package { 'cups-pk-helper': ensure => 'latest' }
package { 'system-config-printer': ensure => 'present' }
}
<IP_ADDRESS>.2. Setting up a Print Server¶
Below is an example manifest called
/etc/puppetlabs/code/environments/simp/modules/site/manifests/print/server.pp
for setting up a
print server.
class site::print::server {
# Note, this is *not* set up for being a central print server.
# You'll need to add the appropriate IPTables rules for that to work.
package { 'cups': ensure => 'latest' }
service { 'cups':
enable => 'true',
ensure => 'running',
hasrestart => 'true',
hasstatus => 'true',
require => Package['cups']
}
}
<IP_ADDRESS>. VNC Setup¶
Virtual Network Computing (VNC) is a tool that is used to manage desktops and workstations remotely through the standard setup or a proxy.
<IP_ADDRESS>.1. VNC Standard Setup¶
Note
You must have the pupmod-simp-vnc
RPM installed to use VNC on your
system!
To enable remote access via VNC on the system, include vnc::server
in Hiera for the node.
The default VNC setup that comes with SIMP can only be used over SSH and includes three default settings:
| Setting Type | Setting Details |
|---|---|
| Standard | Port: 5901 Resolution: 1024x768@16 |
| Low Resolution | Port: 5902 Resolution: 800x600@16 |
| High Resolution | Port: 5903 Resolution: 1280x1024@16 |
Table: VNC Default Settings
To connect to any of these settings, SSH into the system running the VNC
server and provide a tunnel to <IP_ADDRESS>:<VNC Port>
. Refer to the SSH
client’s documentation for specific instructions.
To set up additional VNC port settings, refer to the code in
/etc/puppetlabs/code/environments/simp/modules/vnc/manifests/server.pp
for examples.
Important
Multiple users can log on to the same system at the same time with no adverse effects; however, none of these sessions are persistent.
To maintain a persistent VNC session, use the vncserver
application on the remote host. Type man vncserver
to reference
the manual for additional details.
<IP_ADDRESS>.2. VNC Through a Proxy¶
The section describes the process to VNC through a proxy. This setup provides the user with a persistent VNC session.
Important
In order for this setup to work, the system must have a VNC server
(vserver.your.domain
), a VNC client (vclnt.your.domain
), and a
proxy (proxy.your.domain
). A vuser
account must also be set up
as the account being used for the VNC. The vuser
is a common user
that has access to the server, client, and proxy.
<IP_ADDRESS>.2.1. Modify Puppet¶
If definitions for the machines involved in the VNC do not already exist
in Hiera, create an /etc/puppetlabs/code/environments/simp/hieradata/hosts/vserv.your.domain.yaml
file. In the client hosts file, modify or create the entries shown in
the examples below. These additional modules will allow vserv to act as
a VNC server and vclnt to act as a client.
VNC Server node
# vserv.your.domain.yaml
classes:
- 'gnome'
- 'mozilla::firefox'
- 'vnc::server'
VNC client node
# vclnt.your.domain.yaml
classes:
- 'gnome'
- 'mozilla::firefox'
- 'vnc::client'
<IP_ADDRESS>.2.2. Run the Server¶
As vuser
on vserv.your.domain
, type vncserver
.
The output should mirror the following:
New ‘vserv.your.domain:<Port Number> (vuser)’ desktop is vserv.your.domain:<Port Number>
Starting applications specified in /home/vuser/.vnc/xstartup
Log file
is /home/vuser/.vnc/vserv.your.domain:<Port Number>.log
Note
Remember the port number; it will be needed to set up an SSH tunnel.
<IP_ADDRESS>.2.3. Set up an SSH Tunnel¶
Set up a tunnel from the client (vclnt), through the proxy server (proxy), to the server (vserv). The table below lists the steps to set up the tunnel.
- On the workstation, type
ssh -l vuser -L 590***<Port Number>*:localhost:590***<Port Number>***proxy.your.domain**
Note
This command takes the user to the proxy.
- On the proxy, type
ssh -l vuser -L 590***<Port Number>*:localhost:590***<Port Number>***vserv.your.domain**
Note
This command takes the user to the VNC server.
Table: Set Up SSH Tunnel Procedure
Note
The port number in 590<Port Number> is the same port number as previously described. For example, if the <Port Number> was 6, then all references below to 590<Port Number> become 5906.
<IP_ADDRESS>.2.4. Set Up Clients¶
On vclnt.your.domain
, type vncviewer localhost:590\ ***<Port
Number>***
to open the Remote Desktop viewer.
<IP_ADDRESS>.3. Troubleshooting VNC Issues¶
If nothing appears in the terminal window, X may have crashed. To
determine if this is the case, type ps -ef | grep XKeepsCrashing
If any matches result, stop the process associated with the command and
try to restart vncviewer
on vclnt.your.domain
.


WAG WEDDING
Rangers WAG Brittany Held getting ready for wedding to Matt Polster with last dress fitting on glam trip to LA
by Chelsea RocksSTUNNING WAG Brittany Held has left her 11.4 thousand Instagram followers guessing after sharing a candid snap to document her last dress fitting, while on a trip home to Los Angeles.
The American beauty flew out to California to finalise details ahead of her wedding to Rangers Star Mike Polster, expected to take place in six weeks time.
She has already hinted that her dress will be made by designer galialahav after posting on June 20 that the designer had "made the dress of my dreams".
The ESPN reporter has cooed over her soon-to-be hubby since he signed for Rangers back in February.
American beauty Held has since posted several snaps of herself and her man in Scotland, dawning a royal blue bikini on a recent trip to California.
She also teased fans with a Drummond Castle 'engagement photo shoot' where she styled a white dress and posed romantically with her beau.
Her captions are a clear sign she is a lady in-love, often referencing fairy-tales as she posts beautiful photos of the happy couple kissing.
However, the dreic Scottish weather wasn't quite what her maid-of-honour had planned for the Bachelorette party as Brittany posted bikini-clad pics of her and her sister at Encore Beach Club, Los Angeles with a white feather bikini and praised the "rowdy-ass women" inn her life.
Glasgow might be home for the young couple, but Brittany has been busy travelling this year with her insta locations documenting trips to Ibiza, California, Indianapolis, Budapest and Las Vegas.
Not one to get too carried away with the high-life, the reporter has often also shared snaps of her dining at casual-pizza parlour Paesano's and enjoyed pre-match pre-drinks in the Louden Tavern on Glasgow's Copland Road.
The stunning duo have hinted they will marry on New Years Day, as she announced the 90 day countdown on October 4th.


Qt5’s built-in MediaPlayer widget is used to handle the decoding of the media files and the system calls to the playback devices. All types of media files is supportted by Qt's plat-form specific media backends in the basic implementation. The essential functionalities, which also translate to individual GUI elements, includes:


In this section you can configure general forum settings.
In General tab you can specify fonts for whole forum or for menu separately. There are around 1000 fonts available. Font list is brought to you from Google Fonts directory.
You have to be connected to the internet to see the whole font list.


My dad is the best.
My dads name is aaron he is 41.
He loves the outdoors same as me.He loves making jokes so do i but i don't know i am making them.
Me and my dads favorite sport is soccer and me and his favorite thing to do in samoa is to go to the waterfall.
My mum is so awesome.
She does everything for me and my siters and brother.
On mondays she takes me to guitar.
Tuesdays she take me and my sister and my brother to swimming.
Wednesday she takes me and my sister and brother to swimming then me and my sister to choir.
Thursday she takes me my sisters and brother to swimming.
Friday she takes my sister to siva.
My mum never get s a break she is a super mum.
Maia is the oldest out of 4.
She loves to read she has over 200 hundred books and if she wanted to she could finish them under one year.
She also loves going to the movies with her friends.
Asha is the second younest.
She is a drama queen but a very nice sometimes.
If you are sad you can count on her to lift your hopes up.
Taiheke is the youngest.
He is the youngest but he gets the most attention
He cries like alittle baby and gets what he wants.
Everyone loves him though


64-year-old cyclist dies in Tampines road accident; driver arrested
SINGAPORE: A 64-year-old cyclist has died following an accident in Tampines on Thursday (Nov 21).
The police said they were alerted at about 8.10am to an accident involving a car and a cyclist at Tampines Avenue 3, before Tampines Street 82.
The unconscious cyclist was taken to Changi General Hospital but died en route from his injuries.
The driver of the car, a 47-year-old man, was subsequently arrested.
Photos circulating on social media showed a pool of blood under a front wheel of a black Mercedes-Benz.
The police said investigations are ongoing.


I'm a producer and multi-instrumentalist who feels most at home working with guitar driven pop music. I'm proficient in Ableton, Logic, and Pro Tools as well as the Waves plugin suite, Melodyne, and Ozone. My preferred MO is to record decisively and mix thoughtfully. Check out my slelected works below! If you have any questions, feel free to send me a message here.


Exercise Solutions¶
import numpy as np
import pandas as pd
from sklearn.tree import DecisionTreeClassifier
from sklearn.neighbors import KNeighborsClassifier
from sklearn.model_selection import train_test_split, cross_validate
from sklearn.impute import SimpleImputer
from sklearn.pipeline import Pipeline, make_pipeline
from sklearn.preprocessing import OneHotEncoder, OrdinalEncoder, StandardScaler, MinMaxScaler
from sklearn.svm import SVC
from sklearn.compose import make_column_transformer
from sklearn.feature_extraction.text import CountVectorizer
Lecture 1¶
Let’s Practice!¶
Are the following supervised or unsupervised problems?
Finding groups of similar properties in a real estate data set.
Unsupervised
Predicting real estate prices based on house features like number of rooms, learning from past sales as examples.
Supervised
Identifying groups of animals given features such as “number of legs”, “wings/no wings”, “fur/no fur”, etc.
Unsupervised
Detecting heart disease in patients based on different test results and history.
Supervised
Grouping articles on different topics from different news sources (something like Google News app).
Unsupervised
Are the following classification or regression problems?
Predicting the price of a house based on features such as number of rooms and the year built.
Regression
Predicting if a house will sell or not based on features like the price of the house, number of rooms, etc.
Classification
Predicting your grade in BAIT 509 based on past grades.
Regression
Predicting whether you should bicycle tomorrow or not based on the weather forecast.
Classification
Predicting a cereal’s manufacturer given the nutritional information.
Classification
Let’s Practice!¶
Using the data candybars.csv
from the datafolder to aswer the following questions:
How many features are there?
8
How many observations are there?
25
What would be a suitable target with this data?
Probably
availability
but we could use the other features as well.
Answer as either fit
or predict
Is called first (before the other one).
fit
Only takes X as an argument.
predict
In scikit-learn, we can ignore its output.In scikit-learn, we can ignore its output.
fit
Quick Questions
What is the top node in a decision tree called?
The root
What Python structure/syntax are the nodes in a decision tree similar to?
If-else statements
candy_df = pd.read_csv('data/candybars.csv',index_col=0)
# Define X and y
X = candy_df.drop(columns=['availability'])
y = candy_df['availability']
# Creating a model
for min_samples_split in [2, 5, 10]:
hyper_tree = DecisionTreeClassifier(random_state=1, min_samples_split=min_samples_split)
hyper_tree.fit(X,y)
print("For min_sample_split =",min_samples_split, "accuracy=", hyper_tree.score(X, y).round(2))
For min_sample_split = 2 accuracy= 0.84
For min_sample_split = 5 accuracy= 0.68
For min_sample_split = 10 accuracy= 0.64
a) Which
min_samples_split
value would you choose to predict this data?
It has the best accuracy with the lowest value of
min_sample_split
.
b) Would you choose the same
min_samples_split
value to predict new data?
No and we will explain this next lecture.
Do you think most of the computational effort for a decision tree takes place in the
.fit()
stage or.predict()
stage?
Most of the computational effort takes places in the .fit() stage, when we create the model.
Lecture 2¶
Let’s Practice¶
When is the most optimal time to split our data?
Before we visualize/explore it.
Why do we split our data?
To help us assess how well our model generalizes.
Fill in the table below:
datasets |
|
|
|
|---|---|---|---|
Train |
✔ |
✔ |
✔ |
Validation |
✔ |
✔ |
|
Test |
Once |
Once |
|
Deployment |
✔ |
Let’s Practice¶
We carry out cross-validation to avoid reusing the same validation set again and again. Let’s say you do 10-fold cross-validation on 1000 examples. For each fold, how many examples do you train on?
900
With 10-fold cross-validation, you split 1000 examples into 10-folds. For each fold, when you are done, you add up the accuracies from each fold and divide by what?
10
True/False:
𝑘-fold cross-validation calls fit 𝑘 times and predict 𝑘 times.
True
Let’s Practice¶
Overfitting or Underfitting:
If our train accuracy is much higher than our test accuracy.
Overfitting
If our train accuracy and our test accuracy are both low and relatively similar in value.
Underfitting
If our model is using a Decision Tree Classifier for a classification problem with no limit on
max_depth
.
Likely overfitting
True or False
In supervised learning, the training score is always higher than the validation score.
False
The fundamental tradeoff of ML states that as training score goes up, validation score goes down.
False
More “complicated” models are more likely to overfit than “simple” ones.
True
If our training score is extremely high, that means we’re overfitting.
False
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']
# 1. Split the dataset
X_train, X_test, y_train, y_test = train_test_split(
X, y, test_size=0.2, random_state=7)
# 2. Create a model
model = DecisionTreeClassifier(max_depth=5)
# 3. Cross validate
scores = cross_validate(model, X_train, y_train, cv=10, return_train_score=True)
# 4. Covert scores into a dataframe
scores_df = pd.DataFrame(scores)
# 5. Calculate the mean value of each column
mean_scores = scores_df.mean()
mean_scores
fit_time 0.002964
score_time 0.001910
test_score 0.832667
train_score 0.957826
dtype: float64
Is your model overfitting or underfitting?
The training score is a little higher than the validation score and thus the model is overfitting.
Lecture 3¶
Let’s Practice¶
Below we have the output of y_train.value_counts()
Position
Forward 13
Defense 7
Goalie 2
dtype: int64
In this scenario, what would a DummyClassifier(strategy='most_frequent')
model predict on the following observation:
No. Age Height Weight Experience Salary
1 83 34 191 210 11 3200000.0
Forward
When using a regression model, which of the following is not a possible return value from .score(X,y) ? a) 0.0 b) 1.0 c) -0.1 d) 1.5
1.5
Below are the values for y
that were used to train DummyRegressor(strategy='mean')
:
Grade
0 75
1 80
2 90
3 95
4 85
dtype: int64
What value will the model predict for every example?
85
Let’s Practice¶
seeds shape sweetness water-content weight fruit_veg
0 1 0 35 84 100 fruit
1 0 0 23 75 120 fruit
2 1 1 15 90 1360 veg
3 1 1 7 96 600 veg
4 0 0 37 80 5 fruit
5 0 0 45 78 40 fruit
6 1 0 27 83 450 veg
7 1 1 18 73 5 veg
8 1 1 32 80 76 veg
9 0 0 40 83 65 fruit
Giving the table above and that we are trying to predict if each example is either a fruit or a vegetable, what would be the dimension of feature vectors in this problem?
5 dimensions!
Which of the following would be the feature vector for example 0.
a)
array([1, 0, 1, 1, 0, 0, 1, 1, 1, 0])
b)
array([fruit, fruit, veg, veg, fruit, fruit, veg, veg, veg, fruit])
c)
array([1, 0, 35, 84, 100])
d)
array([1, 0, 35, 84, 100, fruit])
c)
array([1, 0, 35, 84, 100])
Given the following 2 feature vectors, what is the Euclidean distance between the following two feature vectors?
u = np.array([5, 0, 22, -11]) v = np.array([-1, 0, 19, -9])
7
True or False
Analogy-based models find examples from the test set that are most similar to the test example we are predicting.
False
Feature vectors can only be of length 3 since we cannot visualize past that.
False
A dataset with 10 dimensions is considered low dimensional.
True
Euclidean distance will always have a positive value.
True (0 and positive)
When finding the nearest neighbour in a dataset using
kneighbors()
from thesklearn
library, we mustfit
the data first.
True
Calculating the distances between an example and a query point takes twice as long as calculating the distances between two examples.
False
Let’s practice¶
Consider this toy dataset:
If \(k=1\), what would you predict for \(x=\begin{bmatrix} 0\\0\end{bmatrix}\)?
1
If \(k=3\), what would you predict for \(x=\begin{bmatrix} 0\\0\end{bmatrix}\)?
0
True or False
The classification of the closest neighbour to the test example always contributes the most to the prediction
False
The
n_neighbors
hyperparameter must be less than the number of examples in the training set.
True
Similar to decision trees, \(k\)-NNs find a small set of good features.
False
With \(k\) -NN, setting the hyperparameter \(k\) to larger values typically increases training score.
False
\(k\)-NN may perform poorly in high-dimensional space (say, d > 100)
True
Consider this graph:
What value of
n_neighbors
would you choose to train your model on?
12
Lecture 4 - SVM¶
Let’s Practice¶
If \(k=3\), what would you predict for \(x=\begin{bmatrix} 0\\0\end{bmatrix}\) if we were doing regression rather than classification?
1/3
Let’s practice¶
True or False
1.In Scikit Learn’s SVC classifier, large values of gamma tend to result in higher training scores but probably lower validation scores.
True
2.If we increase both gamma
and C
, we can’t be certain if the model becomes more complex or less complex.
False
Coding practice
Below is some starter code that creates your feature table and target column from the data from the bball.csv
dataset (in the data folder).
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 into 4 objects:
X_train
,X_test
,y_train
,y_test
. Make the test set 0.2 (or the train set 0.8) and make sure to userandom_state=7
.Create an
SVM
model withgamma
equal to 0.1 andC
equal to 10.Cross-validate using cross_validate() on the objects X_train and y_train specifying the model and making sure to use 5 fold cross-validation and
return_train_score=True
.Calculate the mean training and cross-validation scores.
# 1. Split the dataset
X_train, X_test, y_train, y_test = train_test_split(
X, y, test_size=0.2, random_state=7)
# 2. Create a model
model = SVC(gamma=0.1, C=10)
# 3. Cross-validate
scores_df = pd.DataFrame(cross_validate(model,X_train,y_train, cv=5, return_train_score=True))
# 4. Calculate the mean training and cross-validation scores.
print('The mean training score is', scores_df.mean()['train_score'].round(3), 'and the mean validation score is', scores_df.mean()['test_score'].round(3))
The mean training score is 0.996 and the mean validation score is 0.559
Yikes! I wonder how this can be improved?! More on this in the next class :)
Lecture 4 - Pipeline¶
Let’s practice¶
Name a model that will still produce meaningful predictions with different scaled column values.
Decision Tree Algorithm
Complete the following statement: Preprocessing is done ____.
To the model but before training
To the data before training the model
To the model after training
To the data after training the model
To the data before training the model
StandardScaler
is a type of what?
Transformer
What data splits does
StandardScaler
alter (Training, Testing, Validation, None, All)?
All
True or False
Columns with lower magnitudes compared to columns with higher magnitudes are less important when making predictions.
False
A model less sensitive to the scale of the data makes it more robust.
True
Let’s Practice¶
When/Why do we need to impute our data?
When we have missing data.
If we have
NaN
values in our data, can we simply drop the column missing the data?
Yes, if the majority of the values are missing from the column
Which scaling method will never produce negative values?
Normalization (
MinMaxScaler
)
Which scaling method will never produce values greater than 1?
Normalization (
MinMaxScaler
)
Which scaling method will produce values where the range depends on the values in the data?
Standardization (
StandardScaler
)
True or False
6. SimpleImputer
is a type of transformer.
True
Scaling is a form of transformation.
True
We can use
SimpleImputer
to impute values that are missing from numerical and categorical columns.
True
Which of the following steps cannot be used in a pipeline?
Scaling
Model building
Imputation
Data Splitting
Data Splitting
Why can’t we fit and transform the training and test data together?
It’s violating the golden rule.
True or False
3. We have to be careful of the order we put each transformation and model in a pipeline.
True
Pipelines will fit and transform on both the training and validation folds during cross-validation.
False
Let’s bring in the basketball dataset again.
# 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)
Build a pipeline named bb_pipe
that:
Imputes using “median” as a strategy,
scale using
StandardScaler
builds a
KNeighborsClassifier
.
Next, do 5 fold cross-validation on the pipeline using X_train
and y_train
and save the results in an dataframe.
Take the mean of each column and assess your model.
# Build a pipeline
bb_pipe = Pipeline(
steps=[("imputer", SimpleImputer(strategy="median")),
("scaler", StandardScaler()),
("knn", KNeighborsClassifier())])
# Do 5 fold cross-validation on the pipeline using `X_train` and `y_train` and save the results in an dataframe.
cross_scores = pd.DataFrame(cross_validate(bb_pipe, X_train, y_train, return_train_score=True))
# Transform cross_scores to a dataframe and take the mean of each column
# Save the result in an object named mean_scores
mean_scores = cross_scores.mean()
mean_scores
fit_time 0.009682
score_time 0.006163
test_score 0.881633
train_score 0.915306
dtype: float64
Lecture 5¶
Let’s Practice¶
name colour location seed shape sweetness water-content weight popularity
0 apple red canada True round True 84 100 popular
1 banana yellow mexico False long True 75 120 popular
2 cantaloupe orange spain True round True 90 1360 neutral
3 dragon-fruit magenta china True round False 96 600 not popular
4 elderberry purple austria False round True 80 5 not popular
5 fig purple turkey False oval False 78 40 neutral
6 guava green mexico True oval True 83 450 neutral
7 huckleberry blue canada True round True 73 5 not popular
8 kiwi brown china True round True 80 76 popular
9 lemon yellow mexico False oval False 83 65 popular
What would be the unique values given to the categories in the
popularity
column, if we transformed it with ordinal encoding?
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
[0, 1, 2]
[1, 2, 3]
[0, 1, 2, 3]
[0, 1, 2]
Does it make sense to be doing ordinal transformations on the
colour
column?
No
If we one hot encoded the
shape
column, what datatype would be the output after usingtransform
?
NumPy array
Which of the following outputs is the result of one-hot encoding the
shape
column?
a)
array([[0, 1, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 1, 1, 0, 0, 1],
[1, 0, 1, 1, 1, 0, 0, 1, 1, 0]])
b)
array([[0, 0, 1],
[1, 0, 0],
[0, 0, 1],
[0, 0, 1],
[0, 0, 1],
[0, 1, 0],
[0, 1, 0],
[0, 0, 1],
[0, 0, 1],
[0, 1, 0]])
c)
array([[0, 1, 0, 0, 0, 0],
[0, 0, 0, 1, 0, 0],
[0, 0, 0, 0, 1, 0],
[0, 0, 1, 0, 0, 0],
[1, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 1],
[0, 0, 0, 1, 0, 0],
[0, 1, 0, 0, 0, 0],
[0, 0, 1, 0, 0, 0],
[0, 0, 0, 1, 0, 0]])
d)
array([[0],
[5],
[0],
[3],
[0],
[0],
[3],
[0],
[5],
[3],
[1],
[4],
[3],
[2]])
B
On which column(s) would you use
OneHotEncoder(sparse=False, dtype=int, drop="if_binary")
?
seed
,sweetness
True or False?
Whenever we have categorical values, we should use ordinal encoding.
False
If we include categorical values in our feature table,
sklearn
will throw an error.
True
One-hot encoding a column with 5 unique categories will produce 5 new transformed columns.
True
The values in the new transformed columns after one-hot encoding, are all possible integer or float values.
False
It’s important to be mindful of the consequences of including certain features in your predictive model.
True
Let’s Practice¶
Refer to the dataframe to answer the following question.
colour location shape water_content weight
0 red canada NaN 84 100
1 yellow mexico long 75 120
2 orange spain NaN 90 NaN
3 magenta china round NaN 600
4 purple austria NaN 80 115
5 purple turkey oval 78 340
6 green mexico oval 83 NaN
7 blue canada round 73 535
8 brown china NaN NaN 1743
9 yellow mexico oval 83 265
How many categorical columns are there and how many numeric?
3 categoric columns and 2 numeric columns
What transformations are being done to both numeric and categorical columns?
Imputation
Use the diagram below to answer the following questions.
Pipeline(
steps=[('columntransformer',
ColumnTransformer(
transformers=[('pipeline-1',
Pipeline(
steps=[('simpleimputer',
SimpleImputer(strategy='median')),
('standardscaler',
StandardScaler())]),
['water_content', 'weight', 'carbs']),
('pipeline-2',
Pipeline(
steps=[('simpleimputer',
SimpleImputer(fill_value='missing',
strategy='constant')),
('onehotencoder',
OneHotEncoder(handle_unknown='ignore'))]),
['colour', 'location', 'seed', 'shape', 'sweetness',
'tropical'])])),
('decisiontreeclassifier', DecisionTreeClassifier())])
How many columns are being transformed in
pipeline-1
?
3
Which pipeline is transforming the categorical columns?
pipeline-2
What model is the pipeline fitting on?
DecisionTreeClassifier
True or False
6. If there are missing values in both numeric and categorical columns, we can specify this in a single step in the main pipeline.
False
If we do not specify
remainder="passthrough"
as an argument inColumnTransformer
, the columns not being transformed will be dropped.
True
Pipeline()
is the same asmake_pipeline()
butmake_pipeline()
requires you to name the steps.
False
Let’s Practice¶
What is the size of the vocabulary for the examples below?
X = [ "Take me to the river",
"Drop me in the water",
"Push me in the river",
"dip me in the water"]
10
Which of the following is not a hyperparameter of CountVectorizer()
?
binary
max_features
vocab
ngram_range
vocab
What kind of representation do we use for our vocabulary?
Bag of Words
True or False
As you increase the value for the
max_features
hyperparameter ofCountVectorizer
, the training score is likely to go up.
True
If we encounter a word in the validation or the test split that’s not available in the training data, we’ll get an error.
False
Coding Practice¶
We are going to bring in a new dataset for you to practice on. (Make sure you’ve downloaded it from the data
folder from the lectures
section in Canvas).
This dataset contains a text column containing tweets associated with disaster keywords and a target column denoting whether a tweet is about a real disaster (1) or not (0). [Source]
# Loading in the data
tweets_df = pd.read_csv('data/balanced_tweets.csv').dropna(subset=['target'])
# Split the dataset into the feature table `X` and the target value `y`
X = tweets_df['text']
y = tweets_df['target']
# Split the dataset into X_train, X_test, y_train, y_test
X_train, X_test, y_train, y_test = train_test_split(X,y, test_size=0.2, random_state=7)
X_train.head()
3219 Buri handwoven bags : • Buri handbag - Php 280...
3825 Energetic and Comedic Redhead Teen, just seen ...
1544 A 63 year old man charged in connection with a...
1050 Water levels in Venice drastically drop two mo...
296 2 buildings on fire at seminole State College ...
Name: text, dtype: object
Make a pipeline with
CountVectorizer
as the first step andSVC()
as the second.Perform 5 fold cross-validation using your pipeline and return the training score.
Convert the results into a dataframe.
What are the mean training and validation scores?
Train your pipeline on the training set.
Score the pipeline on the test set.
# 1. Make a pipeline with `CountVectorizer` as the first step and `SVC()` as the second
pipe = make_pipeline(CountVectorizer(), SVC())
# 2. Perform 5 fold cross-validation using your pipeline and return the training score
cv_scores = cross_validate(pipe, X_train, y_train, return_train_score=True)
# 3. Convert the results into a dataframe
cv_scores_df = pd.DataFrame(cv_scores)
# 4. What are the mean training and validation scores?
print('Mean training score:', cv_scores_df.mean()['train_score'])
print('Mean Validation score:', cv_scores_df.mean()['test_score'])
# 5. Train your pipeline on the training set
pipe.fit(X_train, y_train)
# 6. Score the pipeline on the test set
tweet_test_score = pipe.score(X_test, y_test)
print('Test score:', tweet_test_score)
Mean training score: 0.9821853538313572
Mean Validation score: 0.8326422696721526
Test score: 0.83451536643026
Lecture 6¶
Let’s Practice¶
Using Naive bayes by hand, what class would naive Bayes predict for the second example “I like Sauder”.
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
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 |
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¶
Prior probability: \(P(\text{spam}) = 3/6\)
Conditional probabilities:
\(P(\text{free} = 0 \mid \text{spam}) = 1/3\)
\(P(\text{prize} = 0 \mid \text{spam}) = 1/3\)
\(P(\text{sauder} = 1 \mid \text{spam}) = 0/3\)
\(P(\text{urgent} = 0 \mid \text{spam}) = 1/3\)
\(P(\textrm{spam}|\text{free} = 0, \text{prize} = 0, \text{sauder} = 1, \text{urgent} = 0) = P(\text{free} = 0|\textrm{spam})*P(\text{prize} = 0|\textrm{spam})*P(\textrm{sauder = 1}|\textrm{spam})*P(\text{urgent} = 0|\textrm{spam})*P(\textrm{spam})\)
\(= \frac{1}{3} * \frac{1}{3}* \frac{0}{3} * \frac{1}{3} *\frac{3}{6} \)
\( = 0\)
non spam¶
Prior probability: \(P(\text{non spam}) = 3/6\)
Conditional probabilities:
\(P(\text{free} = 0 \mid \text{non spam}) = 3/3\)
\(P(\text{prize} = 0 \mid \text{non spam}) = 3/3\)
\(P(\text{sauder} = 1 \mid \text{non spam}) = 2/3\)
\(P(\text{urgent} = 0 \mid \text{non spam}) = 3/3\)
\(P(\textrm{non spam}|\text{free} = 0, \text{prize} = 0, \text{sauder} = 1, \text{urgent} = 0) = P(\text{free} = 0|\textrm{non spam})*P(\text{prize} = 0|\textrm{non spam})*P(\textrm{sauder = 1}|\textrm{non spam})*P(\text{urgent} = 0|\textrm{non spam})*P(\textrm{non spam})\)
\(= \frac{3}{3} * \frac{3}{3}* \frac{2}{3} * \frac{3}{3} *\frac{3}{6} \)
\( = 1/3\)
Final Class¶
CLASS AS: non spam
Let’s Practice¶
Which method will attempt to find the optimal hyperparameter for the data by searching every combination possible of hyperparameter values given?
Exhaustive Grid Search (
GridSearchCV
)
Which method gives you fine-grained control over the amount of time spent searching?
Randomized Grid Search (
RandomizedSearchCV
)
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?
\(3 * 3 * 3 = 27\)
True or False
A Larger
n_iter
will take longer but will search over more hyperparameter values.
True
Automated hyperparameter optimization can only be used for multiple hyperparameters.
False
Coding Practice¶
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.
# 1. Build a grid of the parameters you wish to search.
param_grid = {
"knn__n_neighbors" : [1, 5, 10, 20, 30, 40, 50],
"knn__weights" : ['uniform', 'distance']
}
# 2. Conduct grid search with 10 fold cross-validation
grid_search = GridSearchCV(bb_pipe, param_grid, cv=10, verbose=2, n_jobs=-1)
# 3. Train your pipeline with grid search.
grid_search.fit(X_train, y_train)
# 4. Find the best hyperparameter values.
best_hyperparams = grid_search.best_params_
print(best_hyperparams)
# 5. Lastly, score your model on the test set.
bb_test_score = grid_search.score(X_test, y_test)
bb_test_score
Fitting 10 folds for each of 14 candidates, totalling 140 fits
[Parallel(n_jobs=-1)]: Using backend LokyBackend with 8 concurrent workers.
[Parallel(n_jobs=-1)]: Done 25 tasks | elapsed: 2.0s
{'knn__n_neighbors': 40, 'knn__weights': 'uniform'}
[Parallel(n_jobs=-1)]: Done 140 out of 140 | elapsed: 2.2s finished
0.9193548387096774
Lecture 7¶
Let’s Practice¶
What is the name of a well-known
Ridge
hyperparameter?
alpha
What value of this hyperparameter makes it equivalent to using
LinearRegression
?
0
Use the following equation to answer the questions below:
What is our intercept value?
0.5
If I had 2 laptops 3 pencils in my backpack, what weight would my model predict for my backpack?
7.44
True or False:
5. Ridge is a regression modelling approach.
True
Increasing the hyperparameter from Question 1 increases model complexity.
False
Ridge
can be used with datasets that have multiple features.
True
With
Ridge
, we learn one coefficient per training example.
False
Coefficients can help us interpret our model even if unscaled.
True
Let’s Practice¶
We have the following text, which we wish to classify as either a positive or negative movie review.
Using the words below (which are features in our model) with associated coefficients, answer the next 2 questions.
The input for the feature value is the number of times the word appears in the review.
Word |
Coefficient |
|---|---|
excellent |
2.2 |
disappointment |
-2.4 |
flawless |
1.4 |
boring |
-1.3 |
unwatchable |
-1.7 |
Intercept = 1.3
What value do you calculate after using the weights in the model above for the above review?
I thought it was going to be excellent but instead, it was unwatchable and boring.
The input feature value would be the number of times the word appears in the review (like CountVectorizer
).
0.5
Would the model classify this review as a positive or negative review (classes are specified alphabetically) ?
Positive review
We are trying to predict if a job applicant would be hired based on some features contained in their resume.
Below we have the output of .predict_proba()
where column 0 shows the probability the model would predict “hired” and column 1 shows the probability the model would predict “not hired”.
array([[0.04971843, 0.95028157],
[0.94173513, 0.05826487],
[0.74133975, 0.25866025],
[0.13024982, 0.86975018],
[0.17126403, 0.82873597]])
Use this output to answer the following questions.
If we had used
.predict()
for these examples instead of.predict_proba()
, how many of the examples would the model have predicted “hired”?
2
If the true class labels are below, how many examples would the model have correctly predicted with
predict()
?
['hired', 'hired', 'hired', 'not hired', 'not hired']
4
True or False?
5. Increasing logistic regression’s C
hyperparameter increases the model’s complexity.
True
Unlike with
Ridge
regression, coefficients are not interpretable with logistic regression.
. False
predict
returns the positive class if the predicted probability of the positive class is greater than 0.5.
True
In logistic regression, a function is applied to convert the raw model output into probabilities.
True
Coding Problem
Let’s import the Pokémon dataset from our data
folder. We want to see how well our model does with logistic regression. Let’s try building a simple model with default parameters.
pk_df = pd.read_csv('data/pokemon.csv')
train_df, test_df = train_test_split(pk_df, test_size=0.2, random_state=1)
X_train = train_df.drop(columns=['legendary'])
y_train = train_df['legendary']
X_test = test_df.drop(columns=['legendary'])
y_test = test_df['legendary']
numeric_features = ["attack",
"defense" ,
"sp_attack",
"sp_defense",
"speed",
"capture_rt"]
drop_features = ["type", "deck_no", "gen", "name", "total_bs"]
numeric_transformer = make_pipeline(
SimpleImputer(strategy="median"),
StandardScaler())
preprocessor = make_column_transformer(
("drop", drop_features),
(numeric_transformer, numeric_features))
Build and fit a pipeline containing the column transformer and a logistic regression model using the parameter class_weight=”balanced” (you will learn about this in lecture 9!).
Score your model on the test set.
Find the model’s feature coefficients and answer the below questions a. Which feature contributes the most in predicting if an example is legendary or not. b.As the capture rate value increases, will the model more likely predict a legendary or not legendary Pokémon?
# 1. Build a pipeline containing the column transformer and a Logistic Regression model
# use the parameter class_weight="balanced"
pkm_pipe = make_pipeline(preprocessor, LogisticRegression(class_weight="balanced"))
# 1. Fit your pipeline on the training data
pkm_pipe.fit(X_train, y_train);
# 2. Score your model on the test set
lr_scores = pkm_pipe.score(X_test, y_test)
print("logistic Regression Test Score:", lr_scores)
# Find the model’s feature coefficients
pkm_coefs = pd.DataFrame({'features':numeric_features, 'coefficients':pkm_pipe['logisticregression'].coef_[0]})
pkm_coefs
logistic Regression Test Score: 0.9006211180124224
| features | coefficients | |
|---|---|---|
| 0 | attack | 0.690834 |
| 1 | defense | 1.126300 |
| 2 | sp_attack | 1.026617 |
| 3 | sp_defense | 0.655162 |
| 4 | speed | 1.116679 |
| 5 | capture_rt | -0.792950 |
a. Which feature contributes the most in predicting if an example is legendary or not.
defense
, this feature has the highest magnitude!
b.As the capture rate value increases, will the model more likely predict a legendary or not legendary Pokémon?
Not Legendary, since the sign of the coefficient is negative.
Lecture 8¶
Let’s Practice¶
What question is usually more complex?
Business question/objective
What model needs to be made for all problems?
Baseline - Dummy
In supervised learning, once we have our business objective, part of our statistical question is identifying what?
Our target variable
True or False:
When writing your reports, it’s important to consider who is reading it.
True
Sometimes you may need to dig a little to figure out exactly what the client wants.
True
In supervised learning, we should take into consideration the uncertainty of our models.
True
Let’s Practice¶
As we increase features, which score will always increase?
Training score
Between
RFE
andRFECV
which one finds the optimal number of features for us?
RFECV
Which method starts with all our features and iteratively removes them from our model?
Recursive Feature Elimination
Which method starts with no features and iteratively adds features?
Forward Selection
Which method does not take into consideration
feature_importance
when adding/removing features?
Forward Selection
Lecture 9¶
Let’s Practice¶
Use the diagram above to answer the next …. questions.
How many examples did the model of this matrix correctly label as “Guard”?
26
If Forward is the positive label, how many false-positive values are there?
4
How many examples does the model incorrectly predict?
7
What is the recall of the confusion matrix assuming that Forward is the positive label?
0.86
19/22
What is the precision of the confusion matrix assuming that Forward is the positive label?
0.83 19/23
What is the f1 score assuming that Forward is the positive label?
0.84 2* (0.86*0.83)/ (0.86 + 0.83) = 0.84
True or False:
In spam classification, false positives are more damaging than false negatives (assume “positive” means the email is spam, “negative” means it’s not).
True
In medical diagnosis, high recall is more important than high precision.
True
The weighted average gives equal importance to all classes.
False
Setting
class_weight={1:100}
will make the second class label 100 times the weight of the first class.
False
Let’s Practice¶
Which measurement will have units which are the square values of the target column units?
MSE
For which of the following is it possible to have negative values?
\(R^2\)
Which measurement is expressed as a percentage?
MAPE
Calculate the MSE from the values given below.
Observation |
True Value |
Predicted Value |
|---|---|---|
0 |
4 |
5 |
1 |
12 |
10 |
2 |
6 |
9 |
3 |
9 |
8 |
4 |
3 |
3 |
3
True or False:
We can still use recall and precision for regression problems but now we have other measurements we can use as well.
False
A lower RMSE value indicates a better fit.
True
In regression problems, calculating \(R^2\) using
r2_score()
and.score()
(with default values) will produce the same results.
True
Let’s Practice¶
True or False:
The
scoring
argument only acceptsstr
inputs.
False
We are limited to the scoring measures offered from sklearn.
False
If we specify the scoring method in
GridSearchCV
andRandomizedSearchCV
,best_param_
will return the parameters with the highest specified measure.*
True
Coding Question
Let’s bring back the Pokémon dataset that we saw previously.
This time let’s look at the distribution of our target variable legendary
.
from sklearn.model_selection import train_test_split
pk_df = pd.read_csv('data/pokemon.csv')
train_df, test_df = train_test_split(pk_df, test_size=0.2, random_state=1)
X_train_big = train_df.drop(columns=['legendary'])
y_train_big = train_df['legendary']
X_test = test_df.drop(columns=['legendary'])
y_test = test_df['legendary']
X_train, X_valid, y_train, y_valid = train_test_split(X_train_big,
y_train_big,
test_size=0.3,
random_state=123)
print(y_train.value_counts())
0 405
1 43
Name: legendary, dtype: int64
Let’s do cross-validation and look at the scores from cross-validation of not just accuracy, but precision and recall and the f1 score as well.
Build a pipeline containing the column transformer and an SVC model and set
class_weight="balanced"
in the SVM classifier.Perform cross-validation using cross-validate on the training split using the scoring measures accuracy, precision, recall and f1.
Save the results in a dataframe.
pk_df = pd.read_csv('data/pokemon.csv')
train_df, test_df = train_test_split(pk_df, test_size=0.2, random_state=1)
X_train = train_df.drop(columns=['legendary'])
y_train = train_df['legendary']
X_test = test_df.drop(columns=['legendary'])
y_test = test_df['legendary']
numeric_features = ["deck_no",
"attack",
"defense" ,
"sp_attack",
"sp_defense",
"speed",
"capture_rt",
"total_bs"]
categorical_features = ["type"]
numeric_transformer = make_pipeline(SimpleImputer(strategy="median"), StandardScaler())
categorical_transformer = make_pipeline(
SimpleImputer(strategy="most_frequent"),
OneHotEncoder(handle_unknown="ignore"))
preprocessor = make_column_transformer(
(numeric_transformer, numeric_features),
(categorical_transformer, categorical_features))
# 1. Build a pipeline containing the column transformer and an SVC model,
# using the parameter class_weight="balanced".
main_pipe = make_pipeline(preprocessor, SVC(class_weight="balanced"))
# 2. Perform cross-validation using cross-validate on the training split using the scoring
# measures accuracy, precision, recall and f1.
multi_scores = cross_validate(main_pipe,
X_train, y_train,
return_train_score=True,
scoring = ['accuracy', 'precision', 'recall'])
# 3. Save the results in a dataframe.
pd.DataFrame(multi_scores)
| fit_time | score_time | test_accuracy | train_accuracy | test_precision | train_precision | test_recall | train_recall | |
|---|---|---|---|---|---|---|---|---|
| 0 | 0.017855 | 0.011000 | 0.921875 | 0.972656 | 0.500000 | 0.754386 | 0.600000 | 1.0 |
| 1 | 0.014644 | 0.009241 | 0.984375 | 0.976562 | 0.833333 | 0.781818 | 1.000000 | 1.0 |
| 2 | 0.014496 | 0.008741 | 0.921875 | 0.984375 | 0.545455 | 0.840000 | 0.545455 | 1.0 |
| 3 | 0.020357 | 0.014639 | 0.953125 | 0.980469 | 0.647059 | 0.807692 | 1.000000 | 1.0 |
| 4 | 0.013667 | 0.008995 | 0.968750 | 0.970703 | 0.733333 | 0.736842 | 1.000000 | 1.0 |
Lecture 10¶
Let’s Practice¶
Which wrapper is more computationally expensive?
One-vs-One
Name a model that can handle multi-class problems without any issues or needing any additional strategies.
Decision Trees, K-nn
If I have 6 classes, how many models will be built if I use the One-vs-Rest strategy?
6
If I have 6 classes, how many models will be built if I use the One-vs-One strategy?
\(6(5)/2 = 15\)
Use the diagram below to answer the next few questions:
How many examples did the model correctly predict?
52
How many examples were incorrectly labeled as
G
?
3
How many
F-C
labels were in the data?
6
True or False:
8. Decision Trees use coefficients for multi-class data.
False
Using 1 target label as the positive class will make all other target labels negative.
True


--- layout: page title: About date: 2014-09-20 20:22:14.000000000 -04:00 categories: [] tags: [] status: publish type: page published: true meta: geo_public: '0' _publicize_pending: '1' _edit_last: '9432974' _wp_page_template: default _oembed_3be7214e2e2caeffa3f36f30f3efe2b0: "{{unknown}}" original_post_id: '19' _wp_old_slug: '19' author: login: willmitchell777 email<EMAIL_ADDRESS>display_name: Will Mitchell first_name: '' last_name: '' excerpt: !ruby/object:Hpricot::Doc options: {} ---
Hi. I am Will Mitchell, a software developer. I build high performance software teams. I spent most of the last decade leading a number of software development research and development projects at Noblis, where we did some solid work in biometrics, graph analytics, and Bitcoin.
I am currently running a startup in the housing rentals space. As a part of this process, I am growing a team with top-notch skills in application development. We are available for select consulting assignments.
Some people in the software field may say that "mobile changes everything"; but my view is that mobile was the thing that caused the web platform itself to change. Modern apps are different than websites; they are apps the truly run in the browser. The way these apps (called Single Page Applications) is very different than the way we used to build websites. This is a once-per decade sort of shift, in my opinion.
App3 is all about bringing new and profitable business ideas to life.
Please feel free to contact me via Linked In or at will dot mitchell at gmail dot com.


Happy Birthday loser. Click
here
for your present.
×
First you gotta pass.
Who is Mom and Dad's favorite?
Sean
Sarah
Kate
Other
Submit