Urdu Basic generated from template. This keyboard layout is designed for Urdu. It includes an on screen keyboard which can be viewed by clicking on the Keyman icon and selecting the On Screen Keyboard menu item. The keyboard layout follows the Windows 10 Urdu layout.
(c) 2008-2019 SIL International


--- layout: page title: About header-img: "img/about-bg.png" ---
Currently working as .Net Developer and trying to explore more about the field required to explore the main goal i.e. AI


Base project to kickstart your Enterprise AngularJS projects. Based on ng-boilerplate, require-js as one of key components, intelligent build system and best recommended web and angular libraries.
Kickstarts your project quickly, with everything you need, so you can focus on your app.
JavaScript framework that augments browser-based, single-page applications with MVC functionality. More »
AMD Modules management, script loading and sorting handled out for you. Allow to have better code structures and less pains as your app grows. More »
A complete build system implemented in Grunt providing most of the common required tasks for projects.
Modularization proposal based on AngularJS+RequireJS which allows application to increase in size and complexity.
Sleek, intuitive, and powerful front-end framework for faster and easier web development. More »
AngularUI Router / Bootstrap integration. AngularUI Router provides and enhanced router mechanism. AngularUI Bootstrap provides pure AngularJS components for Bootstrap More »
The dynamic stylesheet language that extends CSS with efficiency.
Provides out-of-box web server configuration have your project running at your fingertips.
Be able to test your site on both unit and e2e testing.


This is a hobby project that I created on my own.
The basic idea is to ping a URL and see if it
a) responds with a 200
b) if that response contains the text that you're expecting.
Actually though, I mostly wanted to experiment with merging Node.js and Spring Boot into a self-contained application. This app uses Spring Boot, Webpack, Node, React, Bootstrap, and a few other modules.
You can find more info on the GitHub repo or by emailing derrek @ derrek.young.com


--- layout: post authors: ["Greg Wilson"] title: "Welcome Aboard" date: 2014-12-23 time: "16:00:00" tags: ["Teaching", "Community"] ---
A lot of people qualified as instructors this fall and winter, thanks in part to the live sessions we ran in Charlottesville, Norwich, and Seattle. They join the 86 other people who received their badge this year; we look forward to seeing them all run workshops before 2015 is over.
| Matthew Aiello-Lammens | James Allen | Mario Antonioletti | Radovan Bast |
| Dana Bauer | Lukas Blakk | Carl Boettiger | Jessica Bonnie |
| Darren Boss | Scott Burns | Jared Camins-Esakov | Greg Caporaso |
| Ruth Collings | Marianne Corvellec | Logan Cox | Maciej Czuchry |
| Rob Davey | Matthew Dimmock | Martin Durant | Dureid El-Moghraby |
| John Fonner | Philip Fowler | Jonathan Frederic | Zhuo Fu |
| Emilia Gan | Chris Gates | Laurent Gatto | Gerard Gorman |
| John Gosset | Alistair Grant | Jonathan Gross | Thomas Guignard |
| Jiarong Guo | Jonathan Guyer | Anthony Harrison | Ian Hawke |
| Ian Henry | Kate Hertweck | James Hiebert | Cody Hinchliff |
| Daisie Huang | Devasena Inupakutika | Zbigniew Jedrzejewski-Szmek | Jan Kim |
| Alexander Koeppel | Olivier Lafleur | Isabelle Laforest-Lapointe | Sherry Lake |
| David LeBauer | Kate Lee | Dan MacLean | Gary Macindoe |
| Catherine McGoveran | Francois Michonneau | Aleksandra Nenadic | Jens Nielsen |
| Klemens Noga | Alan O'Cais | Aaron O'Leary | Kirill Palamartchouk |
| Mariela Perignon | Timothee Poisot | Tom Pollard | Saravanan Ramalingam |
| Janet Riley | Natalie Robinson | Dale Russell | Maneesha Sane |
| Brent Shambaugh | Jennifer Shelton | Yu-Ching Shih | Sarah Simpkin |
| Daniel Smith | Ashwin Srinath | Peter Steinbach | Mark Stillwell |
| Jonathan Strootman | Andrew Teucher | Robert Till | Olav Vahtras |
| Andrew Walker | Dan Warren | Leah Wasser | Asela Wijeratne |
| Qingpeng Zhang | Tiziano Zito |


{% extends "layout.html" %} {% block page_title %} GOV.UK prototyping kit {% endblock %} {% block propositionHeader %} {% include "includes/propositional_navigation.html" %} {% endblock %} {% block content %} {% include "includes/main_nav.html" %} Provision - Mr J Smith {% set currentClaimantPage = 'provision' %} {% include "includes/summary_nav.html" %} Provision type Select Work experience Start date DD MM YYYY Day Month Year Start status Confirmed Did not start End date DD MM YYYY Day Month Year Outcome Completed Early leaver Dismissed {% endblock %}
DD MM YYYY


BBC staff say there's a 'six-chip rule' in canteen - and servers are counting them
Arif Ansari, head of news for BBC Asian Network, tweeted a picture showing a handful of chips - and there's 'uproar' over the move
by Keiran Southern'Chip-gate' is engulfingt he BBC with claiming the corporation has introduced a "six chip" rule in their canteen.
Bemused workers said servers were "counting out" fries on Friday, leading to "uproar" among staff.
Several shared their annoyance on social media about the move at the London HQ.
Arif Ansari, head of news for BBC Asian Network, tweeted a picture showing a handful of chips next to a piece of chicken.
He wrote: "New rules in the BBC canteen limit the number of chips to six! The staff seemed shocked that I didn't go with the unlimited couscous instead."
Some replies said: "Would they have got away with serving just 6 chips when you were up North?"
While another said: "They are quite big chips though".
And one wag added: "Go find a BBC Editor....most of them have spare chips on their shoulder..."
Dom Stirling, a freelance radio producer at the BBC, added: "There is currently uproar in the canteen as the '6 chip rule' is introduced... In which servers are instructed to individually count out 6 chips per person.
"I wish this was a joke."
The BBC denied any such rule had been introduced.
The official Twitter account of its press office shared a picture of a food box containing at least nine chips.
It said: "There's something a little fishy about this as there is definitely no six-chip rule (see today's lunch for evidence!) - we don't want to get chippy about it but we're frying to get to the bottom of it."


GATTACA ** (out of four)
starring Ethan Hawke, Uma Thurman, Alan Arkin, Jude Law written and directed by Andrew Niccol
How I wanted to love Gattaca. From its bizzare opening credit sequence, in which we see nail clippings and stubble fall to a neon blue ground in slow motion, we know we're in store for unusual Hollywood fare. But as with many directorial debuts (Niccol was given a chance to direct based on the originality of his screenplay), Gattaca falls short not in ambition but in execution.
Hawke stars as Vincent, a custodian in "the not so distant future", who dreams of becoming an astronaut. High hopes, indeed, for in this future births are genetically manipulated to help conceive "perfect" children, and our naturally birthed hero has both myopia and a heart condition which prevent him from becoming anything more than a second-class citizen. "In the future, discrimination has come down to a science," he intones in (seemingly endless) narration.
Enter Jerome (Law), a "valid" citizen recently left paralyzed from a car accident. He'll assist Vincent by donating his perfect blood and perfect urine for a price, a price which the desperate janitor gladly accepts. A few months later, Vincent, now calling himself Jerome, is an eager executive of the Gattaca Aerospace Corporation, welcome in the rooms he was once only allowed to sweep. But when the Mission Director's murder coincides with "Jerome"'s promotion to astronaut, Vincent worries in the act of investigation his true identity may be uncovered.
To his credit, Niccol sets about telling his complex story in a simple manner, with emphasis on emotions and not science. But said story is also repetitive, clicheed, and a romantic subplot between Vincent and Irene (Thurman) is oddly unerotic and unsentimental. Yes, they're essentially clones, but they're not robots! It doesn't help that Uma Thurman is weightless as an actress, upstaged by her own beauty. The most effective performance comes from Law, who in a few broad strokes creates a realistic, sympathetic, tragic figure worthy of a better film.
And, while no plot string is left untied, there are too many endings and pat resolutions. More often than not lately I find myself wanting a film to finish twenty minutes before it does (Ransom is a perfect recent example), and Gattaca is no exception. Though I will have fond memories of Michael Nyman's lovely score, some of the production design, and the performances of Ethan Hawke and Jude Law, I will always recall Gattaca as having, like its main character, too many flaws to be taken seriously.
-by Bill Chambers
NEW MOVIE REVIEWS: The Sweet Hereafter, Suicide Kings & more at: Film Freak Central: http://www.geocities.com/Hollywood/Set/7504
The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).
The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.
Please direct comments/criticisms of the review to relevant newsgroups.
Broken URLs inthe reviews are the responsibility of the author.
The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.
Related links: index of all rec.arts.movies.reviews reviews


[gecode-users] Why are my variables not constrained
Guido Tack
tack at ps.uni-sb.de
Sat Oct 4 16:44:21 CEST 2008
Hi!
This problem is going to be in the FAQ we're preparing... ;-)
When you post a constraint, only the immediate consequences are
sometimes propagated to the variables. You have to start constraint
propagation by asking the space for its status (using the status()
function). And of course even then, not all logical consequences of
the constraints are propagated to the variables, as propagation is not
complete. You have to use search in order to find actual solutions or
prove that there is none.
> branch(this, x, INT_VAR_SIZE_MIN, INT_VAL_SPLIT_MAX);
> (PS: How do i branch on a single variable (BoolVar y) and where can i
> find such information by myself)
You have to create a BoolVarArgs of size 1, let's call it bva, and set
bva[0] = b if b is the BoolVar you want to branch on. To find this
kind of information, we can currently only advise you to look at the
examples that come with Gecode, and the API documentation. In this
case, the documentation of branch tells you it needs BoolVarArgs.
Cheers,
Guido
More information about the gecode-users
mailing list


