Skip to content

Commit 970c5eb

Browse files
committed
Add super hero classification assignment
1 parent 5127e4d commit 970c5eb

File tree

10 files changed

+150
-0
lines changed

10 files changed

+150
-0
lines changed

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
*.zip filter=lfs diff=lfs merge=lfs -text
2+
*.enc filter=lfs diff=lfs merge=lfs -text
3+
*.tar filter=lfs diff=lfs merge=lfs -text
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2016 Jonas Brunsgaard
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
![heroes](/exercise/marvel.png?raw=true "heroes")
2+
3+
## Build a superhero api with machine learning capabilities
4+
5+
Dataset and exercise that we use as part of the hiring process for machine
6+
learning related jobs at e-conomic (Visma).
7+
8+
From `exercise.tex`;
9+
10+
> Here at e-conomic we really love superheros. In fact we love superheros
11+
> so much that we have decided to start a new department which will focus
12+
> solely on inventing new superhero characters. Our team of dedicated
13+
> inventors will think out new awesome characters and for each new creation
14+
> the inventor will devise a character description containing information
15+
> such as abilities, partnerships, team affiliations, etc.
16+
>
17+
> The two legendary US publishers, Marvel Comics and DC Comics, have shown
18+
> great interest in our new department, and they would like to make offers
19+
> on each new character....
20+
>
21+
> Due to market circumstances, when a new character is offered to a
22+
> publisher, all other publishers lose interest in buying that character,
23+
> because they are afraid that the company who got the offer first, may
24+
> steal the idea and bring onto the market a similar superhero, before the
25+
> investment can be legally secured.
26+
>
27+
> That is why we need your help! We mined Wikipedia for Marvel- and
28+
> DC-superhero articles, and now we hand you the dataset.
29+
>
30+
> Your task is to build a RESTful API that (i) manages the articles, (ii) and
31+
> offers a prediction endpoint, that uses machine learning to classify a text
32+
> as being either closer to the Marvel or the DC universe.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
version https://git-lfs.github.com/spec/v1
2+
oid sha256:13500983f0d0f957af68742948584df20322b1c885cb8719701321c224bc7941
3+
size 4891
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
version https://git-lfs.github.com/spec/v1
2+
oid sha256:8be17daa22ebdaab466bea2ac592528ca781f647648fa23a1dd2f59aa2e704be
3+
size 3850
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
version https://git-lfs.github.com/spec/v1
2+
oid sha256:dd71010ffa6a01dbd0359eff5bfbcadee0ffe341730d47a97327c4e2e4024d16
3+
size 12807748
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
version https://git-lfs.github.com/spec/v1
2+
oid sha256:91c1d8ffac2757560b2916c0b484b0522d4e657b40ef18ff5174e17ea3165017
3+
size 3804063
Loading
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
\documentclass{article}
2+
\usepackage{wrapfig}
3+
\usepackage{graphicx}
4+
\usepackage{color}
5+
\usepackage{enumitem,lipsum}
6+
\usepackage[labelformat=empty]{caption}
7+
8+
\linespread{1.05}
9+
\title{The Superhero Machine Learning Api}
10+
\date{}
11+
\begin{document}
12+
\maketitle
13+
% \thispagestyle{empty}
14+
Here at e-conomic we really love superheros. In fact we love superheros
15+
so much that we have decided to start a new department which will focus
16+
solely on inventing new superhero characters. Our team of dedicated
17+
inventors will think out new awesome characters and for each new creation
18+
the inventor will devise a character description containing information
19+
such as abilities, partnerships, team affiliations, etc.
20+
21+
The two legendary US publishers, Marvel Comics and DC Comics, have shown
22+
great interest in our new department, and they would like to make offers
23+
on each new character.
24+
25+
\begin{figure}[h]
26+
\minipage{0.5\textwidth}
27+
\centering
28+
\includegraphics[width=0.7\textwidth]{marvel}
29+
\caption*{\scriptsize{Superheros published by Marvel Comics}}
30+
\endminipage\hfill
31+
\minipage{0.5\textwidth}
32+
\centering
33+
\includegraphics[width=0.8\textwidth]{dc}
34+
\caption*{\scriptsize{Superheros published by DC Comics}}
35+
\endminipage
36+
\end{figure}
37+
38+
Due to market circumstances, when a new character is offered to a
39+
publisher, all other publishers lose interest in buying that character,
40+
because they are afraid that the company who got the offer first, may
41+
steal the idea and bring onto the market a similar superhero, before the
42+
investment can be legally secured.
43+
44+
That is why we need your help! We mined Wikipedia for Marvel- and
45+
DC-superhero articles, and now we hand you the dataset\footnote{In the
46+
handout you will find \texttt{data.zip}}.
47+
48+
Your task is to build a RESTful API that (\textit{i}) manages the
49+
articles, (\textit{ii}) and offers a prediction endpoint, that uses
50+
machine learning to classify a text as being either closer to the Marvel
51+
or the DC universe.
52+
53+
\clearpage
54+
The API should use some kind of database for persistence and offer the
55+
following endpoints.
56+
\vspace{0.5cm}
57+
\begin{description}[labelindent=0.5cm, leftmargin=1cm]
58+
\item[\texttt{/article/(\$id)}] \hfill \\
59+
Article resource endpoint(s). The api should as minimum be able
60+
to read a resource, creates a resource, updates a resource,
61+
delete a resource and list resource URI's. The training data from
62+
\texttt{data.zip} should be posted to this endpoint.
63+
\item[\texttt{/train}] \hfill \\
64+
Train or re-train your machine learning model based on the
65+
articles in the database.
66+
\item[\texttt{/predict}] \hfill \\
67+
Receive a text as input and return classification results.
68+
\end{description}
69+
\vspace{0.5cm}
70+
\noindent You will present the solution to a team of e-conomic developers
71+
and they might have questions and suggestions about the code and machine
72+
learning techniques. Keep in mind that we do not expect your code to be
73+
production ready. What we're looking for is how you approach the problem,
74+
preferably creating some nice and clean code along the way. We will
75+
appreciate if your solution is working and comes with a build guide, so
76+
that we can run and test it.
77+
78+
When presenting the solution you are welcome to bring your own laptop if
79+
that suits you better. In case you have questions, please do not hesitate
80+
to ask.
81+
\\\\
82+
Happy coding :)
83+
\end{document}
Loading

0 commit comments

Comments
 (0)