Class: Aws::RDSDataService::Types::ExecuteStatementRequest
| Relationships & Source Files | |
| Super Chains via Extension / Inclusion / Inheritance | |
|
Class Chain:
self,
Struct
|
|
|
Instance Chain:
self,
::Aws::Structure ,
Struct
|
|
| Inherits: |
Struct
|
| Defined in: | gems/aws-sdk-rdsdataservice/lib/aws-sdk-rdsdataservice/types.rb |
Overview
The request parameters represent the input of a request to run a SQL statement against a database.
Constant Summary
Instance Attribute Summary
-
#continue_after_timeout ⇒ Boolean
rw
A value that indicates whether to continue running the statement after the call times out.
-
#database ⇒ String
rw
The name of the database.
-
#format_records_as ⇒ String
rw
A value that indicates whether to format the result set as a single JSON string.
-
#include_result_metadata ⇒ Boolean
rw
A value that indicates whether to include metadata in the results.
-
#parameters ⇒ Array<Types::SqlParameter>
rw
The parameters for the SQL statement.
-
#resource_arn ⇒ String
rw
The Amazon
::Aws::RDSDataService::Resource
Name (ARN) of the Aurora Serverless DB cluster. -
#result_set_options ⇒ Types::ResultSetOptions
rw
Options that control how the result set is returned.
-
#schema ⇒ String
rw
The name of the database schema.
-
#secret_arn ⇒ String
rw
The ARN of the secret that enables access to the DB cluster.
-
#sql ⇒ String
rw
The SQL statement to run.
-
#transaction_id ⇒ String
rw
The identifier of a transaction that was started by using the
BeginTransaction
operation.
Instance Method Summary
::Aws::Structure
- Included
| #to_hash | Alias for Structure#to_h. |
Instance Attribute Details
#continue_after_timeout ⇒ Boolean
(rw)
A value that indicates whether to continue running the statement after the call times out. By default, the statement stops running when the call times out.
# File 'gems/aws-sdk-rdsdataservice/lib/aws-sdk-rdsdataservice/types.rb', line 497
class ExecuteStatementRequest < Struct.new( :resource_arn, :secret_arn, :sql, :database, :schema, :parameters, :transaction_id, :, :continue_after_timeout, :, :format_records_as) SENSITIVE = [] include Aws::Structure end
#database ⇒ String
(rw)
The name of the database.
# File 'gems/aws-sdk-rdsdataservice/lib/aws-sdk-rdsdataservice/types.rb', line 497
class ExecuteStatementRequest < Struct.new( :resource_arn, :secret_arn, :sql, :database, :schema, :parameters, :transaction_id, :, :continue_after_timeout, :, :format_records_as) SENSITIVE = [] include Aws::Structure end
#format_records_as ⇒ String
(rw)
A value that indicates whether to format the result set as a single
JSON string. This parameter only applies to SELECT
statements and
is ignored for other types of statements. Allowed values are NONE
and JSON
. The default value is NONE
. The result is returned in
the formattedRecords
field.
For usage information about the JSON format for result sets, see Using the Data API in the Amazon Aurora User Guide.
# File 'gems/aws-sdk-rdsdataservice/lib/aws-sdk-rdsdataservice/types.rb', line 497
class ExecuteStatementRequest < Struct.new( :resource_arn, :secret_arn, :sql, :database, :schema, :parameters, :transaction_id, :, :continue_after_timeout, :, :format_records_as) SENSITIVE = [] include Aws::Structure end
#include_result_metadata ⇒ Boolean
(rw)
A value that indicates whether to include metadata in the results.
# File 'gems/aws-sdk-rdsdataservice/lib/aws-sdk-rdsdataservice/types.rb', line 497
class ExecuteStatementRequest < Struct.new( :resource_arn, :secret_arn, :sql, :database, :schema, :parameters, :transaction_id, :, :continue_after_timeout, :, :format_records_as) SENSITIVE = [] include Aws::Structure end
#parameters ⇒ Array
<Types::SqlParameter> (rw)
The parameters for the SQL statement.
# File 'gems/aws-sdk-rdsdataservice/lib/aws-sdk-rdsdataservice/types.rb', line 497
class ExecuteStatementRequest < Struct.new( :resource_arn, :secret_arn, :sql, :database, :schema, :parameters, :transaction_id, :, :continue_after_timeout, :, :format_records_as) SENSITIVE = [] include Aws::Structure end
#resource_arn ⇒ String
(rw)
The Amazon ::Aws::RDSDataService::Resource
Name (ARN) of the Aurora Serverless DB cluster.
# File 'gems/aws-sdk-rdsdataservice/lib/aws-sdk-rdsdataservice/types.rb', line 497
class ExecuteStatementRequest < Struct.new( :resource_arn, :secret_arn, :sql, :database, :schema, :parameters, :transaction_id, :, :continue_after_timeout, :, :format_records_as) SENSITIVE = [] include Aws::Structure end
#result_set_options ⇒ Types::ResultSetOptions (rw)
Options that control how the result set is returned.
# File 'gems/aws-sdk-rdsdataservice/lib/aws-sdk-rdsdataservice/types.rb', line 497
class ExecuteStatementRequest < Struct.new( :resource_arn, :secret_arn, :sql, :database, :schema, :parameters, :transaction_id, :, :continue_after_timeout, :, :format_records_as) SENSITIVE = [] include Aws::Structure end
#schema ⇒ String
(rw)
The name of the database schema.
schema
parameter isn't supported.
# File 'gems/aws-sdk-rdsdataservice/lib/aws-sdk-rdsdataservice/types.rb', line 497
class ExecuteStatementRequest < Struct.new( :resource_arn, :secret_arn, :sql, :database, :schema, :parameters, :transaction_id, :, :continue_after_timeout, :, :format_records_as) SENSITIVE = [] include Aws::Structure end
#secret_arn ⇒ String
(rw)
The ARN of the secret that enables access to the DB cluster. Enter the database user name and password for the credentials in the secret.
For information about creating the secret, see Create a database secret.
# File 'gems/aws-sdk-rdsdataservice/lib/aws-sdk-rdsdataservice/types.rb', line 497
class ExecuteStatementRequest < Struct.new( :resource_arn, :secret_arn, :sql, :database, :schema, :parameters, :transaction_id, :, :continue_after_timeout, :, :format_records_as) SENSITIVE = [] include Aws::Structure end
#sql ⇒ String
(rw)
The SQL statement to run.
# File 'gems/aws-sdk-rdsdataservice/lib/aws-sdk-rdsdataservice/types.rb', line 497
class ExecuteStatementRequest < Struct.new( :resource_arn, :secret_arn, :sql, :database, :schema, :parameters, :transaction_id, :, :continue_after_timeout, :, :format_records_as) SENSITIVE = [] include Aws::Structure end
#transaction_id ⇒ String
(rw)
The identifier of a transaction that was started by using the
BeginTransaction
operation. Specify the transaction ID of the
transaction that you want to include the SQL statement in.
If the SQL statement is not part of a transaction, don't set this parameter.
# File 'gems/aws-sdk-rdsdataservice/lib/aws-sdk-rdsdataservice/types.rb', line 497
class ExecuteStatementRequest < Struct.new( :resource_arn, :secret_arn, :sql, :database, :schema, :parameters, :transaction_id, :, :continue_after_timeout, :, :format_records_as) SENSITIVE = [] include Aws::Structure end


{% extends 'base.html' %} {% block title %}Lakesuperior{% endblock %} {% block content %}
Release {{ release }}
Superior, they said, never gives up her dead
When the gales of November come early
—Gordon Lightfoot
That’s enough for the home page.
{% endblock %}


{{ post.title }}
Summary: {{ post.excerpt }}
Read More
--- layout: default ---
Hello, and welcome to my humble little github world. If you don't know who I am yet, please go check out my about section for an intro. If you already know me, and even still are interested in what I'm up to, check out the blog posts below!


Ex: PhD Candidate, Artificial Intelligence, KU Leuven ; American Express ; IIT Kanpur
Hi, I am looking for a job opportunity in Data Science, preferably in AI Research. I am a 2015 Mathematics graduate from IIT Kanpur, also hhaving a pre-doctoral degree in Computer Science from KU Leuven, Belgium.
Over the last 3 years, I was a PhD candidate with Prof. Luc De Raedt as part of the SYNTH Project on ‘Automating Data Science’ in the research group of Declarative Languages and Artificial Intelligence (DTAI) at KU Leuven, Belgium.
My work was themed around ‘Logic and Learning in Automating Data Science’ with a prime focus on probabilistic logic programming, rule learning, predicate invention and planning.
Research Interests
Computer Science
>> Artificial Intelligence
>> Statistical and Relational AI
>> Probabilistic Logic Programming, Logic, Planning
Mathematics
>> Probability, Statistics, Logic
>> Finance, Statistical Simulation
>> Image Processing, Fractals
Prior to 2017
I have previously worked on Credit Risk Management at American Express, Gurgaon, India for 2 years after completing a Masters degree (MSc Integrated) in Mathematics and Scientific Computing from Indian Intitute of Technology, Kanpur, India in 2015.
News
| May 25, 2020 | Participated in the EUvsVirus hackathon. We present you BYSON (Bring you store online) - a platform that allows shop owners to bring their store online super-easily and connect with customers, thereby helping to flatten the curve. Check out our submission |
| Mar 1, 2019 |
My first submission just got accepted!
Our work on ‘Scalable Rule Learning in Probablistic Knowledge Bases’ got accepted in the 1st Conference of Automated Knowledge Base Construction 2019 to take place in University of Massachusetts from 20 to 22 May 2019.
[paper, presentation, spotlight, poster, code] |
| Feb 3, 2018 | I have officially commenced my PhD, which should tentatively be of 4 years. |


The link order
The link order depends on the order of library definitions and dependencies in the Project.meta files.
In general, if a library X depends on a library Y, the library X must be linked before Y.
Example:
Project A:
Dependency B
Dependency C
Project B:
Dependency D
Project C:
Dependency D
Project D:
The link order will be
Objects of A
B
C
D
Same example but with external libraries:
Project A:
ExternalLibrary a1
Dependency B
ExternalLibrary a2
Dependency C
ExternalLibrary a3
Project B:
ExternalLibrary b1
Dependency D
ExternalLibrary b2
Project C:
ExternalLibrary c1
Dependency D
ExternalLibrary c2
Project D:
ExternalLibrary d1
ExternalLibrary d2
The link order will be
Objects of A
a1
B
b1
b2
a2
C
c1
D
d1
d2
c2
a3
Notes:
The executable will be automatically relinked, if a regular library (LibraryConfig) has been updated (file timestamp).
This does NOT apply to ExternalLibraries, because these are arguments given to the linker which searches itself for the libraries. Exception: if an ExternalLibrary is specified with “search: false”, the exact library is known to bake and is also taken into account.


Identity Provider Login
Login
User ID:
Password:
Please continue authentication on your mobile device.
Please scan the QR Code to pair your device.
Forgot Your Password?


Wisconsin unemployment rate up for fifth straight month
MADISON, Wis. - Wisconsin's unemployment rate is up for a fifth straight month and half a percentage point since a record low in May.
The state Department of Workforce Development reported Thursday that unemployment in October was 3.3%. That is up from 3.2% the month before and 2.8% in April and May. That tied a record low for the state.
The October rate is also three-tenths of a point ahead of where it was a year ago. But it remains below the national unemployment rate of 3.6%.
Wisconsin lost 1,100 private sector jobs between September and October. The state was up 17,200 private sector jobs over the same point last year.


{% include "components/header.html" %}
{% include "components/home.html" %} {% include "components/navigation.html" %} {% include "components/whoami.html" %} {% include "components/services.html" %} {% include "components/contact.html" %} {% include "components/footer.html" %} {% include "components/footer_includes.html" %}


I recently reinstalled my laptop and had to reconfigure my git prompt.
I use the git prompt script that is included in Ubuntu's git package, and integrate it into my prompt by editing ~/.bashrc
, executing source /etc/bash_completion.d/git-prompt
, and adding $(__git_ps1)
to my PS1
variable, just before the ending \$
(which is the final $
in your prompt).
This gives me a basic prompt, that looks something like:
nitz@computer:~/project (master)$
Note the (master)
- that's the git prompt addition.
However, there are environment variables that can be set before calling git-prompt
, that add more information to PS1. I always forget some because I haven't found an organized list of them, only comments in the git-prompt
file itself. I've decided to compile my own list.
The Script
I used this nifty script to extract all variables mentioned in the actual git-prompt
script with the pattern GIT_PS_*
, since it looks like those are the relevant variables.
cat /usr/lib/git-core/git-sh-prompt | perl -nle 'print "$1" if (/(GIT_PS1_[a-zA-Z_]+)/)' | sort | uniq
GIT_PS1_DESCRIBE_STYLE
Modifies the way detached HEAD is shown. Possible values are:contains
: Looks forward in the tree for a tag, so you know which tag you're behindbranch
: Looks forward in the tree for a tag or a branch (whatever's nearest)describe
: Looks backwards in the tree for a tag, so you know which tag you're ahead of- default: If your exactly on a tag, display it. If the method you chose fails to find a tag/branch to display, you'll see the commit id instead.
GIT_PS1_SHOWCOLORHINTS
__git_ps1
can be used to create the PS1 prompt and not just its own output. If that's the case, a non-empty value tells git to color the prompt according to the current state (dirty, untracked files...)GIT_PS1_SHOWDIRTYSTATE
Shows the "dirty" indicator - meaning whether you modified tracked files. Can be*
for unstaged changes,+
for staged changes,#
for "no HEAD to compare against" (usually only happens before initial commit)GIT_PS1_SHOWSTASHSTATE
Shows the "stash" indicator - meaning whether you have files stashed.
Looks like$
GIT_PS1_SHOWUNTRACKEDFILES
Shows the "untracked" indicator - meaning whether you have untracked files (files that are in the working directory but haven't been added usinggit add
to the repository).
Looks like%
-
GIT_PS1_SHOWUPSTREAM
Shows the difference between the upstream branch and the current branch. I only use "auto", meaning that I get the following values:<
when I'm behind (I need to pull to get changes from the server)>
when I'm ahead (I need to push to update the server with my changes)<>
when I'm diverged from the server (some conflict resolution will be required)=
when we're identical (no action is needed).
This obviously requires me to
fetch
the remote server from time to time.
How I did it
My prompt currently looks like this. The if
actually sets the prompt and is mostly unmodified (except for adding $(__git_ps1)
).
# Git
GIT_PS1_SHOWDIRTYSTATE='y'
GIT_PS1_SHOWSTASHSTATE='y'
GIT_PS1_SHOWUNTRACKEDFILES='y'
GIT_PS1_DESCRIBE_STYLE='contains'
GIT_PS1_SHOWUPSTREAM='auto'
source /etc/bash_completion.d/git-prompt
if [ "$color_prompt" = yes ]; then
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]$(__git_ps1)\$ '
else
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w$(__git_ps1)\$ '
fi
unset color_prompt force_color_prompt


Something about me. Something about the thing I do and what I like.
I have these skills already. I enjoy skill1 and skill2 the most.
I may be reached via email or phone, or follow me on twitter


The photosynthesis package simulates photosynthetic rate given a set of leaf traits and environmental conditions by solving the Farquhar-von Caemmerer-Berry C3 biochemical model. There are two main steps to using photosynthesis:
photo
and photosynthesis
for single and multiple parameter sets, respectively).In this vignette, I’ll show you how to:
You can use the default parameter settings and simulate
photosynthetic rate in a single leaf using the make_*()
functions and photo()
.
library(dplyr)
library(magrittr)
library(photosynthesis)
# Leaving the make_* functions empty will automatically default to defaults
# parameters.
bake_par = make_bakepar() # temperature response parameters
constants = make_constants(use_tealeaves = FALSE) # physical constants
leaf_par = make_leafpar(use_tealeaves = FALSE) # leaf parameters
enviro_par = make_enviropar(use_tealeaves = FALSE) # environmental parameters
photo(leaf_par, enviro_par, bake_par, constants, quiet = TRUE,
use_tealeaves = FALSE)
#> C_chl value convergence g_tc
#> 1 258.1218 [umol/mol] -1.363227e-06 0 0.1726157 [mol/m^2/s]
#> A J_max J_max25 K_C
#> 1 27.94273 [umol/m^2/s] 200 [umol/m^2/s] 200 [umol/m^2/s] 268.3 [umol/mol]
#> K_C25 K_O K_O25 R_d
#> 1 268.3 [umol/mol] 165084.2 [umol/mol] 165084.2 [umol/mol] 2 [umol/m^2/s]
#> R_d25 T_leaf V_cmax V_cmax25 V_tpu
#> 1 2 [umol/m^2/s] 298.15 [K] 150 [umol/m^2/s] 150 [umol/m^2/s] 200 [umol/m^2/s]
#> V_tpu25 g_mc g_mc25 g_sc
#> 1 200 [umol/m^2/s] 0.4 [mol/m^2/s] 0.4 [mol/m^2/s] 0.4 [mol/m^2/s]
#> g_uc gamma_star gamma_star25 k_mc k_sc k_uc
#> 1 0.01 [mol/m^2/s] 37.9258 [umol/mol] 37.9258 [umol/mol] 1 [1] 1 [1] 1 [1]
#> leafsize phi_J theta_J C_air O P
#> 1 0.1 [m] 0.331 [1] 0.825 [1] 420 [umol/mol] 0.21 [1] 101.3246 [kPa]
#> PPFD RH wind Ds_Jmax Ds_gmc
#> 1 1500 [umol/m^2/s] 0.5 [1] 2 [m/s] 388.04 [J/K/mol] 487.29 [J/K/mol]
#> Ea_Jmax Ea_KC Ea_KO Ea_Rd
#> 1 56095.18 [J/mol] 80989.78 [J/mol] 23719.97 [J/mol] 40446.75 [J/mol]
#> Ea_Vcmax Ea_Vtpu Ea_gammastar Ea_gmc
#> 1 52245.78 [J/mol] 52245.78 [J/mol] 24459.97 [J/mol] 68901.56 [J/mol]
#> Ed_Jmax Ed_gmc D_c0 D_h0
#> 1 121244.8 [J/mol] 148788.6 [J/mol] 1.29e-05 [m^2/s] 1.9e-05 [m^2/s]
#> D_m0 D_w0 G R eT
#> 1 1.33e-05 [m^2/s] 2.12e-05 [m^2/s] 9.8 [m/s^2] 8.31446 [J/K/mol] 1.75 [1]
#> epsilon sigma C_i
#> 1 0.622 [1] 5.67e-08 [W/K^4/m^2] 350.1432 [umol/mol]
You can look at default parameters settings in the manual (run
?make_parameters
). These defaults are reasonable, but of
course you will probably want to use different choices and allow some
parameters to vary. Here, I’ll demonstrate how to replace a default. In
the next section, I’ll show you how to set up a gradient of parameter
values over which to solve for leaf temperature.
# Use the `replace` argument to replace defaults. This must be a named list, and
# each named element must have the proper units specified. See `?make_parameters`
# for all parameter names and proper units.
# Temperature response parameters can be updated (but we won't do that here)
bake_par = make_bakepar()
# Physical constants probably do not need to be replaced in most cases,
# that's why we call them 'constants'!
constants = make_constants(use_tealeaves = FALSE)
# First, we'll change photosynthetic photon flux density to 1000 umol / (m^2 s)
enviro_par = make_enviropar(
replace = list(
PPFD = set_units(1000, "umol/m^2/s")
), use_tealeaves = FALSE
)
# Next, we'll change stomatal conductance to 0.3 mol / m^2 / s.
leaf_par = make_leafpar(
replace = list(
g_sc = set_units(0.3, mol / m^2 / s)
), use_tealeaves = FALSE
)
photo <- photo(leaf_par, enviro_par, bake_par, constants, quiet = TRUE,
use_tealeaves = FALSE)
photo |>
select(PPFD, C_chl, A) |>
knitr::kable()
| PPFD | C_chl | A |
|---|---|---|
| 1000 [umol/m^2/s] | 252.6879 [umol/mol] | 25.63373 [umol/m^2/s] |
In the previous two examples, I used the photo
function
to solve for a single parameter set. In most cases, you’ll want to solve
for many parameter sets. The function photosynthesis
generalizes photo
and makes it easy to solve for multiple
parameter sets using the same argument structure. All you need to do is
specify multiple values for one or more leaf or environmental parameters
and photosynthesis
uses the purrr::cross
function to fit all combinations1.
# As before, use the `replace` argument to replace defaults, but this time we
# enter multiple values
bake_par = make_bakepar()
constants = make_constants(use_tealeaves = FALSE)
# First, we'll change the PPFD to 1000 and 1500 umol / (m^2 s)
enviro_par = make_enviropar(
replace = list(
PPFD = set_units(c(1000, 1500), umol / m^2 / s)
), use_tealeaves = FALSE
)
# Next, we'll change stomatal conductance to to 0.2 and 0.4 mol / m^2 / s
leaf_par = make_leafpar(
replace = list(
g_sc = set_units(c(0.2, 0.4), mol / m^2 / s)
), use_tealeaves = FALSE
)
# Now there should be 4 combinations (high and low g_sc crossed with high and low PPFD)
ph = photosynthesis(leaf_par, enviro_par, bake_par, constants,
use_tealeaves = FALSE, progress = FALSE, quiet = TRUE)
ph |>
select(g_sc, PPFD, A) |>
knitr::kable()
| g_sc | PPFD | A |
|---|---|---|
| 0.2 [mol/m^2/s] | 1000 [umol/m^2/s] | 24.34817 [umol/m^2/s] |
| 0.4 [mol/m^2/s] | 1000 [umol/m^2/s] | 26.27649 [umol/m^2/s] |
| 0.2 [mol/m^2/s] | 1500 [umol/m^2/s] | 25.68222 [umol/m^2/s] |
| 0.4 [mol/m^2/s] | 1500 [umol/m^2/s] | 27.94273 [umol/m^2/s] |
It can take a little while to simulate many different parameter sets.
If you have multiple processors available, you can speed things up by
running simulations in parallel. In the photosynthesis
function, simply use the parallel = TRUE
argument to
simulate in parallel. You’ll need to set up a future
plan()
. See ?future::plan
for more detail.
Here I’ll provide an example simulating an \(A-C_c\) curve.
# NOTE: parallel example is not evaluated because it was causing an issue with CRAN, but you can copy-and-paste the code to run on your own machine.
library(future)
plan("multisession") # Set up plan
# We'll use the `replace` argument to enter multiple atmospheric CO2 concentrations
bake_par = make_bakepar()
constants = make_constants(use_tealeaves = FALSE)
enviro_par = make_enviropar(
replace = list(
C_air = set_units(seq(10, 2000, length.out = 20), umol / mol)
), use_tealeaves = FALSE
)
leaf_par = make_leafpar(use_tealeaves = FALSE)
ph = photosynthesis(leaf_par, enviro_par, bake_par, constants,
use_tealeaves = FALSE, progress = FALSE,
quiet = TRUE, parallel = TRUE)
# Plot C_c versus A
library(ggplot2)
## Drop units for plotting
ph %<>% mutate_if(~ is(.x, "units"), drop_units)
ggplot(ph, aes(C_chl, A)) +
geom_line(size = 2) +
xlab(expression(paste(C[chl], " [ppm]"))) +
ylab(expression(paste("A [", mu, "mol ", m^-2~s^-1, "]"))) +
theme_bw() +
NULL
In experiments, leaf temperature can be kept close to air
temperature, but in nature, leaf temperature can be quite a bit
different than air temperature in the shade depending on environmental
and leaf parameters. If use_tealeaves = TRUE
,
photo()
and photosynthesis()
will call on the
tealeaves
package to calculate leaf temperature using an energy balance model.
# NOTE: parallel example is not evaluated because it was causing an issue with CRAN, but you can copy-and-paste the code to run on your own machine.
# You will need to set use_tealeaves = TRUE when making parameters because additional parameters are needed for tealeaves.
bake_par = make_bakepar()
constants = make_constants(use_tealeaves = TRUE)
enviro_par = make_enviropar(
replace = list(
T_air = set_units(seq(288.15, 313.15, 1), K)
), use_tealeaves = TRUE
)
leaf_par = make_leafpar(replace = list(
g_sc = set_units(c(0.2, 0.4), mol / m^2 / s)
), use_tealeaves = TRUE
)
ph = photosynthesis(leaf_par, enviro_par, bake_par, constants,
use_tealeaves = TRUE, progress = FALSE,
quiet = TRUE, parallel = TRUE)
# Plot temperature and photosynthesis
library(ggplot2)
## Drop units for plotting
ph %<>%
mutate_if(~ is(.x, "units"), drop_units) %>%
mutate(`g[s]` = ifelse(g_sc == 0.2, "low", "high"))
ggplot(ph, aes(T_air, T_leaf, color = `g[s]`)) +
geom_line(size = 2, lineend = "round") +
geom_abline(slope = 1, intercept = 0, linetype = "dotted") +
scale_color_discrete(name = expression(g[s])) +
xlab(expression(paste(T[air], " [K]"))) +
ylab(expression(paste(T[leaf], " [K]"))) +
theme_bw() +
NULL
ggplot(ph, aes(T_air, A, color = `g[s]`)) +
geom_line(size = 2, lineend = "round") +
scale_color_discrete(name = expression(g[s])) +
xlab(expression(paste(T[leaf], " [K]"))) +
ylab(expression(paste("A [", mu, "mol ", m^-2~s^-1, "]"))) +
theme_bw() +
NULL
Since optimization is somewhat time-consuming, be
careful about crossing too many combinations. Use
progress = TRUE
to show progress bar with estimated time
remaining.↩


By: billyzhang2010 原文发布于：2011-11-08 21:09:35
http://www.ecs.psu.edu/training/Software_Tips/Excel.htm#Tip 70
Tip #71 - Format a Row Based on the Value in a Cell in the Same Row(Version 2003)
You can conditionally format a row of cells based on the value of a cell within the same row. For example, suppose you have a spreadsheet displaying student names along with test percentage scores as shown below:
| Name | Score |
| Sue | 52 |
| Debby | 68 |
| Nancy | 75 |
| Joe | 85 |
| Fred | 95 |
Using this example, you can tell Excel to format score values with a red font color if the student's score is less than 50, with a green font color if between 50 to 59, and with a blue font color if between 60 and 69. Here's how:
1. Highlight cells A2 through B6.
2. From the Format menu, choose Conditional Formatting.
3. Select Formula Is from the Condition 1 drop-down list.
4. Set the condition to =$B2<50, click the Format button and set the font color to red. Click Ok to return to the Conditional Formatting dialog box.
5. Click the Add button, select Formula Is from the Condition 1 drop-down list and enter an additional formula, such as =$B2<60. Click the Format button and set the font color to green. Click Ok to return to the Conditional Formatting dialog box.
6. To add another conditional formula, click the Add button again, select Formulas Is from the Condition 1 drop-down list and enter an additional formula, such as =$B2<70. Click theFormat button and set the font color to blue. Click Ok to return to the Conditional Formatting dialog box.
5. Click Ok to close the Conditional Formatting dialog box.
Scores less than 50 will be red, scores between 50 to 59 will be green and scores 60 to 69 will be blue.


{ STATEMENTS }
A statement block is a collection of statements.
TYPE POINTER VarName = EXPR, POINTER VarName2 = EXPR;
TYPE is exchanged for the data type. POINTER can be zero or more stars, *
, showing the pointer level, e.g. one star, *
, means a pointer to a TYPE, two stars, **
, means a pointer to a pointer to a TYPE. The EXPR expression must evaluate to the same data type, and pointer level. The initialization expressions are optional. Any number of variables can be declared on the same line separated with commas.
Variables can be declared as const
. In these cases the value of the variable cannot be changed after initialization.
Variables not initialized cannot be assumed to be set to zero, although object variables usually are since the engine's memory management depends on it.
Variables must be declared before they are used within the statement block, or any sub blocks. When the code exits the statement block where the variable was declared the variable is no longer valid.
if( BOOL_EXP ) STATEMENT if( BOOL_EXP ) STATEMENT else STATEMENT
BOOL_EXP can be exchanged for any expression that evaluates to a boolean data type. STATEMENT is either a one-line statement or a statement block.
switch( INT_EXP ) { case INT_CONST: STATEMENT default: STATEMENT }
If you have an integer (signed or unsigned) expression that have many different outcomes that should lead to different code, a switch case is often the best choice for implementing the condition. It is much faster than a series of ifs, especially if all of the case values are close in numbers.
Each case should be terminated with a break statement unless you want the code to continue with the next case.
The case value can be a const variable that was initialized with a constant expression. If the constant variable was initialized with an expression that cannot be determined at compile time, it cannot be used in the case values.
while( BOOL_EXP ) STATEMENT do STATEMENT while( BOOL_EXP ); for( INIT ; BOOL_EXP ; NEXT ) STATEMENT
BOOL_EXP can be exchanged for any expression that evaluates to a boolean data type. STATEMENT is either a one-line statement or a statement block. INIT can be a variable declaration, an expression, or even blank. If it is a declaration the variable goes out of scope as the for loop ends. NEXT is an expression that is executed after STATEMENT and before BOOL_EXP. It can also be blank. If BOOL_EXP for the for loop evaluates to true or is blank the loop continues.
break; continue;
break
terminates the smallest enclosing loop statement. continue
jumps to the next iteration of the smallest enclosing loop statement.
The break
and continue
statements are only valid inside a loop statement.
return EXPR;
Any function with a return type other than void
must be finished with a return
statement where EXPR is an expression that evaluates to the same data type as the function. Functions declared as void
can have return
statements without any expression to terminate early.
EXPR;
Any expression may be placed alone on a line as a statement. This will normally be used for variable assignments or function calls that don't return any value of importance.


Battle over Cities
问题描述 :
It is vitally important to have all the cities connected by highways in a war, but some of them are destroyed now because of the war. Furthermore,if a city is conquered, all the highways from/toward that city will be closed by the enemy, and we must repair some destroyed highways to keep other cities connected, with the minimum cost if possible.
Given the map of cities which have all the destroyed and remaining highways marked, you are supposed to tell the cost to connect other cities if each city is conquered by the enemy.
Given the map of cities which have all the destroyed and remaining highways marked, you are supposed to tell the cost to connect other cities if each city is conquered by the enemy.
输入:
The input contains multiple test cases. The first line is the total number of cases T (T ≤ 10). Each case starts with a line containing 2 numbers N (0 < N ≤ 20000), and M (0 ≤ M ≤ 100000), which are the total number of cities, and the number of highways, respectively. Then M lines follow, each describes a highway by 4 integers: City1 City2 Cost Status where City1 and City2 are the numbers of the cities the highway connects (the cities are numbered from 1 to N), Cost (0 < Cost ≤ 20000) is the effort taken to repair that highway if necessary, and Status is either 0, meaning that highway is destroyed, or 1, meaning that highway is in use.
Note: It is guaranteed that the whole country was connected before the war and there is no duplicated high ways between any two cities.
Note: It is guaranteed that the whole country was connected before the war and there is no duplicated high ways between any two cities.
输出:
The input contains multiple test cases. The first line is the total number of cases T (T ≤ 10). Each case starts with a line containing 2 numbers N (0 < N ≤ 20000), and M (0 ≤ M ≤ 100000), which are the total number of cities, and the number of highways, respectively. Then M lines follow, each describes a highway by 4 integers: City1 City2 Cost Status where City1 and City2 are the numbers of the cities the highway connects (the cities are numbered from 1 to N), Cost (0 < Cost ≤ 20000) is the effort taken to repair that highway if necessary, and Status is either 0, meaning that highway is destroyed, or 1, meaning that highway is in use.
Note: It is guaranteed that the whole country was connected before the war and there is no duplicated high ways between any two cities.
Note: It is guaranteed that the whole country was connected before the war and there is no duplicated high ways between any two cities.

你管那么多干嘛。
你管那么多干嘛。
你管那么多干嘛。
你管那么多干嘛。
你管那么多干嘛。
代码可真够长的！
约瑟夫也用说这么长……很成熟的一个问题了，分治的方法解起来o(n)就可以了，有兴趣可以看看具体数学的第一章，关于约瑟夫问题推导出了一系列的结论，很漂亮
因为是要把从字符串s的start位到当前位在hash中重置，修改提交后能accept，但是不修改居然也能accept
没有对题目进行一番分析，真是美中不足啊
…. 配图居然是没方向的。。
第二个方法挺不错。NewHead代表新的头节点，通过递归找到最后一个节点之后，就把这个节点赋给NewHead，然后一直返回返回，中途这个值是没有变化的，一边返回一边把相应的指针方向颠倒，最后结束时返回新的头节点到主函数。
这个也是算法导论的习题
代码不对，仔细对比一下输入输出， 怎么会有‘‘printf("The winning moves are:");’’这种输出呢？
对，就是把这32位当成一个长度为32的数
根本过不了。。。。
辛苦了，顶
为什么暴力求解方法循环到sqrt(n) 就可以了呢
“再把所有不和该节点相邻的节点着相同的颜色”，程序中没有进行不和该节点相邻的其他节点是否相邻进行判断。再说求出来的也不一样是颜色数最少的
great!


The audio for this story is currently not available.
Wan die, Rabit did a waak nier di riva.

Hippo was there too, going for a stroll and eating some nice green grass.
@ipo @did @de-de tu a tek taɪm waːk an a ɲam som gɹiːn @graas
Ipo neva si se Rabit di de-de an step pan Rabit fut bai aksident. Rabit staat baal aaf Ipo an se, “Yu Ipo! Yu no si se yu a step pan mi fut?”
Hippo didn’t see that Rabbit was there and she accidentally stepped on Rabbit’s foot.
Rabbit started screaming at Hippo, “You Hippo! Can’t you see that you’re stepping on my foot?”
@ipo @neva si se @rabit di @de-de an @step @pan @rabit fut baɪ @aksident @rabit staːt baːl aːf @ipo an se ju @ipo ju @no si se ju a @step @pan mi fut
Ipo se sari tu Rabit, “Mi riili sari. Mi neva si yu. Du beg yu paadn!” Bot Rabit udn lisn an im baal aafa Ipo, “Yu dwiit fi spait! Wan die, yu wi si! Yu gwain pie!”
Hippo apologised to Rabbit, “I’m so sorry. I didn’t see you. Please forgive me!”
But Rabbit wouldn’t listen and he shouted at Hippo, “You did that on purpose! Someday, you’ll see!  Shi did step pan mi! Faiya ansa se, “No prablem, Rabit, mi fren. Mi wi du we yu aks.”
Rabbit went to find Fire and said, “Go, burn Hippo when she comes out of the water to eat grass. She stepped on me!”
Fire answered, “No problem, Rabbit, my friend. I’ll do just what you ask.”
@rabit @go luk fi faɪja an tel im se @gwaan bon op @ipo @wen @shi kom @outa di waːta fi ɲam @graas @shi @did @step @pan mi faɪja ansa se @no pɹablem @rabit mi @fren mi wi @du @we ju @aks
Lieta, Ipo did a nyam graas faar fram di riva wen, “Wush!” Faiya ton inna wahn big faiyabaal. Di faiya staat bon aaf Ipo ier.
Later, Hippo was eating grass far from the river when, “Whoosh!” Fire burst into flame.  Di faiya bon aaf aal a ar ier dem. Ipo no stap baal, “Mi ier get bon aaf inna di faiya! Aal a mi ier gaan! Mi priti ier!”
Hippo started to cry and ran for the water. All her hair was burned off by the fire.
Hippo kept crying, “My hair has burned in the fire! My hair is all gone! My beautiful hair!”
@ipo staːt fi baːl an ɹon @go @inna di waːta di faɪja bon aːf aːl a aɹ ɪɛɹ dem @ipo @no @stap baːl mi ɪɛɹ @get bon aːf @inna di faɪja aːl a mi ɪɛɹ @gaan mi @priti ɪɛɹ
Rabit did glad se Ipo ier get bon aaf. An tu dis die, chuu fried fi faiya, Ipo neva stie faar fram waata.
Rabbit was happy that Hippo’s hair was burned.
And to this day, for fear of fire, the hippo never goes far from the water.
@rabit @did @glad se @ipo ɪɛɹ @get bon aːf an tu dis dɪɛ tʃuː @fried fi faɪja @ipo @neva stɪɛ faːɹ @fram waːta


Over the last decade, the advent of high-throughput sequencing techniques brought an exponential growth in biosequence database sizes.
With increased throughput demand and popularity of computational biology tools, reducing time-to-solution during computational analysis has become a significant challenge in the path to scientific discovery.
Conventional computer architecture has been proven to be inefficient for computational biology and bioinformatics tasks.
For example, 3rd generation de-novo assembly of a human genome may take hundreds of hours on a high performance computer.
Hence, computational biology and bioinformatics increasingly rely on hardware accelerators.
In a typical application, the dominant portion of the runtime is spent in a small number of computational kernels, making it an excellent target for hardware acceleration.
The combination of increasingly large datasets and high performance computing requirements makes computational biology a prime candidate to benefit from accelerator architecture research.
Potential directions include 3D integration, near-data processing, automata processing and reconfigurable architectures.
This workshop will focus on the architecture and design of hardware accelerators for computational biology and bioinformatics problems. We plan to present and discuss a variety of acceleration techniques,
accelerator architectures and their implications on the development of computational biology.
| 7:00 - 8:30 | Breakfast |
| 8:30 - 8:40 | Opening Remarks |
| 8:40-9:40 | James Larus, EPFL "Protein Clustering: Parallelizing an Expensive Irregular Computation " (slides) |
| 9:40 - 10:00 | Farzaneh Zokaee and Lei Jiang "FindeR: Accelerating FM-Index-based Exact Pattern Matching in Genomic Sequences through ReRAM technology " (slides, paper) |
| 10:00 - 10:30 | Coffee break |
| 10:30 - 11:30 | Daniel Jacobson, Oak Ridge National Laboratory
"Exascale Biology: From Genome to Climate with a Few Steps Along the Way" |
| 11:30 - 11:50 | Fan Chen, Linghao Song, Hai Li and Yiran Chen
"PARC: A Processing-in-CAM Architecture for Genomic Long Read Pairwise Alignment using ReRAM" |
| 11:50 - 13:00 | Lunch |
| 13:00 - 14:00 | Benedict Paten, UC Santa Cruz Genomics Institute
"Building the Human Pangenome " (slides) |
| 14:00 - 14:20 | Wenqin Huangfu, Xueqi Li, Shuangchen Li, Xing Hu, Peng Gu and Yuan Xie
"MEDAL: Scalable DIMM based Near Data Processing Accelerator for DNA Seeding Algorithm" |
| 14:20 - 14:40 | Saransh Gupta, Mohsen Imani, Behnam Khaleghi, Venkatesh Kumar and Tajana Rosing
"RAPID: A ReRAM Processing in-Memory Architecture for DNA Sequence Alignment" |
| 14:40 - 15:00 | Coffee break |
| 15:00 - 15:20 | Zheming Jin, Kazutomo Yoshii and Hal Finkel
"Optimizing the Performance of the Needleman-Wunsch Benchmark using SYCL" |
| 15:20 - 15:40 | Chih-Han Yang, Jhih-Wun Zeng, Cheng-Yueh Liu and Shih-Hao Hung
"Accelerating Variant Calling via Performance Analysis and Optimization of DeepVariant" |
| 15:40 - 16:00 | Roman Snytsar and Yatish Turakhia
"Parallel acceleration of ntHash" |
| 16:00 - 16:05 | Closing remarks |
Short Bio: James Larus is Professor and Dean of the School of Computer and Communication Sciences (IC) at EPFL (École Polytechnique Fédérale de Lausanne). Prior to joining IC in October 2013, Larus was a researcher, manager, and director in Microsoft Research for over 16 years and an assistant and associate professor in the Computer Sciences Department at the University of Wisconsin, Madison. Larus has been an active contributor to numerous communities. He published over 100 papers (with 9 best and most influential paper awards), received over 40 US patents. Larus received a National Science Foundation Young Investigator award in 1993 and became an ACM Fellow in 2006. Larus received his MS and PhD in Computer Science from the University of California, Berkeley in 1989, and an AB in Applied Mathematics from Harvard in 1980.
Short Bio: Dr. Benedict Paten is an assistant professor in the department of Biomolecular Engineering at the University of California Santa Cruz (UCSC) and an associate director of the UC Santa Cruz Genomics Institute. He directs the Computational Genomics Lab at UCSC, which is broadly focused on computational genomics, creating algorithms, software and services addressing biomolecular challenges. He has a PhD from the University of Cambridge and the European Molecular Biology Laboratory in computational biology.
Short Bio:
Dr. Jacobson is the Chief Scientist for Computational Systems Biology at the Oak Ridge National Laboratory.
His lab was the first group to break the Exascale barrier and is happy to have done so for a biology project.
At present, this (2.41 Exaops) calculation is the fastest scientific calculation ever done anywhere in the world. This project led to his team being awarded the 2018 Gordon Bell
Prize (the first ever for Systems Biology).
Dr. Jacobson's career as a computational systems biologist has included leadership roles in academic, corporate, NGO and national lab settings.
His lab focuses on the development and subsequent application of mathematical, statistical and computational methods to biological datasets in order to yield new insights into
complex biological systems. His lab’s approaches include the use of Network Theory and Topology Discovery/Clustering, Wavelet Theory, and explainable-AI, together with traditional
and more advanced supercomputing architectures. Areas of statistics of particular interest to his lab include the use of both frequentist (parametric and non-parametric) and
Bayesian methods as well as the development of new methods for Genome-Wide Epistasis Studies (GWES).
These mathematical and statistical methods are applied to various population and (meta)multiomics data sets (Genomics, Phylogenomics, Transcriptomics, Proteomics, Metabolomics,
Microbiomics, Viriomics, Phytobiomics, Chemiomics, etc.) individually as well as in combination in an attempt to better understand the functional relationships as well as biosynthesis,
signaling, transcriptional, translational, degradation and kinetic regulatory networks at play in biological organisms and communities.
His group takes a broad view of biological complexity and evolution that stretches from viruses to microbes to plants to humans.
ORNL is home to some of the world’s largest supercomputers and thus his lab uses petascale and exascale computing to analyze and model complex biological systems.
<EMAIL_ADDRESS>Short bio: Leonid received his MSc and PhD in Electrical Engineering from the Technion. After graduating, he co-founded VisionTech where he co-designed a single chip MPEG2 codec. Following VisionTech’s acquisition by Broadcom, he co-founded Horizon Semiconductors where he co-designed a Set Top Box on chip for cable and satellite TV.
Leonid is a postdoc fellow in Electrical Engineering in the Technion. He co-authored a number of patents and research papers on SoC and ASIC. His research interests include non von Neumann computer architectures and processing in memory
<EMAIL_ADDRESS>Short bio:
Naor received his BSc from the faculty of Electrical Engineering, and MSc from the faculty of Biomedical Engineering, Technion, Israel in 2017 and 2019, respectively. He is now a PhD candidate in the faculty of Applied Mathematics under the supervision of Prof. Roee Amit.
Naor's research interests are near-data processing, deep-learning and biological computing.
<EMAIL_ADDRESS>Short bio: Yatish is a final year PhD student in Electrical Engineering at Stanford University, where he is co-advised by Prof. Bill Dally and Prof. Gill Bejerano. He is interested in the hardware-acceleration of genome sequence alignment and its application to biomedicine and comparative genomics. His work has won the best paper award at ASPLOS 2018 and IEEE Micro Top picks 2018 award. He is also a recipient of the NVIDIA graduate fellowship. He has served as a reviewer in a number of top-tier computer architecture journals, including Transactions on Computers, Transactions on Architecture and Code Optimization (TACO) and ComputerArchitecture Letters (CAL)
<EMAIL_ADDRESS>Short bio: Sneha is a third year Ph.D. Candidate at Stanford University where she is advised by Prof. Mark Horowitz and Prof. Gill Bejerano. Previously, she received her B. Tech. and M. Tech. in Electrical Engineering at the Indian Institute of Technology, Bombay. She is interested in developing co-processors for genomic applications.


german_credit_data_example.Rmd
The performance of Corels on test data is compared to XGboost.
Precision is an important metric for loan decisions (i.e. when a good loan is predicted, how often it is true). In this example, on unseen test data, XGBoost achieves 84% accuarcy (106 / (106 + 20)) vs. 78% (117 / (117 + 34)) for Corels. The null accuracy (always predicting the most frequent class of a good loan) is 73% (142 / (142 + 52).
While XGBoost performs better, the Corels rules are short and easy to interpret. Also, the accuracy achieved by the two methods is more similar (XGBoost 72% vs. Corels 70%).
Corels are ‘Certifiably Optimal RulE ListS’. They are short and simple human interpretable rule lists created on categorical data.
This analysis compares the performance of a simple Corels rule set to xgboost on German credit data.
The xgboost modelling of the german credit data is adapted from this excellent test of tidymodels with drake.
The german credit data is downloaded and prepared using the code in tidymodels with drake.
library(tidymodels) library(corels) library(tidycorels) library(funModeling) library(pROC) library(formattable) clean_df <- read.table(file = "https://www.openml.org/data/get_csv/31/dataset_31_credit-g.arff", header = TRUE, sep = ",") %>% janitor::clean_names(., "small_camel")
We first split the data into 80% training data and 20% test to evaluate the final model chosen. Folds of the training data are also created for cross-validation when building a classifier with xgboost.
Let’s quickly explore the relationships between each predictor and the outcome of a good or bad loan.
We use the funModels package to bin or categorise numeric predictors to maximise the information gain ratio. From this we can more easily “semantically describe the relationship between the input and the target variable”.
We also store the cut points of the categorised continuous columns to be used later when categorsing values for Corels.
# https://blog.datascienceheroes.com/discretization-recursive-gain-ratio-maximization/ trainData_cat <- trainData %>% dplyr::mutate(dplyr:::across( .cols = c(duration, creditAmount,age), list(~ funModeling::discretize_rgr(input = ., target = class)), .names = "{col}Cat" )) vars <- base::colnames(dplyr::select(trainData_cat, dplyr::contains("Cat"))) age_cat_cuts <- trainData_cat %>% group_by(ageCat) %>% dplyr::summarise(min = min(age), .groups = 'drop') %>% dplyr::pull(min) duration_cat_cuts <- trainData_cat %>% group_by(durationCat) %>% dplyr::summarise(min = min(duration), .groups = 'drop') %>% dplyr::pull(min) amount_cat_cuts <- trainData_cat %>% group_by(creditAmountCat) %>% dplyr::summarise(min = min(creditAmount), .groups = 'drop') %>% dplyr::pull(min)
This function will plot each predictor against the outcome.
plot_fun <- function(cat) { cat <- rlang::ensym(cat) trainData_cat %>% dplyr::group_by(!!cat, class) %>% dplyr::summarise(n = n(), .groups = 'drop') %>% ggplot2::ggplot() + ggplot2::aes( x = !!cat, y = n, fill = class, label = n ) + ggplot2::geom_bar( position = "fill", stat = "identity" ) + ggplot2::geom_text( size = 3, position = position_fill(vjust = 0.5), colour = "black" ) + ggplot2::theme_minimal() + ggplot2::coord_flip() + ggplot2::scale_y_continuous(labels = scales::percent) + ggplot2::theme( panel.grid.major.x = element_blank(), panel.grid.minor.x = element_blank(), panel.border = element_blank(), strip.text.x = element_text(size = 10), axis.text.x = element_text( # angle = 60, hjust = 1, size = 10 ), legend.text = element_text(size = 12), legend.position = "right", legend.direction = "vertical", plot.title = element_text( size = 22, face = "bold" ) ) }
In each plot below we can view the relationships between each predictor and outcome. Variables that have the most variation in the ratio between good and bad loans we would expect them to feature in the classification models.
cols <- base::colnames(dplyr::select(trainData_cat, -duration, -age, -creditAmount)) # getting all the column names but removing the continuous columns that have been binned. cols <- cols[cols != "class"] # remove outcome column from list of column names plots <- purrr::map(cols, plot_fun) print(plots) #> [[1]]
#>
#> [[2]]
#>
#> [[3]]
#>
#> [[4]]
#>
#> [[5]]
#>
#> [[6]]
#>
#> [[7]]
#>
#> [[8]]
#>
#> [[9]]
#>
#> [[10]]
#>
#> [[11]]
#>
#> [[12]]
#>
#> [[13]]
#>
#> [[14]]
#>
#> [[15]]
#>
#> [[16]]
#>
#> [[17]]
#>
#> [[18]]
#>
#> [[19]]
#>
#> [[20]]
Using the recipes package in tidymodels we create a recipe that converts the three continuous value columns into categories, then convert the values in every column into individual dummy fields per value.
# create the data preperation recipe credit_recipe <- recipes::recipe(class ~ ., data = trainData ) %>% # 1 Apply the funModeling::discretize_rgr() cut points to continuous columns that maximise the information gain ratio on the training data only recipes::step_mutate(age = base::cut(age, breaks = c("-inf", age_cat_cuts, "inf"), right = FALSE, dig.lab = 10)) %>% recipes::step_mutate(duration = base::cut(duration, breaks = c("-inf", duration_cat_cuts, "inf"), right = FALSE, dig.lab = 10)) %>% recipes::step_mutate(creditAmount = base::cut(creditAmount, breaks = c("-inf", amount_cat_cuts, "inf"), right = FALSE, dig.lab = 10)) %>% # 2 ensure column values that are words do not have spaces. This will form better dummy column names that tidycorels needs where the value each dummy column represents is shown by a single delimiter (e.g. the underscore step_dummy creates) recipes::step_mutate_at(recipes::all_predictors(), fn = list(~ base::gsub(pattern = "_", replacement = ".", x = .))) %>% # 3 convert each value of each predictor into its own 0/1 binary column recipes::step_mutate_at(recipes::all_predictors(), fn = list(~ as.factor(.))) %>% recipes::step_mutate(class = as.factor(class)) %>% # step_dummy requires variable values to be factors recipes::step_dummy(recipes::all_predictors(), one_hot = TRUE) %>% # 4 convert each value of the outcome column into its own 0/1 binary column recipes::step_integer(recipes::all_outcomes(), zero_based = TRUE) %>% # ensure outcome is 0/1 rather than words recipes::step_mutate_at(recipes::all_outcomes(), fn = list(~ as.factor(.))) %>% # step_dummy requires variable values to be factors recipes::step_dummy(recipes::all_outcomes(), one_hot = TRUE) # Train the data preperation recipe on the training data credit_recipe_trained <- recipes::prep(credit_recipe, training = trainData, retain = TRUE) # Extract the train data with recipe applied (juice), and the same recipe applied to the test data (bake) data credit_train_preprocessed <- recipes::juice(credit_recipe_trained) credit_test_preprocessed <- recipes::bake(credit_recipe_trained, new_data = testData)
We can now run tidycorels::tidy_corels()
function on the prepared training data. We could consider varying the regularization argument in corels. This value, “can be thought of as a penalty equivalent to misclassifying 1% of the data when increasing the length of a rule list by one association rule.” When the regulraization value is low many rules are created that could overfit to error in the training data. A higher value leads to fewer rules which may generalise better to unseen test data. Here we simply use the default value of 0.01 that leads to a small number of rules.
credit_train_model <- tidycorels::tidy_corels( df = credit_train_preprocessed, label_cols = c("class_X0", "class_X1"), value_delim = "_", run_bfs = TRUE, calculate_size = TRUE, run_curiosity = TRUE, regularization = 0.01, curiosity_policy = 3 ) credit_train_model$corels_console_output[4:8]
A dataframe of just the true label, the columns used in the Corels rules, and the Corels predictions is returned. The columns have been ordered for you to work well in an alluvial plot.
easyalluvial::alluvial_wide(credit_train_model$alluvial_df) + ggplot2::coord_flip()
Next we use the function tidycorels::corels_predict()
to apply the Corels rules created on the training data to the test data that has already been pre-processed using the recipe created on the training data.
credit_test_predict <- tidycorels::predict_corels( model = credit_train_model, new_df = credit_test_preprocessed )
We can now use the test data that has been labelled using the Corels rules and compare this to the true label to create a confusion matrix along with performance statistics.
conf_matrix <- credit_test_predict$new_df_labelled %>% yardstick::conf_mat( truth = "class_X1", estimate = "corels_label" ) ggplot2::autoplot(conf_matrix, "heatmap")
# https://github.com/tidymodels/yardstick/issues/160 withr::with_options(c(yardstick.event_first = FALSE),summary(conf_matrix)) %>% dplyr:::mutate(.estimate = round(.estimate, digits = 3)) %>% dplyr::select(.metric, .estimate) %>% dplyr::filter(.metric %in% c("accuracy","bal_accuracy", "mcc","precision", "recall", "f_meas")) %>% dplyr::mutate(.estimate = formattable::color_tile("white", "orange")(.estimate)) %>% kableExtra::kable(escape = F) %>% kableExtra::kable_styling("hover", full_width = F)
| .metric | .estimate |
|---|---|
| accuracy | 0.704 |
| mcc | 0.240 |
| bal_accuracy | 0.614 |
| precision | 0.775 |
| recall | 0.824 |
| f_meas | 0.799 |
Because, “It is worse to class a customer as good when they are bad (5), than it is to class a customer as bad when they are good (1).” (see), precision is a useful metric. It measures the proportion of True Positives (117 labelled good loans that were actually good), out of the True Positives plus False Positives (34 labelled good loans that were actually bad). This is the bottom row of the confusion matrix: 117 / (117 + 34) = 0.775.
By inspecting the alluvial plot on test data we can easily see where and why the rules have succeeded or failed to label the unseen test data correctly.
easyalluvial::alluvial_wide(credit_test_predict$alluvial_df) + ggplot2::coord_flip()
Next we try XGBoost that is a Gradient Boosting Method:
“GBMs build an ensemble of shallow trees in sequence with each tree learning and improving on the previous one. Although shallow trees by themselves are rather weak predictive models, they can be “boosted” to produce a powerful “committee” that, when appropriately tuned, is often hard to beat with other algorithms." From “Hands on Machine Learning with R”
In the data recipe only the categorical columns are one-hot encoded into one column per value.
xgb_pre_proc <- recipes::recipe(class ~ ., data = trainData ) %>% recipes::step_dummy(recipes::all_nominal(), -recipes::all_outcomes(), one_hot = TRUE )
Here we define which boost tree parameters will be tuned later and which we fix.
xgb_mod <- parsnip::boost_tree( mtry = tune::tune(), trees = 500, min_n = tune::tune(), tree_depth = tune::tune(), learn_rate = 0.01, sample_size = tune::tune() ) %>% parsnip::set_mode("classification") %>% parsnip::set_engine("xgboost")
The workflow is therefore the data preparation recipe and the model specification (including its type and which parameters are to be tuned later).
xgb_wflow <- workflows::workflow() %>% workflows::add_recipe(xgb_pre_proc) %>% workflows::add_model(xgb_mod)
Let’s now define the parameters by looking at the workflow
xgb_wflow %>% dials::parameters() #> Collection of 4 parameters for tuning #> #> id parameter type object class #> mtry mtry nparam[?] #> min_n min_n nparam[+] #> tree_depth tree_depth nparam[+] #> sample_size sample_size nparam[+] #> #> Model parameters needing finalization: #> # Randomly Selected Predictors ('mtry') #> #> See `?dials::finalize` or `?dials::update.parameters` for more information.
mtry
is the number of predictors that will be randomly sampled at each split when creating the tree models. This is set to range between 40% of the features to all of the features.
feat_count <- ncol(xgb_pre_proc %>% recipes::prep() %>% recipes::juice() %>% dplyr::select(-class)) mtry_min <- base::floor(feat_count * 0.4) xgb_params <- xgb_wflow %>% dials::parameters() %>% stats::update( mtry = dials::mtry(range = c(mtry_min, feat_count)), sample_size = dials::sample_prop(c(0.5, 1)), tree_depth = dials::tree_depth(range = c(4L, 10L)) )
Now that the range of the parameters has been set, a grid of possible values between those ranges can be created with dials::grid_max_entropy()
, “to construct parameter grids that try to cover the parameter space such that any portion of the space has an observed combination that is not too far from it.”
set.seed(1645) xgb_grid <- xgb_params %>% dials::grid_max_entropy(size = 10) %>% dplyr::mutate(sample_size = as.double(sample_size)) xgb_grid #> # A tibble: 10 x 4 #> mtry min_n tree_depth sample_size #> <int> <int> <int> <dbl> #> 1 35 40 8 0.854 #> 2 59 5 6 0.625 #> 3 27 5 4 0.998 #> 4 27 35 7 0.601 #> 5 49 37 6 0.548 #> 6 40 26 9 0.678 #> 7 31 35 5 0.856 #> 8 32 8 8 0.581 #> 9 36 10 9 0.837 #> 10 47 13 4 0.524
We can now tune the model by searching the grid of parameters.
tune_xgb_grid <- tune::tune_grid(xgb_wflow, resamples = folds, grid = xgb_grid, param_info = xgb_params, metrics = yardstick::metric_set(roc_auc), control = tune::control_grid( verbose = TRUE, save_pred = TRUE ) ) tune_xgb_grid #> # 5-fold cross-validation #> # A tibble: 5 x 5 #> splits id .metrics .notes .predictions #> <list> <chr> <list> <list> <list> #> 1 <split [640/161]> Fold1 <tibble [10 x 7]> <tibble [0 x 1]> <tibble [1,610 x 8~ #> 2 <split [641/160]> Fold2 <tibble [10 x 7]> <tibble [0 x 1]> <tibble [1,600 x 8~ #> 3 <split [641/160]> Fold3 <tibble [10 x 7]> <tibble [0 x 1]> <tibble [1,600 x 8~ #> 4 <split [641/160]> Fold4 <tibble [10 x 7]> <tibble [0 x 1]> <tibble [1,600 x 8~ #> 5 <split [641/160]> Fold5 <tibble [10 x 7]> <tibble [0 x 1]> <tibble [1,600 x 8~
“..iterative search can be used to analyze the existing tuning parameter results and then predict which tuning parameters to try next.” see
set.seed(1600) xgb_bayes_tune <- tune::tune_bayes(xgb_wflow, resamples = folds, iter = 5L, param_info = xgb_params, metrics = yardstick::metric_set(roc_auc), initial = tune_xgb_grid, control = tune::control_bayes( verbose = TRUE, save_pred = TRUE, no_improve = 5L ) )
We can select the hyperparameters giving the best results with tune::select_best()
according to our chosen metric (area under the ROC curve).
best_xgb <- xgb_bayes_tune %>% tune::select_best(metric = "roc_auc") best_xgb #> # A tibble: 1 x 4 #> mtry min_n tree_depth sample_size #> <int> <int> <int> <dbl> #> 1 27 5 4 0.998
We now use tune::finalize_workflow()
to generate a workflow object that adds the best performing model.
best_xgb_wfl <- tune::finalize_workflow(xgb_wflow, parameters = best_xgb ) best_xgb_wfl #> == Workflow ============================================================================================================ #> Preprocessor: Recipe #> Model: boost_tree() #> #> -- Preprocessor -------------------------------------------------------------------------------------------------------- #> 1 Recipe Step #> #> * step_dummy() #> #> -- Model --------------------------------------------------------------------------------------------------------------- #> Boosted Tree Model Specification (classification) #> #> Main Arguments: #> mtry = 27 #> trees = 500 #> min_n = 5 #> tree_depth = 4 #> learn_rate = 0.01 #> sample_size = 0.997644333867356 #> #> Computational engine: xgboost
And then generate a fitted model from that workflow on the training data.
final_fit <- best_xgb_wfl %>% parsnip::fit(data = trainData) final_fit #> == Workflow [trained] ================================================================================================== #> Preprocessor: Recipe #> Model: boost_tree() #> #> -- Preprocessor -------------------------------------------------------------------------------------------------------- #> 1 Recipe Step #> #> * step_dummy() #> #> -- Model --------------------------------------------------------------------------------------------------------------- #> ##### xgb.Booster #> raw: 387.5 Kb #> call: #> xgboost::xgb.train(params = list(eta = 0.01, max_depth = 4L, #> gamma = 0, colsample_bytree = 0.442622950819672, min_child_weight = 5L, #> subsample = 0.997644333867356), data = x, nrounds = 500, #> verbose = 0, objective = "binary:logistic", nthread = 1) #> params (as set within xgb.train): #> eta = "0.01", max_depth = "4", gamma = "0", colsample_bytree = "0.442622950819672", min_child_weight = "5", subsample = "0.997644333867356", objective = "binary:logistic", nthread = "1", validate_parameters = "TRUE" #> xgb.attributes: #> niter #> # of features: 61 #> niter: 500 #> nfeatures : 61
The {vip}
package provides variable importance plots. Further methods are well described in the Interpretable machine learning book.
final_fit %>% workflows::pull_workflow_fit() %>% vip::vip( geom = "col", num_features = 12L, include_type = TRUE )
First we plot the ROC curve for all cut points of the probability of a good loan.
xgb_train_preds <- final_fit %>% stats::predict( new_data = trainData, type = "prob" ) %>% dplyr::bind_cols(trainData %>% dplyr::select(class)) # Generate the full ROC curve xgb_train_preds$class <- as.factor(xgb_train_preds$class) xgb_roc_curve <- yardstick::roc_curve(xgb_train_preds, truth = class, .pred_good ) # Get the AUC value and plot the curve tune::autoplot(xgb_roc_curve) + labs( title = sprintf( "AUC for XGBoost model on train set: %.2f", yardstick::roc_auc(xgb_train_preds, truth = class, .pred_good ) %>% dplyr::pull(.estimate) ) )
To create a confusion matrix requires we select a cut off in the probability to label each record. We use pROC::coords
from the pROC package to select the best threshold.
# calculate best threshold for classification label my_roc <- pROC::roc( predictor = xgb_train_preds$.pred_good, response = xgb_train_preds$class ) threshold <- pROC::coords(my_roc, "best", ret = "threshold", transpose = TRUE) %>% as.double() xgb_train_preds <- xgb_train_preds %>% dplyr::mutate(.pred_class = dplyr::case_when( .pred_good >= threshold ~ "good", TRUE ~ "bad" )) %>% dplyr::mutate(.pred_class = as.factor(.pred_class)) # confusion matrix cmat_train <- yardstick::conf_mat(xgb_train_preds, truth = "class", estimate = ".pred_class" ) ggplot2::autoplot(cmat_train, "heatmap")
The confusion matrix can be used to generate the performance statistics below. All metrics are impressively high on the training data and superior to Corels. However, this could be due to overfitting. We can now use the test data to test for over fitting.
# https://github.com/tidymodels/yardstick/issues/160 withr::with_options( c(yardstick.event_first = FALSE), summary(cmat_train) ) %>% dplyr:::mutate(.estimate = round(.estimate, digits = 3)) %>% dplyr::select(.metric, .estimate) %>% dplyr::filter(.metric %in% c("accuracy", "bal_accuracy","mcc","precision", "recall", "f_meas")) %>% dplyr::mutate(.estimate = formattable::color_tile("white", "orange")(.estimate)) %>% kableExtra::kable(escape = F) %>% kableExtra::kable_styling("hover", full_width = F)
| .metric | .estimate |
|---|---|
| accuracy | 0.833 |
| mcc | 0.640 |
| bal_accuracy | 0.838 |
| precision | 0.927 |
| recall | 0.824 |
| f_meas | 0.873 |
In contrast to the training data, the test set performance is much lower for all metrics.
An important evaluation metric is precision. This is because incorrectly labelling bad loans as good has the greatest cost.
xgb_test_preds <- final_fit %>% stats::predict( new_data = testData, type = "prob" ) %>% dplyr::bind_cols(testData %>% dplyr::select(class)) xgb_test_preds <- xgb_test_preds %>% dplyr::mutate(.pred_class = dplyr::case_when( .pred_good >= threshold ~ "good", TRUE ~ "bad" )) %>% dplyr::mutate(.pred_class = as.factor(.pred_class)) # Generate the full ROC curve xgb_test_preds$class <- as.factor(xgb_test_preds$class) xgb_roc_curve <- yardstick::roc_curve(xgb_test_preds, truth = class, .pred_good ) # Get the AUC value and plot the curve tune::autoplot(xgb_roc_curve) + labs( title = sprintf( "AUC for XGBoost model on test set: %.2f", yardstick::roc_auc(xgb_test_preds, truth = class, .pred_good ) %>% dplyr::pull(.estimate) ) )
# confusion matrix cmat_test <- yardstick::conf_mat(xgb_test_preds, truth = "class", estimate = ".pred_class" ) ggplot2::autoplot(cmat_test, "heatmap")
# https://github.com/tidymodels/yardstick/issues/160 withr::with_options( c(yardstick.event_first = FALSE), summary(cmat_test) ) %>% dplyr:::mutate(.estimate = round(.estimate, digits = 3)) %>% dplyr::select(.metric, .estimate) %>% dplyr::filter(.metric %in% c("accuracy", "bal_accuracy","mcc","precision", "recall", "f_meas")) %>% dplyr::mutate(.estimate = formattable::color_tile("white", "orange")(.estimate)) %>% kableExtra::kable(escape = F) %>% kableExtra::kable_styling("hover", full_width = F)
| .metric | .estimate |
|---|---|
| accuracy | 0.719 |
| mcc | 0.371 |
| bal_accuracy | 0.698 |
| precision | 0.841 |
| recall | 0.746 |
| f_meas | 0.791 |


Angular.js Weather
Uses browser geolocation, Google Maps API and Forecast.io weather API to display your weather forecast.
TECH
- Backend API
- Sinatra
- ActiveRecord
- Ruby
- Angular.js SPA frontend
--- layout: default title: Home ---
Uses browser geolocation, Google Maps API and Forecast.io weather API to display your weather forecast.
Create & track paychecks, plus create reports based on tax forms.


>>
<<
Usr
Pri
JfC
LJ
Phr
Dic
Voc
!:
Help
Dictionary
III. Definitions
Each main entry in the body of the dictionary is headed by a
line beginning with the informal name of the monadic case of the function,
and ending with the informal name of the dyadic case.
The line also contains the formal name of the function,
consisting of a single graphic, or a graphic
modified by one or more following inflections (a period or colon).
In the case of a conjunction, the formal name is preceded by m or
by u (denoting a noun or a verb argument) and is followed
by n or v. An adverb has no symbol to its right.
The three ranks (in the order monadic, left, and right)
are also indicated, using the symbol _ for an
infinite (unbounded) rank, and with ranks dependent on the ranks
of argument verbs shown as mu, lv, etc.
Examples are provided with each definition, and the more complex
of them may use auxiliary functions as yet unfamiliar.
These examples may be approached by ignoring all but the
immediately relevant aspects of such auxiliaries,
and by examining (and perhaps entering for execution)
component phrases that can be used to build up the final result.
For example, in the discussion of the adverb / ,
the sentences below display various uses of it for convenient comparison:
x=: 1 2 3 4 5 [ y=: 7 5 3
(,.x);(x+/y);y;(x*/y);(+/y);(*/y)
+-+-------+-----+--------+--+---+
|1| 8 6 4|7 5 3| 7 5 3|15|105|
|2| 9 7 5| |14 10 6| | |
|3|10 8 6| |21 15 9| | |
|4|11 9 7| |28 20 12| | |
|5|12 10 8| |35 25 15| | |
+-+-------+-----+--------+--+---+
Even if the auxiliary functions ; and ,. are unfamiliar,
their relevant effects are probably evident;
if not, they may be clarified by the following experiments:
x;y ,.7 8 $,.7 8
+---------+-----+ 7 2 1
|1 2 3 4 5|7 5 3| 8
+---------+-----+
Although a name (such as foreign for !:)
is suggested for each word, others can be used in addition
to or instead of them. Thus, joy might be used for !
since the exclamation mark derives from an I placed above an o,
an abbreviation of the Latin io. Similarly, iota
might be used instead of integers and index of
for i. .
>>
<<
Usr
Pri
JfC
LJ
Phr
Dic
Voc
!:
Help
Dictionary


The Website "www.webdesignbahrain.com" and "www.e-brandingtools.com" is owned by Business Communications & Management Services WLL. We are Digital Solutions providing company established in Kingdom of Bahrain since 2006. We have more than 250 clients to whom we are providing Web & Online marketing solutions .
Our team of web developers and marketing professionals will create an impressive website for your business to generate a generous return on your Internet investment.
We do monthly updates & annual maintenance to give new and fresh look to your website. Keep your website update with new contents, images, promotions, special offers, news etc.
We design creative Mobile Applications on Android & Apple Platforms. Some of recently designed apps are for "KEKANOO", "BMF Bahrain", Cineco "ShowTime Bahrain" and many more.
Content Management System (CMS) facilitates easy website content management without getting involved with the technical intricacies of Web development. With CMS, content can be published, removed or updated, and several essential Web maintenance functions can be executed without the knowledge of any web programming.
E-commerce enables to conduct your business online. This provides you the opportunity to not only make your products or services available to the global market but also let the customer choose, buy and pay online through your website 24x7. Online Shopping Cart | Payment Gateway Integration | SMS Services.
Digital marketing is the component of marketing that utilizes internet and online based digital technologies such as desktop computers, mobile phones and other digital media and platforms to promote products and services


The rtrek
package includes some Star Trek datasets, but much more data is available outside the package. You can access other Star Trek data through various APIs.
Technically, there is only one formal API: the Star Trek API (STAPI). rtrek
has functions to assist with making calls to this API in order to access specific data. See the STAPI vignette for details.
The focus of this vignette is on accessing data from Memory Beta. rtrek
interfaces with and extracts information from the Memory Alpha and Memory Beta websites. Neither of these sites actually expose an API, but functions in rtrek
with querying these websites in an API-like manner. For working with Memory Alpha content, see the respective vignette.
Memory Beta is a website that hosts information on all things relating to officially licensed Star Trek productions, for example novels, comics, etc. These are official, but this is not the same and canon. For a canon-only focus, see Memory Alpha.
When talking about using rtrek
to access data from Memory Beta, the term data is used loosely. It would be just as accurate to say information, content or text. While the site contains a vast amount of information, it is not structured in tidy tables like a data scientist would love to conveniently encounter. Memory Beta is a wiki and can be thought of as similar to an encyclopedia. The bulk of its pages consist of articles. While some of these may have interesting html tables contained within, the site largely offers textual data.
Since Memory Beta does not offer an API, the API-like interfacing provided by rtrek
is just a collection of wrappers around web page scraping. In terms of what the relevant functions bring back from Memory Beta, there are real limitations on the level of generality and quality of formatting that can be achieved across such a massive and diverse collection of articles.
To see the available Memory Beta portals, call the main function for Memory Beta access, memory_beta
, and pass it portals
as the API endpoint.
memory_beta("portals")
#> # A tibble: 13 x 2
#> id url
#> <chr> <chr>
#> 1 books Category:Books
#> 2 comics Category:Comics
#> 3 characters Category:Characters
#> 4 culture Category:Culture
#> 5 games Category:Games
#> 6 geography Category:Geography
#> 7 locations Category:Locations
#> 8 materials Category:Materials_and_substances
#> 9 politics Category:Politics
#> 10 science Category:Science
#> 11 starships Category:Starships
#> 12 technology Category:Technology
#> 13 timeline Category:Timeline
The data frame returned provides each portal ID and respective “short URL”. These relative URLs are given in order to reduce verbosity and redundancy. All absolute URLs begin with https://memory-beta.fandom.com/wiki/
.
In this special case where endpoint = "portals"
, this table is returned from the package itself because it is already known. The available portals are fixed. There is no accessing of Memory Beta yet. The URLs shown are also not needed by the user, but are provided alongside the IDs for context.
In contrast to the results of memory_alpha("portals")
, notice that each url
entry begins with Category:
rather than Portal
. The Memory Beta website does not explicitly offer “portals” like the Memory Alpha site. For consistency from the perspective of rtrek
, several top-level categories at Memory Beta are treated as portals. The timeline
portal is a special case. It is a shorthand for the timeline
subcategory at culture/history/timeline
.
Memory Beta is structured very similarly to Memory alpha, but also more consistently. The structural differences in content returned across some portals accessed by memory_alpha
are not seen when obtaining data with memory_beta
. This can make working with Memory Beta data a smoother experience.
When using a specific portal at the highest level (portal ID only), the returned data frame contains information about searchable categories available in the portal.
memory_beta("characters")
#> # A tibble: 33 x 2
#> characters url
#> <chr> <chr>
#> 1 Biography Category:Biography
#> 2 Memory Beta images (characters) Category:Memory_Beta_images_(characters)
#> 3 Artificial beings Category:Artificial_beings
#> 4 Characters (alternate reality) Category:Characters_(alternate_reality)
#> 5 Characters (alternates) Category:Characters_(alternates)
#> 6 Characters by planet Category:Characters_by_planet
#> 7 Charteris Charteris
#> 8 Crossover characters Category:Crossover_characters
#> 9 Deep Space 9 residents Category:Deep_Space_9_residents
#> 10 Deep Space 9 (II) residents Category:Deep_Space_9_(II)_residents
#> # ... with 23 more rows
Again, there are id
and url
columns. Unlike with high-level memory_alpha
results, there are no group
or subgroup
columns. These are not applicable given the simpler structure and more consistent content structure of category and article pages at Memory Beta.
The above call does involve reaching out to Memory Beta. While the portals are stable, it is expected that content within is regularly updated. Remember that this is not a real API. Since one is not available, what is really going on behind the scenes is the use of xml2
and rvest
for web page harvesting.
Some portals have terminal endpoints - in Memory Beta these are the written articles - at the top level, but typically the top level results for a portal are categories. You can always differentiate categories from articles by the URL, which will begin with Category:
in the former case.
Descending through subcategories is done by appending their id
values, separated by a forward slash /
. Notice that compared to Memory Alpha, classification and resulting hierarchical organization can be more detailed for similar content.
x <- "characters/Characters by races and cultures/Klingonoids/Klingons"
memory_beta(x)
#> # A tibble: 1,133 x 2
#> Klingons url
#> <chr> <chr>
#> 1 Klingon Klingon
#> 2 Klingon (mirror) Klingon_(mirror)
#> 3 Kring's battle cruiser personnel Kring%27s_battle_cruiser_personnel
#> 4 Unnamed Klingons Unnamed_Klingons
#> 5 Aakan Aakan
#> 6 Aak'Torr Aak%27Torr
#> 7 Abbakh Abbakh
#> 8 Adon, son of Gorath Adon,_son_of_Gorath
#> 9 Adrokos Adrokos
#> 10 Aek-Nor Aek-Nor
#> # ... with 1,123 more rows
memory_beta(paste0(x, "/Worf, son of Mogh"))
#> # A tibble: 1 x 4
#> title content metadata categories
#> <chr> <list> <list> <list>
#> 1 Worf, son of Mogh <xml_ndst> <NULL> <tibble[,2] [48 x 2]>
Note the change in the structure of the final output, which is an article. This is the end of this particular road The result is still a data frame, but now has only one row, the article.
The columns include a text title
and three nested datasets. content
contains an xml_nodeset
object left (mostly) unadulterated by memory_beta
. This contains the article’s main content section, including ordered content from a default set of html tags. For more control over article content, see mb_article
in the next section. metadata
contains a nested data frame of content parsed from the summary card that appears in the top right corner of articles. If this fails to parse for a given article, NULL
is returned. categories
returns a data frame containing categories in which the article topic falls under and their respective URLs.
If you already know the article id
, You can obtain an article directly using mb_article
instead of going through an endpoint with memory_beta
that terminates in the same id
. This also offers additional options to control what tags are included in the returned result and whether that result is the original xml_nodeset
object or a character vector of only the extracted text. In either case, work is left to the user to do what they intend such as text analysis.
worf <- mb_article("Worf,_son_of_Mogh", content_format = "character", content_nodes = c("h2", "h3"))
worf
#> # A tibble: 1 x 4
#> title content metadata categories
#> <chr> <list> <list> <list>
#> 1 Worf, son of Mogh <chr [14]> <NULL> <tibble[,2] [48 x 2]>
worf$content[[1]] # Worf article section headings
#> [1] "Biography" "Early life"
#> [3] "Starfleet Academy" "Starfleet officer"
#> [5] "Ambassador Worf" "Return to Starfleet"
#> [7] "Promotion" "Path to the 25th century"
#> [9] "Alternate timelines and realities" "Interests"
#> [11] "Worf's service record" "Appendices"
#> [13] "Connections" "External links"
If browse = TRUE
the article page also launches in the browser.
Full resolution source images can be downloaded and imported into R using mb_image
if you know the short URL. The easiest way to find URLs is by using a Memory Beta portal. In the example below, the Memory Beta images category under Klingons is selected.
The same example used in the Memory Alpha vignette cannot be duplicated here. Memory Beta does not contain as many images from the television series or movies as Memory Alpha. This is because Memory Beta focuses on licensed works in general and does not need to duplicate everything that is already documented at Memory Alpha.
This time, look for a picture that includes Worf but also K’Ehleyr.
library(dplyr)
x <- "characters/Memory Beta images (characters)/Memory Beta images (Worf)"
worf <- memory_beta(x)
worf
#> # A tibble: 82 x 2
#> `Memory Beta images (Worf)` url
#> <chr> <chr>
#> 1 Akvoh.jpg File:Akvoh.jpg
#> 2 Allanor.jpg File:Allanor.jpg
#> 3 Apocalypse Rising.jpg File:Apocalypse_Rising.jpg
#> 4 Areen and Worf.jpg File:Areen_and_Worf.jpg
#> 5 Barassociation.jpg File:Barassociation.jpg
#> 6 Bodai ShinC.jpg File:Bodai_ShinC.jpg
#> 7 Chancellor Martok.jpg File:Chancellor_Martok.jpg
#> 8 Clues.jpg File:Clues.jpg
#> 9 CogenV.jpg File:CogenV.jpg
#> 10 Commander worf Marvel.jpg File:Commander_worf_Marvel.jpg
#> # ... with 72 more rows
worf_kehleyr <- filter(worf, grepl("Kehleyr", url))
worf_kehleyr
#> # A tibble: 1 x 2
#> `Memory Beta images (Worf)` url
#> <chr> <chr>
#> 1 WorfKehleyr.jpg File:WorfKehleyr.jpg
Qapla’! One result found.
Technically, this is not the url to an image file. It is a url that redirects you to some other seemingly random article on the website that happens to include the image in it. This is not necessarily a unique instance of the image, nor is there any consistency in what portal or type of article it takes you to. memory_beta
, and mb_article
using the short form url, provide the article content associated with the “file” url. See mb_image
below for viewing the actual image.
x <- memory_beta(paste0(x, "/WorfKehleyr.jpg"))
x
#> # A tibble: 1 x 4
#> title content metadata categories
#> <chr> <list> <list> <list>
#> 1 Worf, son of Mogh <xml_ndst> <NULL> <tibble[,2] [48 x 2]>
x <- mb_article("File:WorfKehleyr.jpg")
x
#> # A tibble: 1 x 4
#> title content metadata categories
#> <chr> <list> <list> <list>
#> 1 Worf, son of Mogh <xml_ndst> <NULL> <tibble[,2] [48 x 2]>
x$categories
#> [[1]]
#> # A tibble: 48 x 2
#> categories url
#> <chr> <chr>
#> 1 Memory Beta good articles Category:Memory_Beta_good_articles
#> 2 Memory Beta articles sourced from no~ Category:Memory_Beta_articles_sourced_~
#> 3 Memory Beta articles sourced from co~ Category:Memory_Beta_articles_sourced_~
#> 4 Memory Beta articles sourced from ep~ Category:Memory_Beta_articles_sourced_~
#> 5 Memory Beta articles sourced from vi~ Category:Memory_Beta_articles_sourced_~
#> 6 Memory Beta articles sourced from ga~ Category:Memory_Beta_articles_sourced_~
#> 7 Memory Beta articles sourced from sh~ Category:Memory_Beta_articles_sourced_~
#> 8 Memory Beta articles sourced from RP~ Category:Memory_Beta_articles_sourced_~
#> 9 Memory Beta articles sourced from no~ Category:Memory_Beta_articles_sourced_~
#> 10 Memory Beta articles sourced from re~ Category:Memory_Beta_articles_sourced_~
#> # ... with 38 more rows
The likely intent is to obtain an image file after browsing the web pages that list images files. Even if you are interactively browsing the website, you have to click several times and scroll through additional articles before you can actually view the image file that was initially presented to you as a clickable link. This is a frustrating user experience and confusing design. If you have a file name you want to view, just use ma_image
for this. It returns a ggplot object of the image file rather than an associated article.
mb_image("File:WorfKehleyr.jpg")
mb_image
can take the additional arguments, keep = TRUE
to retain the downloaded image file, and file
to specify the output filename if you do not want it to be derived from the short URL. If you need more control over the plot, set keep = TRUE
and then load the image file into R directly to plot separately as needed.
In the examples above, you see the distinction between using mb_image
to grab images and using memory_beta
to navigate and parse image file page content more generally. Similarly, mb_timeline
is a special function that specifically extracts and curates timeline data from Memory Beta, in contrast to using the memory_beta("timeline")
portal with various endpoints to parse site pages for general content. mb_timeline
focuses specifically on the Memory Beta chronology/timeline tables on various Memory Beta pages. This is a helpful function to have because Memory Beta timeline data is not as uniformly arranged on Memory Beta as mb_timeline
makes it appear.
According to Memory Beta, this timeline provides a “chronological guide to all stories and established events that have taken place in the Star Trek universe. The timeline includes stories from episodes, comics, novels, and games. Note: The timeline is largely based on the Pocket Books Timeline but also includes stories from comic and games and break downs of multi-timeframed episodes which the Pocket Timeline does not include.”
Obtaining timeline data is straightforward:
x <- mb_timeline(2360)
#> 2360
x$events
#> # A tibble: 11 x 4
#> period id date notes
#> <chr> <chr> <chr> <chr>
#> 1 2360 Events <NA> Quark opens a bar on Terok Nor. [1]
#> 2 2360 Conflicts <NA> Kalisi Reyar designs and completes a grid sys~
#> 3 2360 Federation_polit~ <NA> Pahkwa-thanh is admitted into the Federation.~
#> 4 2360 Cardassian_polit~ <NA> Miras Vara has taken the leadership of the Or~
#> 5 2360 Cardassian_polit~ <NA> Natima Lang and Gaten Russol join the cardass~
#> 6 2360 Romulan_politics <NA> Vreenak is elected.[2]
#> 7 2360 Promotions_and_t~ <NA> Data is promoted to Lieutenant Commander. [ci~
#> 8 2360 Promotions_and_t~ <NA> Joseph Carey graduates from Starfleet Academy~
#> 9 2360 Births_and_deaths <NA> Skrain Dukat's son Mekor is born. [citation n~
#> 10 2360 Births_and_deaths <NA> Caylem's wife dies in a Mokra prison.[3]
#> 11 2360 Births_and_deaths <NA> Dekon Elig dies attempting to escape the Velo~
x$stories
#> # A tibble: 6 x 11
#> title title_url colleciton collection_url section context series date media
#> <chr> <chr> <chr> <chr> <chr> <chr> <chr> <chr> <chr>
#> 1 The B~ The_Burie~ <NA> <NA> Chapte~ <NA> The N~ 2360 novel
#> 2 The B~ The_Burie~ <NA> <NA> Chapte~ <NA> The N~ 2360~ novel
#> 3 Catal~ Catalyst_~ <NA> <NA> <NA> <NA> The L~ 2360 novel
#> 4 Lefle~ Lefler%27~ No Limits No_Limits Twelft~ <NA> New F~ 2360~ shor~
#> 5 A Sti~ A_Stitch_~ <NA> <NA> Part 2~ <NA> Deep ~ 2360 novel
#> 6 Dawn ~ Dawn_of_t~ Terok Nor Star_Trek:_Te~ Prolog~ <NA> Deep ~ 2360 novel
#> # ... with 2 more variables: notes <chr>, image_url <chr>
mb_timeline
returns a list of two data frames. The first contains notable historical events and has the following columns:
period
is the year or other time period.id
values if the entries fall under different section headings on Memory Beta.date
may be filled in with more specific dates, provided they exist.notes
entries typically have citations, but these are not included in the output currently.The stories data frame represents a timeline of published stories. Since this is timeline data, stories are in chronological order, not publication date order. The stories data frame includes:
Either events or stories may be NULL
if for a given year no entries exist, respectively.
There are several ways to use mb_timeline
, based around how the timeline data is organized on Memory Beta. You saw one way above, requesting data for the year 2360. Data can be requested for:
mb_timeline(2360)
or mb_timeline(2360:2364)
. Note these are integers. All other options are character.s
to the decade, e.g., mb_timeline("2360s")
.mb_timeline("past")
returns timeline data only for the “distant past” section of the timeline.mb_timeline("future")
returns timeline data only for the “distant future” section of the timeline.mb_timeline("main")
returns timeline data only for the main section of the timeline. This is everything except for the distant past and future sections.mb_timeline("complete")
returns the complete timeline, including past, main and future sections.As with stapi
, mb_timeline
enforces a minimum one-second wait between any page requests. It could be read much faster but this measure forces users to be good neighbors. It is also recommended to try the function on a single year to see if the the results are what you expect and need before wasting time pulling the complete timeline. Note that using complete
(or main
, which is almost the same since past
and future
are relatively small) can take over ten minutes due to the enforced wait time.
This function is also memoized, meaning its results are cached in memory for each specific call. This prevents wastefully making an identical call twice in the same R session. If you do, the cached result is returned instantly. You will not see the progress printed to the console because the function is not actually called again.
When passing integer years to mb_timeline
this is the only case where the argument can be a vector. All other options are scalar, including decade. You cannot request multiple decades with c("2360s", "2370s")
. If this is what you want, use mb_timeline(2360:2379)
.
The year (or other period for past
and future
) is printed to the console as mb_timeline
progresses through timeline data for each time step. Set details = FALSE
to suppress this.
You can perform a Memory Beta site search using mb_search
. This returns a data frame of search results content, including title, truncated text preview, and short URL for the first page of search results.
It does not recursively collate search results through subsequent pages of results. There could be an unexpectedly high number of pages of results depending on the search query. Since the general nature of this search feature seems relatively casual anyway, it aims only to provide a first page preview. As with mb_article
, setting browse = TRUE
opens the page in the browser.
mb_search("Guinan")
#> # A tibble: 25 x 3
#> title text url
#> <chr> <chr> <chr>
#> 1 Guinan Guinan is a member of the El-Auri~ https://memory-beta.fandom~
#> 2 Guinan (mirro~ universe, Guinan was a member of ~ https://memory-beta.fandom~
#> 3 Jean-Luc Pica~ Jean-Luc Picard was a 24th centur~ https://memory-beta.fandom~
#> 4 Doomsday mach~ Doomsday machines or planet kille~ https://memory-beta.fandom~
#> 5 James T. Kirk James Tiberius Kirk was a male Hu~ https://memory-beta.fandom~
#> 6 USS Enterpris~ The USS Enterprise (NCC-1701-D), ~ https://memory-beta.fandom~
#> 7 Q Spoiler warning: Plot and/or endi~ https://memory-beta.fandom~
#> 8 Guardian of F~ Spoiler warning: Plot and/or endi~ https://memory-beta.fandom~
#> 9 Starbase 80 Spoiler warning: Plot and/or endi~ https://memory-beta.fandom~
#> 10 Protectors Protectors is a Star Trek: Voyage~ https://memory-beta.fandom~
#> # ... with 15 more rows
Memory Beta contains over 50,000 pages at the time of this rtrek
version. It is possible that some articles may have idiosyncratic structure that could make them inaccessible by these rtrek
functions.
Since this package version is also the first to offer this brand new functionality - and as mentioned, Memory Beta does not offer an API, leading to a less reliable web-scraping approach, it is unknown what the likelihood is at this time of breaking changes occurring during updates to Memory Beta by its maintainers.
Jolan Tru.


This site is a little experiment with CSS Filters and the art of everyone's favourite Abstract Expressionist, Mark Rothko
Like most of the internet it doesn't serve a real purpose. But it is nice to look at. Just like art.
Learn more about how this was built on GitHub or follow me on Twitter


We could not service your request.
Boring request information below:
{{request.url}}
{{request.path}}
{{request.full_path}}
{{request.endpoint}}
{{request.url_rule}}


Opening: December 29, 1997
Architectural design: Sanchez Jorge
Art work: Vieira da Silva and Arpad Szènés
Platform length: 105 m
Code: RA
Wikipedia page