-
Notifications
You must be signed in to change notification settings - Fork 0
/
How to enter your first Zindi competition - Zindi.html
325 lines (290 loc) · 78.2 KB
/
How to enter your first Zindi competition - Zindi.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
<!DOCTYPE html>
<!-- saved from url=(0071)https://zindi.africa/learning/how-to-enter-your-first-zindi-competition -->
<html lang="en" class="wf-loadingwf-inactive wf-nunito-n3-active wf-nunito-n4-active wf-active"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<!-- nextgen -->
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
<link rel="apple-touch-icon-precomposed" sizes="57x57" href="https://assets.zindi.africa/apple-touch-icon-57x57.png">
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="https://assets.zindi.africa/apple-touch-icon-114x114.png">
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="https://assets.zindi.africa/apple-touch-icon-72x72.png">
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="https://assets.zindi.africa/apple-touch-icon-144x144.png">
<link rel="apple-touch-icon-precomposed" sizes="120x120" href="https://assets.zindi.africa/apple-touch-icon-120x120.png">
<link rel="apple-touch-icon-precomposed" sizes="152x152" href="https://assets.zindi.africa/apple-touch-icon-152x152.png">
<link rel="icon" type="image/png" href="https://assets.zindi.africa/favicon-32x32.png" sizes="32x32">
<link rel="icon" type="image/png" href="https://assets.zindi.africa/favicon-16x16.png" sizes="16x16">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:site" content="@ZindiAfrica">
<meta name="application-name" content=" ">
<meta name="msapplication-TileColor" content="#FFFFFF">
<meta name="msapplication-TileImage" content="https://assets.zindi.africa/mstile-144x144.png">
<script async="" src="./How to enter your first Zindi competition - Zindi_files/tag.js"></script><script async="" src="./How to enter your first Zindi competition - Zindi_files/gtm.js"></script><script src="./How to enter your first Zindi competition - Zindi_files/webfont.js" async=""></script><script type="text/javascript">
var WebFontConfig = {
google: {
families: ["Nunito:300,400"],
},
timeout: 2000,
}
;(function (d) {
var h = d.documentElement
var onerror = function () {
h.className += "wf-inactive"
}
var st = setTimeout(onerror, 1000)
h.className += "wf-loading"
var wf = d.createElement("script"),
s = d.scripts[0]
wf.src = "https://ajax.googleapis.com/ajax/libs/webfont/1.6.26/webfont.js"
wf.async = true
wf.onerror = onerror
wf.onload = function () {
clearTimeout(st)
}
s.parentNode.insertBefore(wf, s)
})(document)
</script>
<title>How to enter your first Zindi competition - Zindi</title><meta data-react-helmet="true" name="description" content="Zindi is a data science competition platform with the mission of building the data science ecosystem in Africa. Zindi hosts a community of data scientists dedicated to solving the continent's most pressing problems through machine learning and artificial intelligence."><meta data-react-helmet="true" property="og:site_name" content="Zindi"><meta data-react-helmet="true" property="twitter:site_name" content="Zindi"><meta data-react-helmet="true" property="og:title" content="How to enter your first Zindi competition"><meta data-react-helmet="true" property="og:description" content="For many people joining Zindi, this will be the first time they enter a machine learning competition. This can be a scary challenge, so we're trying make it easier with a step-by-step guide to making your first submission on Zindi. Follow along with us, and you'll be racing up the leaderboards in no time."><meta data-react-helmet="true" property="og:image" content="https://zindpublic.blob.core.windows.net/public/uploads/blog_post/image/49/big_thumb_bdde99cf-1d73-4fc1-b863-69287254fdbd.jpg"><meta data-react-helmet="true" property="twitter:title" content="How to enter your first Zindi competition"><meta data-react-helmet="true" property="twitter:description" content="For many people joining Zindi, this will be the first time they enter a machine learning competition. This can be a scary challenge, so we're trying make it easier with a step-by-step guide to making your first submission on Zindi. Follow along with us, and you'll be racing up the leaderboards in no time."><meta data-react-helmet="true" property="twitter:image" content="https://zindpublic.blob.core.windows.net/public/uploads/blog_post/image/49/big_thumb_bdde99cf-1d73-4fc1-b863-69287254fdbd.jpg">
<script>
;(function (w, d, s, l, i) {
w[l] = w[l] || []
w[l].push({ "gtm.start": new Date().getTime(), event: "gtm.js" })
var f = d.getElementsByTagName(s)[0],
j = d.createElement(s),
dl = l != "dataLayer" ? "&l=" + l : ""
j.async = true
j.src = "https://www.googletagmanager.com/gtm.js?id=" + i + dl
f.parentNode.insertBefore(j, f)
})(window, document, "script", "dataLayer", "GTM-KRG85D8")
</script>
<link rel="stylesheet" href="./How to enter your first Zindi competition - Zindi_files/css" media="all"><link href="./How to enter your first Zindi competition - Zindi_files/bundle.d57dc7d8a01460a702c7.css" rel="stylesheet"></head>
<body _c_t_common="1" data-new-gr-c-s-check-loaded="14.1020.0" data-gr-ext-installed="">
<noscript> You need to enable JavaScript to run this app. </noscript>
<div id="app"><div class="App__container___fj0c9"><div class="App__section___1nGff"></div><div class="App__section___1nGff"><div class="App__contained___3emDO"><div class="Header__container___3FtbH"><a href="https://zindi.africa/"><div class="Header__logo___1eRaO">Zindi</div></a><div class="Header__menuContainer___2izgT"><div class="Menu__container___1sjgb"><a class="Menu__link___3x4C4" href="https://zindi.africa/competitions"><span class="Menu__linkInner___3LB5N">Compete</span></a><a aria-current="page" class="Menu__link___3x4C4 Menu__activeLink___1MA6r" href="https://zindi.africa/learning"><span class="Menu__linkInner___3LB5N">Learn</span></a><a class="Menu__link___3x4C4" href="https://zindi.africa/jobs"><span class="Menu__linkInner___3LB5N">Find a Job</span></a></div><div class="Menu__container___1sjgb Header__menuRight___3wiDe Menu__justifyRight___3r6Ws"><a class="Menu__link___3x4C4" href="https://zindi.africa/inbox"><span class="Menu__linkInner___3LB5N"><div class="Inbox__container___3xHCr"><svg class="Inbox__messagesIcon___2XP8V" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z"></path><polyline points="22,6 12,13 2,6"></polyline></svg><div class="Inbox__unseen___31NED"></div></div></span></a></div></div><div class="Header__userMenu___2iOts"><div class="UserMenu__container___ypkko"><button class="Button__base___NhksY Button__blank-normal___1nB5F UserMenu__user___a0zJo"><span class="Button__inner___3jkeF"><span class="User__container___18HoF User__size-normal___26ZPA"><img class="User__avatar___6aNx2" src="./How to enter your first Zindi competition - Zindi_files/thumb.default.png" alt=""><span class="User__username___64PE2">Glencode</span></span></span></button><div class=""></div></div></div></div></div></div><div class="App__section___1nGff App__content___WFkDX"><div class="WithSubheader__container___3qd5U"><div class="WithSubheader__header___2o1oX WithSubheader__withHeader___35ECw"><div class="BlogPost__headerImage___2fAz4" style="background-image: url("https://zindpublic.blob.core.windows.net/public/uploads/blog_post/image/49/header_bdde99cf-1d73-4fc1-b863-69287254fdbd.jpg");"></div></div><div><div class="App__contained___3emDO"><div class="Paper__paper___2M-1R Paper__padding-1___3sKLR BlogPost__paper___1D3Be"><div class="BlogPost__date___3BhZy">12 Mar 2020, 10:33</div><h2 class="BlogPost__title___RUU5Z">How to enter your first Zindi competition</h2><div class="Html__container___1AJFz BlogPost__intro___31fc-"><p>For many people joining Zindi, this will be the first time they enter a machine learning competition. This can be a scary challenge, so we're trying make it easier with a step-by-step guide to making your first submission on Zindi. Follow along with us, and you'll be racing up the leaderboards in no time.</p><p>Zindi provides different categories of competition:</p><ul class="public-DraftStyleDefault-ul">
<li>
<span style="font-weight: bold;" class="">Prize competition:</span> you win prize money if you are among the top 3 winners of a particular competition.</li>
<li>
<span style="font-weight: bold;" class="">You win points:</span> Points increase your ranking among other data scientists on the platform.</li>
<li>
<span style="font-weight: bold;" class="">You gain knowledge:</span> Knowledge competitions are where you can learn and increase your skill set.</li>
</ul><p>As a data scientist or ML engineer in Africa, Zindi Africa is the best platform for you to learn and take your skills to the next level. The following are some of the benefits you can gain by being part of the Zindian family:</p><ul class="public-DraftStyleDefault-ul">
<li>Test your skills against top talent across Africa and beyond</li>
<li>Learn by doing and gain practical exposure to real data science problems</li>
<li>Earn income by doing what you enjoy</li>
<li>Build your profile and attract potential employers</li>
<li>Learn from others through collaboration and discussion with other data scientists and ML engineers.</li>
</ul><p>In this article, we provide a walkthrough of how to enter a Zindi competition for the first time. In this article we will:</p><ul class="public-DraftStyleDefault-ul">
<li>Join a specific competition called Financial Inclusion in Africa</li>
<li>Understand the competition description and problem statement</li>
<li>Download and analyze the dataset provided</li>
<li>Process the dataset provided</li>
<li>Develop a model to predict who is most likely to have a bank account</li>
<li>Evaluate the model performance</li>
<li>Use the model to make predictions for the test dataset provided in the competition</li>
<li>Make the first submission and get placed on the Zindi leaderboard</li>
</ul><h3>Financial Inclusions in Africa</h3><p>Before we go deep into the competition, let’s understand the <span style="font-weight: bold;" class="">competition page</span> first by clicking <a href="https://zindi.africa/competitions/financial-inclusion-in-africa" target="_blank" rel="noreferrer noopener">here</a>. If you don’t already have a Zindi account you can create one for free <a href="https://zindi.africa/" target="_blank" rel="noreferrer noopener">here</a>.</p><p></p><div class="image">
<img src="./How to enter your first Zindi competition - Zindi_files/22431163-c404-420b-b2d6-f96864f22f7c.png"> </div><p></p><p>The <span style="font-weight: bold;" class="">competition page</span> provides some information to help you understand the problem you are going to solve, by reading the problem statement, how you can participate and how to submit your solution on the platform.</p><p>We will go through each tab and explain its functionality.</p><h3>1. Info</h3><p>The info tab contains the problem statements of the competition and list of organizations that have either provided the dataset or funded the competition.</p><p>On the left side, you can see a list of vertical tabs that provide more information about the competition.</p><p><span style="font-weight: bold;" class="">(a) Description</span></p><p>It provides the problem statement of the competition and a list of organisations or companies that supported the competition, either by providing the datasets or funding the competition.</p><p>We suggest you read the description of this competition in order to understand the problem and machine learning approach you can choose to solve it. If you read the description, you will understand that the objective of this competition is to create a machine learning model to predict which individuals are most likely to have or use a bank account.</p><p><span style="font-weight: bold;" class="">(b) Rules</span></p><p></p><div class="image">
<img src="./How to enter your first Zindi competition - Zindi_files/647d6615-df60-47d2-9514-1daed73ed50f.png"> </div><p></p><p>Each competition has its own rules. Breaking the rules can lead to <span style="font-weight: bold;" class="">disqualification</span>, so make sure to carefully read and understand all the rules of the competition.</p><p><span style="font-weight: bold;" class="">(c) Prizes</span></p><p>Now, this is the best part: the prize section provides details about the prize money that will be provided for the first, second and third place winners of the competition. But remember not all competition provides prize money for its winners; in other competitions, you can get <span style="font-weight: bold;" class="">Zindi points</span> or gain <span style="font-weight: bold;" class="">knowledge</span>.</p><p><span style="font-weight: bold;" class="">(d) Evaluation</span></p><p></p><div class="image">
<img src="./How to enter your first Zindi competition - Zindi_files/2c9acfba-42ce-4bcd-90fd-b02e758226e3.png"> </div><p></p><p>Each competition has its own evaluation metric that will be used to evaluate your results and rank you on the leaderboard. It also shows how you should prepare your submission file before uploading your file on the platform.</p><p>For this competition, the evaluation metric will be the percentage of survey respondents for whom you predict the binary ‘bank account’ classification <span style="font-weight: bold;" class="">incorrectly</span>.</p><p><span style="font-weight: bold;" class="">(e) Timeline</span></p><p></p><div class="image">
<img src="./How to enter your first Zindi competition - Zindi_files/a65d6d7a-cd58-4ddf-a2b9-a78b0537e168.png"> </div><p></p><p>This section provides information about the <span style="font-weight: bold;" class="">start date</span> of the competition and the <span style="font-weight: bold;" class="">end date and time</span> of the competition. If you submit your solution after the deadline you will receive a score but it will not reflect on the leaderboard. Make sure to submit before the deadline if you want to be considered for a prize.</p><p>This competition has been reopened as a knowledge challenge, this means it will not close.</p><h3>2. Data</h3><p></p><div class="image">
<img src="./How to enter your first Zindi competition - Zindi_files/4ecc2bfd-3139-4b07-8af5-7b01fc8993e5.png"> </div><p></p><p>The data tab contains a description of the dataset you are going to use for this competition. On the right side of the page, you can see a list of links to download the dataset and other important files. You will download:</p><ul class="public-DraftStyleDefault-ul">
<li>
<span style="font-weight: bold;" class="">VariableDefinition.csv </span>— This file contains a definition of each variable in the train and test data.</li>
<li>
<span style="font-weight: bold;" class="">SubmissionFile.csv </span>— The file contains a sample of how the submission file should look like.</li>
<li>
<span style="font-weight: bold;" class="">Test_v2.csv</span> — This is a test data file you will use for prediction and save your results in the submission file.</li>
<li>
<span style="font-weight: bold;" class="">Train._v2.cs - </span>This is a train data file that contains both the independent variable and the target one. You will use this dataset to train your model.</li>
</ul><p>These files may differ between competitions. Also, keep in mind that you must join the competition in order to have access to the data files.</p><h3>3. Discussion</h3><p></p><div class="image">
<img src="./How to enter your first Zindi competition - Zindi_files/7f61b064-c6e8-44ce-a501-d98c119bf8fd.png"> </div><p></p><p>We're not Liverpool FC fans but we like their slogan: <span style="font-weight: bold;" class="">“You will never walk alone”</span>. That is the <span style="font-weight: bold;" class="">purpose</span> of the discussion page, you don’t need to walk alone throughout the competition. If you face any challenge or uncertainty during the competition or you want to ask a question to understand more about the dataset provided, you can post on the discussion page and other data scientists enrolled in the competition can help you to solve the problem.</p><p>The discussion board is very active and full of knowledgeable and helpful African data scientists willing to assist you.</p><h3>4. Leaderboard</h3><p></p><div class="image">
<img src="./How to enter your first Zindi competition - Zindi_files/72c76187-5796-451c-8e40-8de54ac33ade.png"> </div><p></p><p>After you have uploaded your submission file, you will appear on the leaderboard. The leaderboard shows your position among all enrolled data scientists in the competition. Your position will depend on your performance after your solution has been evaluated. For this competition, you can submit ten times a day.</p><h3>5. Team</h3><p></p><div class="image">
<img src="./How to enter your first Zindi competition - Zindi_files/7a1553c5-b388-4f07-acfd-ffdfaa052227.png"> </div><p></p><p>You don’t want to do the competition on your own? That’s OK! You can create a team with fellow data scientists enrolled in the competition and work together. The maximum number for a team is 4 members. Remember that sharing code between individuals is not allowed, so if you want to share code with someone else, they must be on the same team as you.</p><h3>6. Submission</h3><p></p><div class="image">
<img src="./How to enter your first Zindi competition - Zindi_files/1c238be3-0e55-4d1a-953d-2a1232ddf66c.png"> </div><p></p><p>The submission page is where you will upload your submission file, by clicking the orange button at the top right side of the page. After you have uploaded your solution, it will be evaluated according to the evaluation metric specified in the competition. Then you will see the score that will define your position on the leaderboard.</p><h3>Solve the problem</h3><p>After understanding the Financial Inclusion in Africa competition page and its different sections, let’s solve the problem provided.</p><h3>1. Load the dataset</h3><p>Make sure you have downloaded the dataset provided in the competition. You can download the dataset <a href="https://zindi.africa/competitions/financial-inclusion-in-africa/data" target="_blank" rel="noreferrer noopener">here</a>.</p><p>Import important python packages.</p><div class="codeblock"><pre>import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
import warnings
np.random.seed(123)
warnings.filterwarnings('ignore')
%matplotlib inline</pre></div><p>Load the train and test dataset.</p><div class="codeblock"><pre># Import data
train_data = pd.read_csv('data/Train_v2.csv')
test_data = pd.read_csv('data/Test_v2.csv')</pre></div><p>Let’s observe the shape of our datasets.</p><div class="codeblock">
<pre># print shape
print('train data shape :', train_data.shape)
print('test data shape :', test_data.shape)</pre>
<pre>train data shape : (23524, 13)
test data shape : (10086, 12)</pre>
</div><p>The above output shows the number of rows and columns for train and test dataset. We have 13 variables in the train dataset, 12 independent variables and 1 dependent variable. In the test dataset, we have 12 independent variables.</p><p>We can observe the first five rows from our data set by using the head() method from the pandas library.</p><div class="codeblock"><pre># inspect train data
train_data.head()</pre></div><p></p><p></p><div class="image">
<img src="./How to enter your first Zindi competition - Zindi_files/1c1e780f-214a-4003-948b-05689054d7b5.png"> </div><p></p><p>It is important to understand the meaning of each feature so you can really understand the dataset. You can read the <span style="font-weight: bold;" class="">VariableDefinition.csv</span> file to understand the meaning of each variable presented in the dataset.</p><p>The <span style="font-weight: bold;" class="">SubmissionFile.csv</span> gives us an example of how our submission file should look. This file will contain the uniqueid column combined with the country name from the <span style="font-weight: bold;" class="">Test_v2.csv</span> file and the target we predict with our model. Once we have created this file, we will submit it to the competition page and obtain a position on the leaderboard.</p><div class="codeblock"><pre>submission = pd.read_csv('data/SubmissionFile.csv')
submission.head()</pre></div><p></p><p></p><div class="image">
<img src="./How to enter your first Zindi competition - Zindi_files/4f260f79-f0f9-47b8-a358-dba96ba07a55.png"> </div><p></p><h3>2. Understand the dataset</h3><p>We can get more information about the features presented by using the info() method from pandas.</p><div class="codeblock"><pre> #show Some information about the dataset
print(train_data.info())</pre></div><p></p><p></p><div class="image">
<img src="./How to enter your first Zindi competition - Zindi_files/d1e53e5b-6894-46b1-a8bb-962533ac63f4.png"> </div><p></p><p>The output shows the list of variables/features, sizes, if it contains missing values and data type for each variable. From the dataset, we don’t have any missing values and we have 3 features of integer data type and 10 features of the object data type.</p><p>If you want to learn how to handle missing data in your dataset, we recommend you read <a href="https://machinelearningmastery.com/handle-missing-data-python/" target="_blank" rel="noreferrer noopener">How to handle missing data with python</a> by Jason Brownlee.</p><p>We won’t go further on understanding the dataset because Davis has already published an article about exploratory data analysis (EDA) with the financial Inclusion in Africa dataset. You can read and download the notebook for EDA in the link below.</p><p><a href="https://medium.com/analytics-vidhya/why-you-need-to-explore-your-data-how-you-can-start-13de6f29c8c1" target="_blank" rel="noreferrer noopener">Why you need to explore your data and how you can start</a></p><h3>3. Data preparation for machine learning</h3><p>Before you train the model for prediction, you need to perform data <a href="https://www.dataquest.io/blog/machine-learning-preparing-data/" target="_blank" rel="noreferrer noopener">cleaning</a> and <a href="https://towardsdatascience.com/data-preprocessing-concepts-fa946d11c825" target="_blank" rel="noreferrer noopener">preprocessing</a>. This is a very important step; your model will not perform well without these steps.</p><p></p><div class="image">
<img src="./How to enter your first Zindi competition - Zindi_files/48f91a8a-d9c4-4853-ab32-ccb9f143a238.png"> </div><p></p><p>The first step is to separate the independent variables and <span style="font-weight: bold;" class="">target(bank_account)</span> from the train data. Then transform the target values from the object data type into numerical by using <a href="https://towardsdatascience.com/categorical-encoding-using-label-encoding-and-one-hot-encoder-911ef77fb5bd" target="_blank" rel="noreferrer noopener">LabelEncoder</a>.</p><div class="codeblock"><pre>#import preprocessing module
from sklearn.preprocessing import LabelEncoder
from sklearn.preprocessing import MinMaxScaler
# Cobvert target label to numerical Data
le = LabelEncoder()
train_data['bank_account'] = le.fit_transform(train_data['bank_account'])
#Separate training features from target
X_train = train_data.drop(['bank_account'], axis=1)
y_train = train_data['bank_account']
print(y_train)</pre></div><p></p><p></p><div class="image">
<img src="./How to enter your first Zindi competition - Zindi_files/08986008-97be-4107-aba3-025a74f2dbfa.png"> </div><p></p><p>The target values have been transformed into numerical datatypes, <span style="font-weight: bold;" class="">1</span> represents <span style="font-weight: bold;" class="">‘Yes’</span> and <span style="font-weight: bold;" class="">0</span> represents <span style="font-weight: bold;" class="">‘No’</span>.</p><p>We have created a simple preprocessing function to:</p><ul class="public-DraftStyleDefault-ul">
<li>Handle conversion of data types</li>
<li>Convert categorical features to numerical features by using <a href="https://towardsdatascience.com/categorical-encoding-using-label-encoding-and-one-hot-encoder-911ef77fb5bd" target="_blank" rel="noreferrer noopener">One-hot Encoder and Label Encoder</a></li>
<li>Drop uniqueid variable</li>
<li>Perform <a href="https://towardsdatascience.com/preprocessing-with-sklearn-a-complete-and-comprehensive-guide-670cb98fcfb9" target="_blank" rel="noreferrer noopener">feature scaling</a>.</li>
</ul><p>The processing function will be used for both train and test independent variables.</p><div class="codeblock"><pre># function to preprocess our data from train models
def preprocessing_data(data):
# Convert the following numerical labels from interger to float
float_array = data[["household_size", "age_of_respondent", "year"]].values.astype(float
)
# categorical features to be onverted to One Hot Encoding
categ = [
"relationship_with_head",
"marital_level",
"job_type",
"country",
]
# One Hot Encoding conversion
data = pd.get_dummies(data, prefix_sep="_", columns=categ)
# Label Encoder conversion
data["location_type"] = le.fit_transform(data["location_type"])
data["cellphone_access"] = le.fit_transform(data["cellphone_access"])
data["gender_of_respondent"] = le.fit_transform(data["gender_of_respondent"])
# drop uniquid column
data = data.drop(["uniquid"]), axis=1)
# scale our data into range of 0 and 1
scaler = MinMaxScaler(feature_range=(0, 1))
data = scaler.fit_transform(data)
return data </pre></div><p>Preprocess both train and test dataset.</p><div class="codeblock"><pre># preprocess the train data
processed_test_data = preprocessing_data(X_train)
processed_test_data = preprocessing_data(test_data)</pre></div><p>Observe the first row in the train data.</p><div class="codeblock"><pre># the first train row
print(processed_train_data[:1])</pre></div><p></p><p></p><div class="image">
<img src="./How to enter your first Zindi competition - Zindi_files/e5ea8546-77f2-4864-8918-7b7ecb790412.png"> </div><p></p><p>Observe the shape of the train data.</p><div class="codeblock">
<pre># shape of the processed train set
print(processed_train_data.shape)</pre>
<pre>(23524, 37)</pre>
</div><p>Now we have more independent variables than before <span style="font-weight: bold;" class="">(37 variables)</span>. This doesn’t mean all these variables are important to train our model. You need to select only important features that can increase the performance of the model. But we will not apply any feature selection technique in this article; if you want to learn and know more about feature selection techniques, we recommend you read the following articles:</p><ul class="public-DraftStyleDefault-ul">
<li>
<a href="https://www.analyticsvidhya.com/blog/2016/12/introduction-to-feature-selection-methods-with-an-example-or-how-to-select-the-right-variables/" target="_blank" rel="noreferrer noopener">Introduction to Feature Selection methods with an example (or how to select the right variables?).</a></li>
<li>
<a href="https://towardsdatascience.com/the-5-feature-selection-algorithms-every-data-scientist-need-to-know-3a6b566efd2" target="_blank" rel="noreferrer noopener">The 5 Feature Selection Algorithms every Data Scientist should know.</a></li>
<li>
<a href="https://machinelearningmastery.com/feature-selection-with-real-and-categorical-data/" target="_blank" rel="noreferrer noopener">How to Choose a Feature Selection Method For Machine Learning.</a></li>
<li>
<a href="https://towardsdatascience.com/feature-selection-techniques-in-machine-learning-with-python-f24e7da3f36e" target="_blank" rel="noreferrer noopener">Feature Selection Techniques in Machine Learning with Python.</a></li>
</ul><h3>4. Model Building and Experiments</h3><p>A portion of the train data set will be used to evaluate our models and find the best one that performs well before using it in the test dataset.</p><div class="codeblock"><pre># Split train_data
from sklearn.model_selection import train_test_spilt
X_Train, X_val, y_Train, y_val - train_test_split(processed_train_data, y_train, stratify = y_train,
test_size = 0.1, random_state=42)</pre></div><p>Only 10% of the train dataset will be used for evaluating the models. The parameter <span style="font-weight: bold;" class="">stratify = y_train</span> will ensure an equal balance of values from both classes (‘yes’ and ‘no’) for both train and validation set.</p><p>We have selected five algorithms for this classification problem to train and predict who is most likely to have a bank account.</p><ul class="public-DraftStyleDefault-ul">
<li>
<a href="https://www.datacamp.com/community/tutorials/random-forests-classifier-python" target="_blank" rel="noreferrer noopener">Random Forest</a></li>
<li>
<a href="https://www.datacamp.com/community/tutorials/k-nearest-neighbor-classification-scikit-learn" target="_blank" rel="noreferrer noopener">K Nearest Neighbors</a></li>
<li>
<a href="https://machinelearningmastery.com/logistic-regression-tutorial-for-machine-learning/" target="_blank" rel="noreferrer noopener">Logistic Regression</a></li>
<li>
<a href="https://www.tutorialspoint.com/machine_learning_with_python/machine_learning_with_python_extra_trees.htm" target="_blank" rel="noreferrer noopener">Extra Trees</a></li>
<li>
<a href="https://www.datacamp.com/community/tutorials/xgboost-in-python" target="_blank" rel="noreferrer noopener">XGBoost</a></li>
</ul><p>From these algorithms, we can find the one that performs better than the others. We will start by training these models using the train set after splitting our train dataset.</p><div class="codeblock"><pre>#import classifier algorithm here
from sklearn.linear_model import LogisticRegression
from sklearn.ensemble import RandomForestClassifier
from sklearn.neighbors import KNeighborClassifier
from sklearn.ensemble import ExtraTreesClassifier
from xgboost import XGBClassifier
# create models
lg_model = LogisticRegression()
rf_model = RandomForestClassifier()
kn_model = KNeighborsClassifier()
et_model = ExtraTreesClassifier()
xg_model = XGBClassifier()
#fitting the models
lg_model.fit(X_Train,y_Train)
rf_model.fit(X_Train,y_Train)
kn_model.fit(X_Train,y_Train)
et_model.fit(X_Train,y_Train)
xg_model(X_Train,y_Train)</pre></div><p>After training five models, let’s use the trained models to predict our evaluation set and see how these models perform. We will use the evaluation metric provided on the competition page. The statement from the competition page stated that:</p><blockquote>The evaluation metric for this challenge will be the percentage of survey respondents for whom you predict the binary 'bank account' classification incorrectly.</blockquote><p>This means the <span style="font-weight: bold;" class="">lower</span> the incorrect percentage we get, the better the model performance.</p><div class="codeblock"><pre># import evaluation metrics
from sklearn.metrics import confusion_matrix, accuracy_score
# evaluate the model
lg_y_pred = lg_model.predict(X_val)
rf_y_pred = rf_model.predict(X_val)
kn_y_model = kn_model.predict(X_val)
et_y_model = et_model.predict(X_val)
xg_y_model = xg_model.predict(X_val)
# Get error rate
print("Error rate Logistic Regression classifier: ", 1 - accuracy_score(y_val, lg_y_pred))
print("Error rate of Random Forest classifier: ", 1 - accuracy_scorey_val, rf_y_pred))
print("Error rate of KNeighbors Classifier: ", 1 - accuracy_score(y_val, kn_y_pred))
print("Error rate of Extra Tree classifier: ", 1 - accuracy_score(y_val, et_y_pred))
print("Error rate of XGB classifier: ", 1 - accuracy_score(y_val, xg_y_pred))</pre></div><p></p><p></p><div class="image">
<img src="./How to enter your first Zindi competition - Zindi_files/da5d9df1-a0f4-4778-9fc1-3732ed5b885e.png"> </div><p></p><p>XGBoost classifier performs better than other models with <span style="font-weight: bold;" class="">0.110</span> incorrect.</p><p>Let’s check the confusion matrix for XGB model.</p><div class="codeblock"><pre>from sklearn.metrics import plot_confusion_matrix
# Get confusion matrix for Gradient Boosting Classifier
plot_confusion_matrix( xg_model,X_val, y_val,normalize='true')</pre></div><p></p><p></p><div class="image">
<img src="./How to enter your first Zindi competition - Zindi_files/0740f0ff-894e-4693-bff4-7459dad02da8.png"> </div><p></p><p>Our XGBoost model performs well on predicting <span style="font-weight: bold;" class="">class 0</span> and performs poorly on predicting <span style="font-weight: bold;" class="">class 1</span>, it may be caused by the imbalance of data provided(the target variable has more ‘No’ values than ‘Yes’ values). You can learn the best way to deal with imbalanced data here.</p><p>One way to increase the model performance is by applying the Grid search method as an approach to parameter tuning that will methodically build and evaluate a model for each combination of algorithm parameters specified in a grid.</p><div class="codeblock"><pre># Import GridSearchCV
from sklearn.model_selection import GridSearchCV
# Optimize model parameters
# I run this code in google colab to make the execution much faster and use the best params in the next code
param_grid = {'min_child_weighth': [1, 5, 10],
'gamma': [0.5, 1],
'subsample': [0.6, 0.8, 1.0],
'max_depth': [3, 5]
}
my_xgb_model - GridSearchCV(xg_model, param_grid,n_jobs=-1,verbose=2,cv=5)
my_xgb_model.fit(X_Train, y_Train)
print(my_xgb_model.best_params_) </pre></div><p>The above source code will evaluate which parameter values for min_child_weight, gamma, subsample and max_depth will give us better performance.</p><p></p><div class="image">
<img src="./How to enter your first Zindi competition - Zindi_files/3f589ae1-b902-4f21-bbf5-6ee1d5cc59cc.png"> </div><p></p><p>Let’s use these parameter values and see if the XGB model performance will increase.</p><div class="codeblock">
<pre>from sklearn.metrics import confusion_matrix, accuracy_score
# fit by setting best parameters and Evaluate model
xgb_model = XGBClassifier(min_child_weight=1, gamma=1, subsample=0.8, max_depth=5)
xgb_model.fit(X_Train, y_Train)
y_pred = xgb_model.predict(X_val)
# Get error rate
print("Error rate of the XGB classifier: ", 1 - accuracy_score(y_val, y_pred))</pre>
<pre>Error rate of the XGB model: 0.10837229069273269</pre>
</div><p>Our XGB model has improved from the previous performance of <span style="font-weight: bold;" class="">0.110</span> to <span style="font-weight: bold;" class="">0.108</span>.</p><h3>
<span style="font-weight: bold;" class="">5. Making the first submission</span></h3><p>After improving the XGBoost model performance, let’s now see how the model performs on the competition test data set provided and how we rank on the competition leaderboard.</p><p>First, we make predictions on the competition test data set.</p><div class="codeblock"><pre># Get the predicted result for the test Data
test_data.bank_account = xgb_model.predict(processed_test_data)</pre></div><p>Then we create a submission file according to the instruction provided in the SubmissionFile.csv.</p><div class="codeblock"><pre># crete submission DataFrame
submission = pd.DataFrame({"uniqueid": test_data["uniqueid"] + " x " + test_data["country"],
"bank_account": test_data.bank_account})</pre></div><p>Let’s observe the sample results from our submission dataFrame.</p><div class="codeblock"><pre>#show the five sample
submission.sample(5)</pre></div><p></p><p></p><div class="image">
<img src="./How to enter your first Zindi competition - Zindi_files/3aacd9bf-2005-4a5b-96a0-41e8c4705eb6.png"> </div><p></p><p>Save results in the CSV file.</p><div class="codeblock"><pre># Create submission csv file csv file
submission.to_csv('data/submission/first_submission.csv', index = false)</pre></div><p>We named our submission file a <span style="font-weight: bold;" class="">first_submission.csv</span>. Now we can upload it to the Zindi competition page by clicking the submit button and selecting the file to upload., You also have an option to add comments for each submission.</p><p></p><div class="image">
<img src="./How to enter your first Zindi competition - Zindi_files/59add969-877b-4a20-beb7-4ecda2f812ce.png"> </div><p></p><p>Then click the submit button to upload your submission file. Congratulations, you just made your first Zindi submission! The system will evaluate your results according to the evaluation methods for this competition.</p><p></p><div class="image">
<img src="./How to enter your first Zindi competition - Zindi_files/7ff645aa-7d04-4177-9cdb-dc1f159777f9.png"> </div><p></p><p>Now you can see the performance of our XGB model is 0.109 on the test dataset provided.</p><p>You can also see your position on the Leaderboard.</p><h3>Wrap up</h3><p>In this article, we have given an overview of how to make your first submission to a Zindi competition. We suggest you take further steps to handle the imbalance of data and find alternative feature engineering and selection techniques you can apply to increase your model performance, or trying other machine learning algorithms. If you get stuck, don’t forget to ask for help on the discussion boards!</p><p>You can access the notebook for this article in the link below.</p><p><a href="https://github.com/Davisy/How-to-Enter-Your-First-Zindi-Competition" target="_blank" rel="noreferrer noopener">Davisy/How-to-Enter-Your-First-Zindi-Competition</a></p><p>If you learned something new or enjoyed reading this article, please share it so that others can see it. Feel free to leave a comment on the discussion board too.</p><h3>About the author</h3><p>Davis David is a data scientist at ParrotAI and Zindi Ambassador. He is passionate about artificial intelligence, machine learning, deep learning and big data. He is a co-organizer and facilitator of the AI movement in Tanzania; conducting AI meetups, workshops and events with a passion to build a community of data scientists to solve local problems. He can be reached on Twitter <a href="https://twitter.com/Davis_McDavid" target="_blank" rel="noreferrer noopener">@Davis_McDavid</a>.</p><p>You can read the original blog post <a href="https://medium.com/@Davis_David/how-to-enter-your-first-zindi-competition-3e9ce335d34b" target="_blank" rel="noreferrer noopener">here</a>.</p></div></div></div></div></div></div><div class="App__section___1nGff"><div class="Footer__container___3vGXM"><div class="App__contained___3emDO"><div class="Footer__links___dDoS-"><div class="Footer__column___1yO21"><div><a href="https://zindi.africa/competitions">Competitions</a></div><div><a href="https://zindi.africa/hackathons">Hackathons</a></div><div><a href="https://zindi.africa/data_scientists">Data Scientists</a></div><div><a href="https://zindi.africa/discussions">Discussions</a></div><div><a href="https://zindi.africa/jobs">Jobs Board</a></div></div><div class="Footer__column___1yO21"><div><a href="https://zindi.africa/hosting_competition">Host competition</a></div><div><a href="https://zindi.africa/about">About Us</a></div><div><a href="https://zindi.africa/partners">Our Partners</a></div><div><a href="https://zindi.africa/contact_us">Contact Us</a></div></div><div class="Footer__column___1yO21"><div><a href="https://zindi.africa/rules">Rules and Guidelines</a></div><div><a href="https://zindi.africa/terms">Terms of Use</a></div><div><a href="https://zindi.africa/privacy">Privacy Policy</a></div><div><a href="https://zindi.africa/faq">FAQs</a></div></div><div class="Footer__column___1yO21"><div><a target="_blank" rel="noopener noreferrer" href="https://www.linkedin.com/company/zindi-africa">LinkedIn</a></div><div><a target="_blank" rel="noopener noreferrer" href="https://www.facebook.com/ZindiAfrica-311192052980655">Facebook</a></div><div><a target="_blank" rel="noopener noreferrer" href="https://twitter.com/ZindiAfrica">Twitter</a></div><div><a target="_blank" rel="noopener noreferrer" href="https://www.instagram.com/zindi.africa">Instagram</a></div><div><a target="_blank" rel="noopener noreferrer" href="https://zindi.medium.com/">Medium</a></div><div><a target="_blank" rel="noopener noreferrer" href="https://www.youtube.com/channel/UCQHq2JY2BqY2UTDCmVWyGBw">Youtube</a></div><div><a target="_blank" rel="noopener noreferrer" href="https://github.com/zindiafrica">Github</a></div></div></div><div class="Footer__logo___ZtNwP">Zindi</div></div></div></div></div></div><script>window.__INITIAL_STATE__ = {"blogPosts":{"data":{},"queries":{}},"comments":{"data":{},"queries":{}},"competitionTags":{"data":{},"queries":{}},"competitions":{"data":{},"queries":{}},"conspiracyParticipations":{"data":{},"queries":{}},"discussions":{"data":{},"queries":{}},"fullBlogPosts":{"data":{"how-to-enter-your-first-zindi-competition":{"id":"how-to-enter-your-first-zindi-competition","image":"https://zindpublic.blob.core.windows.net/public/uploads/blog_post/image/49/header_bdde99cf-1d73-4fc1-b863-69287254fdbd.jpg","big_image":"https://zindpublic.blob.core.windows.net/public/uploads/blog_post/image/49/big_thumb_bdde99cf-1d73-4fc1-b863-69287254fdbd.jpg","header_image":"https://zindpublic.blob.core.windows.net/public/uploads/blog_post/image/49/header_bdde99cf-1d73-4fc1-b863-69287254fdbd.jpg","title":"How to enter your first Zindi competition","intro_html":"<p>For many people joining Zindi, this will be the first time they enter a machine learning competition. This can be a scary challenge, so we're trying make it easier with a step-by-step guide to making your first submission on Zindi. Follow along with us, and you'll be racing up the leaderboards in no time.</p>","intro_plain":"For many people joining Zindi, this will be the first time they enter a machine learning competition. This can be a scary challenge, so we're trying make it easier with a step-by-step guide to making your first submission on Zindi. Follow along with us, and you'll be racing up the leaderboards in no time.","content_html":"<p>Zindi provides different categories of competition:</p><ul class=\"public-DraftStyleDefault-ul\">\n<li>\n<span style=\"font-weight: bold;\" class=\"\">Prize competition:</span> you win prize money if you are among the top 3 winners of a particular competition.</li>\n<li>\n<span style=\"font-weight: bold;\" class=\"\">You win points:</span> Points increase your ranking among other data scientists on the platform.</li>\n<li>\n<span style=\"font-weight: bold;\" class=\"\">You gain knowledge:</span> Knowledge competitions are where you can learn and increase your skill set.</li>\n</ul><p>As a data scientist or ML engineer in Africa, Zindi Africa is the best platform for you to learn and take your skills to the next level. The following are some of the benefits you can gain by being part of the Zindian family:</p><ul class=\"public-DraftStyleDefault-ul\">\n<li>Test your skills against top talent across Africa and beyond</li>\n<li>Learn by doing and gain practical exposure to real data science problems</li>\n<li>Earn income by doing what you enjoy</li>\n<li>Build your profile and attract potential employers</li>\n<li>Learn from others through collaboration and discussion with other data scientists and ML engineers.</li>\n</ul><p>In this article, we provide a walkthrough of how to enter a Zindi competition for the first time. In this article we will:</p><ul class=\"public-DraftStyleDefault-ul\">\n<li>Join a specific competition called Financial Inclusion in Africa</li>\n<li>Understand the competition description and problem statement</li>\n<li>Download and analyze the dataset provided</li>\n<li>Process the dataset provided</li>\n<li>Develop a model to predict who is most likely to have a bank account</li>\n<li>Evaluate the model performance</li>\n<li>Use the model to make predictions for the test dataset provided in the competition</li>\n<li>Make the first submission and get placed on the Zindi leaderboard</li>\n</ul><h3>Financial Inclusions in Africa</h3><p>Before we go deep into the competition, let’s understand the <span style=\"font-weight: bold;\" class=\"\">competition page</span> first by clicking <a href=\"https://zindi.africa/competitions/financial-inclusion-in-africa\" target=\"_blank\" rel=\"noreferrer noopener\">here</a>. If you don’t already have a Zindi account you can create one for free <a href=\"https://zindi.africa/\" target=\"_blank\" rel=\"noreferrer noopener\">here</a>.</p><p><div class=\"image\">\n<img src=\"https://zindpublic.blob.core.windows.net/public/uploads/image_attachment/image/320/22431163-c404-420b-b2d6-f96864f22f7c.png\"> </div></p><p>The <span style=\"font-weight: bold;\" class=\"\">competition page</span> provides some information to help you understand the problem you are going to solve, by reading the problem statement, how you can participate and how to submit your solution on the platform.</p><p>We will go through each tab and explain its functionality.</p><h3>1. Info</h3><p>The info tab contains the problem statements of the competition and list of organizations that have either provided the dataset or funded the competition.</p><p>On the left side, you can see a list of vertical tabs that provide more information about the competition.</p><p><span style=\"font-weight: bold;\" class=\"\">(a) Description</span></p><p>It provides the problem statement of the competition and a list of organisations or companies that supported the competition, either by providing the datasets or funding the competition.</p><p>We suggest you read the description of this competition in order to understand the problem and machine learning approach you can choose to solve it. If you read the description, you will understand that the objective of this competition is to create a machine learning model to predict which individuals are most likely to have or use a bank account.</p><p><span style=\"font-weight: bold;\" class=\"\">(b) Rules</span></p><p><div class=\"image\">\n<img src=\"https://zindpublic.blob.core.windows.net/public/uploads/image_attachment/image/323/647d6615-df60-47d2-9514-1daed73ed50f.png\"> </div></p><p>Each competition has its own rules. Breaking the rules can lead to <span style=\"font-weight: bold;\" class=\"\">disqualification</span>, so make sure to carefully read and understand all the rules of the competition.</p><p><span style=\"font-weight: bold;\" class=\"\">(c) Prizes</span></p><p>Now, this is the best part: the prize section provides details about the prize money that will be provided for the first, second and third place winners of the competition. But remember not all competition provides prize money for its winners; in other competitions, you can get <span style=\"font-weight: bold;\" class=\"\">Zindi points</span> or gain <span style=\"font-weight: bold;\" class=\"\">knowledge</span>.</p><p><span style=\"font-weight: bold;\" class=\"\">(d) Evaluation</span></p><p><div class=\"image\">\n<img src=\"https://zindpublic.blob.core.windows.net/public/uploads/image_attachment/image/324/2c9acfba-42ce-4bcd-90fd-b02e758226e3.png\"> </div></p><p>Each competition has its own evaluation metric that will be used to evaluate your results and rank you on the leaderboard. It also shows how you should prepare your submission file before uploading your file on the platform.</p><p>For this competition, the evaluation metric will be the percentage of survey respondents for whom you predict the binary ‘bank account’ classification <span style=\"font-weight: bold;\" class=\"\">incorrectly</span>.</p><p><span style=\"font-weight: bold;\" class=\"\">(e) Timeline</span></p><p><div class=\"image\">\n<img src=\"https://zindpublic.blob.core.windows.net/public/uploads/image_attachment/image/325/a65d6d7a-cd58-4ddf-a2b9-a78b0537e168.png\"> </div></p><p>This section provides information about the <span style=\"font-weight: bold;\" class=\"\">start date</span> of the competition and the <span style=\"font-weight: bold;\" class=\"\">end date and time</span> of the competition. If you submit your solution after the deadline you will receive a score but it will not reflect on the leaderboard. Make sure to submit before the deadline if you want to be considered for a prize.</p><p>This competition has been reopened as a knowledge challenge, this means it will not close.</p><h3>2. Data</h3><p><div class=\"image\">\n<img src=\"https://zindpublic.blob.core.windows.net/public/uploads/image_attachment/image/326/4ecc2bfd-3139-4b07-8af5-7b01fc8993e5.png\"> </div></p><p>The data tab contains a description of the dataset you are going to use for this competition. On the right side of the page, you can see a list of links to download the dataset and other important files. You will download:</p><ul class=\"public-DraftStyleDefault-ul\">\n<li>\n<span style=\"font-weight: bold;\" class=\"\">VariableDefinition.csv </span>— This file contains a definition of each variable in the train and test data.</li>\n<li>\n<span style=\"font-weight: bold;\" class=\"\">SubmissionFile.csv </span>— The file contains a sample of how the submission file should look like.</li>\n<li>\n<span style=\"font-weight: bold;\" class=\"\">Test_v2.csv</span> — This is a test data file you will use for prediction and save your results in the submission file.</li>\n<li>\n<span style=\"font-weight: bold;\" class=\"\">Train._v2.cs - </span>This is a train data file that contains both the independent variable and the target one. You will use this dataset to train your model.</li>\n</ul><p>These files may differ between competitions. Also, keep in mind that you must join the competition in order to have access to the data files.</p><h3>3. Discussion</h3><p><div class=\"image\">\n<img src=\"https://zindpublic.blob.core.windows.net/public/uploads/image_attachment/image/327/7f61b064-c6e8-44ce-a501-d98c119bf8fd.png\"> </div></p><p>We're not Liverpool FC fans but we like their slogan: <span style=\"font-weight: bold;\" class=\"\">“You will never walk alone”</span>. That is the <span style=\"font-weight: bold;\" class=\"\">purpose</span> of the discussion page, you don’t need to walk alone throughout the competition. If you face any challenge or uncertainty during the competition or you want to ask a question to understand more about the dataset provided, you can post on the discussion page and other data scientists enrolled in the competition can help you to solve the problem.</p><p>The discussion board is very active and full of knowledgeable and helpful African data scientists willing to assist you.</p><h3>4. Leaderboard</h3><p><div class=\"image\">\n<img src=\"https://zindpublic.blob.core.windows.net/public/uploads/image_attachment/image/328/72c76187-5796-451c-8e40-8de54ac33ade.png\"> </div></p><p>After you have uploaded your submission file, you will appear on the leaderboard. The leaderboard shows your position among all enrolled data scientists in the competition. Your position will depend on your performance after your solution has been evaluated. For this competition, you can submit ten times a day.</p><h3>5. Team</h3><p><div class=\"image\">\n<img src=\"https://zindpublic.blob.core.windows.net/public/uploads/image_attachment/image/329/7a1553c5-b388-4f07-acfd-ffdfaa052227.png\"> </div></p><p>You don’t want to do the competition on your own? That’s OK! You can create a team with fellow data scientists enrolled in the competition and work together. The maximum number for a team is 4 members. Remember that sharing code between individuals is not allowed, so if you want to share code with someone else, they must be on the same team as you.</p><h3>6. Submission</h3><p><div class=\"image\">\n<img src=\"https://zindpublic.blob.core.windows.net/public/uploads/image_attachment/image/330/1c238be3-0e55-4d1a-953d-2a1232ddf66c.png\"> </div></p><p>The submission page is where you will upload your submission file, by clicking the orange button at the top right side of the page. After you have uploaded your solution, it will be evaluated according to the evaluation metric specified in the competition. Then you will see the score that will define your position on the leaderboard.</p><h3>Solve the problem</h3><p>After understanding the Financial Inclusion in Africa competition page and its different sections, let’s solve the problem provided.</p><h3>1. Load the dataset</h3><p>Make sure you have downloaded the dataset provided in the competition. You can download the dataset <a href=\"https://zindi.africa/competitions/financial-inclusion-in-africa/data\" target=\"_blank\" rel=\"noreferrer noopener\">here</a>.</p><p>Import important python packages.</p><div class=\"codeblock\"><pre>import pandas as pd\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport seaborn as sns\nimport warnings\nnp.random.seed(123)\nwarnings.filterwarnings('ignore')\n%matplotlib inline</pre></div><p>Load the train and test dataset.</p><div class=\"codeblock\"><pre># Import data\ntrain_data = pd.read_csv('data/Train_v2.csv')\ntest_data = pd.read_csv('data/Test_v2.csv')</pre></div><p>Let’s observe the shape of our datasets.</p><div class=\"codeblock\">\n<pre># print shape\nprint('train data shape :', train_data.shape)\nprint('test data shape :', test_data.shape)</pre>\n<pre>train data shape : (23524, 13)\ntest data shape : (10086, 12)</pre>\n</div><p>The above output shows the number of rows and columns for train and test dataset. We have 13 variables in the train dataset, 12 independent variables and 1 dependent variable. In the test dataset, we have 12 independent variables.</p><p>We can observe the first five rows from our data set by using the head() method from the pandas library.</p><div class=\"codeblock\"><pre># inspect train data\n\ntrain_data.head()</pre></div><p></p><p><div class=\"image\">\n<img src=\"https://zindpublic.blob.core.windows.net/public/uploads/image_attachment/image/331/1c1e780f-214a-4003-948b-05689054d7b5.png\"> </div></p><p>It is important to understand the meaning of each feature so you can really understand the dataset. You can read the <span style=\"font-weight: bold;\" class=\"\">VariableDefinition.csv</span> file to understand the meaning of each variable presented in the dataset.</p><p>The <span style=\"font-weight: bold;\" class=\"\">SubmissionFile.csv</span> gives us an example of how our submission file should look. This file will contain the uniqueid column combined with the country name from the <span style=\"font-weight: bold;\" class=\"\">Test_v2.csv</span> file and the target we predict with our model. Once we have created this file, we will submit it to the competition page and obtain a position on the leaderboard.</p><div class=\"codeblock\"><pre>submission = pd.read_csv('data/SubmissionFile.csv')\nsubmission.head()</pre></div><p></p><p><div class=\"image\">\n<img src=\"https://zindpublic.blob.core.windows.net/public/uploads/image_attachment/image/332/4f260f79-f0f9-47b8-a358-dba96ba07a55.png\"> </div></p><h3>2. Understand the dataset</h3><p>We can get more information about the features presented by using the info() method from pandas.</p><div class=\"codeblock\"><pre> #show Some information about the dataset\n \n print(train_data.info())</pre></div><p></p><p><div class=\"image\">\n<img src=\"https://zindpublic.blob.core.windows.net/public/uploads/image_attachment/image/333/d1e53e5b-6894-46b1-a8bb-962533ac63f4.png\"> </div></p><p>The output shows the list of variables/features, sizes, if it contains missing values and data type for each variable. From the dataset, we don’t have any missing values and we have 3 features of integer data type and 10 features of the object data type.</p><p>If you want to learn how to handle missing data in your dataset, we recommend you read <a href=\"https://machinelearningmastery.com/handle-missing-data-python/\" target=\"_blank\" rel=\"noreferrer noopener\">How to handle missing data with python</a> by Jason Brownlee.</p><p>We won’t go further on understanding the dataset because Davis has already published an article about exploratory data analysis (EDA) with the financial Inclusion in Africa dataset. You can read and download the notebook for EDA in the link below.</p><p><a href=\"https://medium.com/analytics-vidhya/why-you-need-to-explore-your-data-how-you-can-start-13de6f29c8c1\" target=\"_blank\" rel=\"noreferrer noopener\">Why you need to explore your data and how you can start</a></p><h3>3. Data preparation for machine learning</h3><p>Before you train the model for prediction, you need to perform data <a href=\"https://www.dataquest.io/blog/machine-learning-preparing-data/\" target=\"_blank\" rel=\"noreferrer noopener\">cleaning</a> and <a href=\"https://towardsdatascience.com/data-preprocessing-concepts-fa946d11c825\" target=\"_blank\" rel=\"noreferrer noopener\">preprocessing</a>. This is a very important step; your model will not perform well without these steps.</p><p><div class=\"image\">\n<img src=\"https://zindpublic.blob.core.windows.net/public/uploads/image_attachment/image/334/48f91a8a-d9c4-4853-ab32-ccb9f143a238.png\"> </div></p><p>The first step is to separate the independent variables and <span style=\"font-weight: bold;\" class=\"\">target(bank_account)</span> from the train data. Then transform the target values from the object data type into numerical by using <a href=\"https://towardsdatascience.com/categorical-encoding-using-label-encoding-and-one-hot-encoder-911ef77fb5bd\" target=\"_blank\" rel=\"noreferrer noopener\">LabelEncoder</a>.</p><div class=\"codeblock\"><pre>#import preprocessing module\nfrom sklearn.preprocessing import LabelEncoder\nfrom sklearn.preprocessing import MinMaxScaler\n\n# Cobvert target label to numerical Data\nle = LabelEncoder()\ntrain_data['bank_account'] = le.fit_transform(train_data['bank_account'])\n\n#Separate training features from target\nX_train = train_data.drop(['bank_account'], axis=1)\ny_train = train_data['bank_account']\n\nprint(y_train)</pre></div><p></p><p><div class=\"image\">\n<img src=\"https://zindpublic.blob.core.windows.net/public/uploads/image_attachment/image/335/08986008-97be-4107-aba3-025a74f2dbfa.png\"> </div></p><p>The target values have been transformed into numerical datatypes, <span style=\"font-weight: bold;\" class=\"\">1</span> represents <span style=\"font-weight: bold;\" class=\"\">‘Yes’</span> and <span style=\"font-weight: bold;\" class=\"\">0</span> represents <span style=\"font-weight: bold;\" class=\"\">‘No’</span>.</p><p>We have created a simple preprocessing function to:</p><ul class=\"public-DraftStyleDefault-ul\">\n<li>Handle conversion of data types</li>\n<li>Convert categorical features to numerical features by using <a href=\"https://towardsdatascience.com/categorical-encoding-using-label-encoding-and-one-hot-encoder-911ef77fb5bd\" target=\"_blank\" rel=\"noreferrer noopener\">One-hot Encoder and Label Encoder</a></li>\n<li>Drop uniqueid variable</li>\n<li>Perform <a href=\"https://towardsdatascience.com/preprocessing-with-sklearn-a-complete-and-comprehensive-guide-670cb98fcfb9\" target=\"_blank\" rel=\"noreferrer noopener\">feature scaling</a>.</li>\n</ul><p>The processing function will be used for both train and test independent variables.</p><div class=\"codeblock\"><pre># function to preprocess our data from train models\n\ndef preprocessing_data(data):\n\n # Convert the following numerical labels from interger to float\n float_array = data[[\"household_size\", \"age_of_respondent\", \"year\"]].values.astype(float\n )\n \n # categorical features to be onverted to One Hot Encoding\n categ = [\n \"relationship_with_head\",\n \"marital_level\",\n \"job_type\",\n \"country\",\n ]\n \n # One Hot Encoding conversion\n data = pd.get_dummies(data, prefix_sep=\"_\", columns=categ)\n \n # Label Encoder conversion\n data[\"location_type\"] = le.fit_transform(data[\"location_type\"])\n data[\"cellphone_access\"] = le.fit_transform(data[\"cellphone_access\"])\n data[\"gender_of_respondent\"] = le.fit_transform(data[\"gender_of_respondent\"])\n \n # drop uniquid column\n data = data.drop([\"uniquid\"]), axis=1)\n \n # scale our data into range of 0 and 1\n scaler = MinMaxScaler(feature_range=(0, 1))\n data = scaler.fit_transform(data)\n \n return data </pre></div><p>Preprocess both train and test dataset.</p><div class=\"codeblock\"><pre># preprocess the train data \nprocessed_test_data = preprocessing_data(X_train)\nprocessed_test_data = preprocessing_data(test_data)</pre></div><p>Observe the first row in the train data.</p><div class=\"codeblock\"><pre># the first train row\nprint(processed_train_data[:1])</pre></div><p></p><p><div class=\"image\">\n<img src=\"https://zindpublic.blob.core.windows.net/public/uploads/image_attachment/image/336/e5ea8546-77f2-4864-8918-7b7ecb790412.png\"> </div></p><p>Observe the shape of the train data.</p><div class=\"codeblock\">\n<pre># shape of the processed train set\nprint(processed_train_data.shape)</pre>\n<pre>(23524, 37)</pre>\n</div><p>Now we have more independent variables than before <span style=\"font-weight: bold;\" class=\"\">(37 variables)</span>. This doesn’t mean all these variables are important to train our model. You need to select only important features that can increase the performance of the model. But we will not apply any feature selection technique in this article; if you want to learn and know more about feature selection techniques, we recommend you read the following articles:</p><ul class=\"public-DraftStyleDefault-ul\">\n<li>\n<a href=\"https://www.analyticsvidhya.com/blog/2016/12/introduction-to-feature-selection-methods-with-an-example-or-how-to-select-the-right-variables/\" target=\"_blank\" rel=\"noreferrer noopener\">Introduction to Feature Selection methods with an example (or how to select the right variables?).</a></li>\n<li>\n<a href=\"https://towardsdatascience.com/the-5-feature-selection-algorithms-every-data-scientist-need-to-know-3a6b566efd2\" target=\"_blank\" rel=\"noreferrer noopener\">The 5 Feature Selection Algorithms every Data Scientist should know.</a></li>\n<li>\n<a href=\"https://machinelearningmastery.com/feature-selection-with-real-and-categorical-data/\" target=\"_blank\" rel=\"noreferrer noopener\">How to Choose a Feature Selection Method For Machine Learning.</a></li>\n<li>\n<a href=\"https://towardsdatascience.com/feature-selection-techniques-in-machine-learning-with-python-f24e7da3f36e\" target=\"_blank\" rel=\"noreferrer noopener\">Feature Selection Techniques in Machine Learning with Python.</a></li>\n</ul><h3>4. Model Building and Experiments</h3><p>A portion of the train data set will be used to evaluate our models and find the best one that performs well before using it in the test dataset.</p><div class=\"codeblock\"><pre># Split train_data\nfrom sklearn.model_selection import train_test_spilt\n\nX_Train, X_val, y_Train, y_val - train_test_split(processed_train_data, y_train, stratify = y_train, \n test_size = 0.1, random_state=42)</pre></div><p>Only 10% of the train dataset will be used for evaluating the models. The parameter <span style=\"font-weight: bold;\" class=\"\">stratify = y_train</span> will ensure an equal balance of values from both classes (‘yes’ and ‘no’) for both train and validation set.</p><p>We have selected five algorithms for this classification problem to train and predict who is most likely to have a bank account.</p><ul class=\"public-DraftStyleDefault-ul\">\n<li>\n<a href=\"https://www.datacamp.com/community/tutorials/random-forests-classifier-python\" target=\"_blank\" rel=\"noreferrer noopener\">Random Forest</a></li>\n<li>\n<a href=\"https://www.datacamp.com/community/tutorials/k-nearest-neighbor-classification-scikit-learn\" target=\"_blank\" rel=\"noreferrer noopener\">K Nearest Neighbors</a></li>\n<li>\n<a href=\"https://machinelearningmastery.com/logistic-regression-tutorial-for-machine-learning/\" target=\"_blank\" rel=\"noreferrer noopener\">Logistic Regression</a></li>\n<li>\n<a href=\"https://www.tutorialspoint.com/machine_learning_with_python/machine_learning_with_python_extra_trees.htm\" target=\"_blank\" rel=\"noreferrer noopener\">Extra Trees</a></li>\n<li>\n<a href=\"https://www.datacamp.com/community/tutorials/xgboost-in-python\" target=\"_blank\" rel=\"noreferrer noopener\">XGBoost</a></li>\n</ul><p>From these algorithms, we can find the one that performs better than the others. We will start by training these models using the train set after splitting our train dataset.</p><div class=\"codeblock\"><pre>#import classifier algorithm here\nfrom sklearn.linear_model import LogisticRegression\nfrom sklearn.ensemble import RandomForestClassifier\nfrom sklearn.neighbors import KNeighborClassifier\nfrom sklearn.ensemble import ExtraTreesClassifier\nfrom xgboost import XGBClassifier\n\n# create models\nlg_model = LogisticRegression()\nrf_model = RandomForestClassifier()\nkn_model = KNeighborsClassifier()\net_model = ExtraTreesClassifier()\nxg_model = XGBClassifier()\n\n\n#fitting the models\nlg_model.fit(X_Train,y_Train)\nrf_model.fit(X_Train,y_Train)\nkn_model.fit(X_Train,y_Train)\net_model.fit(X_Train,y_Train)\nxg_model(X_Train,y_Train)</pre></div><p>After training five models, let’s use the trained models to predict our evaluation set and see how these models perform. We will use the evaluation metric provided on the competition page. The statement from the competition page stated that:</p><blockquote>The evaluation metric for this challenge will be the percentage of survey respondents for whom you predict the binary 'bank account' classification incorrectly.</blockquote><p>This means the <span style=\"font-weight: bold;\" class=\"\">lower</span> the incorrect percentage we get, the better the model performance.</p><div class=\"codeblock\"><pre># import evaluation metrics\nfrom sklearn.metrics import confusion_matrix, accuracy_score\n\n# evaluate the model\nlg_y_pred = lg_model.predict(X_val)\nrf_y_pred = rf_model.predict(X_val)\nkn_y_model = kn_model.predict(X_val)\net_y_model = et_model.predict(X_val)\nxg_y_model = xg_model.predict(X_val)\n\n# Get error rate\nprint(\"Error rate Logistic Regression classifier: \", 1 - accuracy_score(y_val, lg_y_pred))\nprint(\"Error rate of Random Forest classifier: \", 1 - accuracy_scorey_val, rf_y_pred))\nprint(\"Error rate of KNeighbors Classifier: \", 1 - accuracy_score(y_val, kn_y_pred))\nprint(\"Error rate of Extra Tree classifier: \", 1 - accuracy_score(y_val, et_y_pred))\nprint(\"Error rate of XGB classifier: \", 1 - accuracy_score(y_val, xg_y_pred))</pre></div><p></p><p><div class=\"image\">\n<img src=\"https://zindpublic.blob.core.windows.net/public/uploads/image_attachment/image/337/da5d9df1-a0f4-4778-9fc1-3732ed5b885e.png\"> </div></p><p>XGBoost classifier performs better than other models with <span style=\"font-weight: bold;\" class=\"\">0.110</span> incorrect.</p><p>Let’s check the confusion matrix for XGB model.</p><div class=\"codeblock\"><pre>from sklearn.metrics import plot_confusion_matrix\n\n# Get confusion matrix for Gradient Boosting Classifier\nplot_confusion_matrix( xg_model,X_val, y_val,normalize='true')</pre></div><p></p><p><div class=\"image\">\n<img src=\"https://zindpublic.blob.core.windows.net/public/uploads/image_attachment/image/338/0740f0ff-894e-4693-bff4-7459dad02da8.png\"> </div></p><p>Our XGBoost model performs well on predicting <span style=\"font-weight: bold;\" class=\"\">class 0</span> and performs poorly on predicting <span style=\"font-weight: bold;\" class=\"\">class 1</span>, it may be caused by the imbalance of data provided(the target variable has more ‘No’ values than ‘Yes’ values). You can learn the best way to deal with imbalanced data here.</p><p>One way to increase the model performance is by applying the Grid search method as an approach to parameter tuning that will methodically build and evaluate a model for each combination of algorithm parameters specified in a grid.</p><div class=\"codeblock\"><pre># Import GridSearchCV\nfrom sklearn.model_selection import GridSearchCV\n\n# Optimize model parameters\n# I run this code in google colab to make the execution much faster and use the best params in the next code\nparam_grid = {'min_child_weighth': [1, 5, 10],\n 'gamma': [0.5, 1],\n 'subsample': [0.6, 0.8, 1.0],\n 'max_depth': [3, 5]\n }\nmy_xgb_model - GridSearchCV(xg_model, param_grid,n_jobs=-1,verbose=2,cv=5)\nmy_xgb_model.fit(X_Train, y_Train)\nprint(my_xgb_model.best_params_) </pre></div><p>The above source code will evaluate which parameter values for min_child_weight, gamma, subsample and max_depth will give us better performance.</p><p><div class=\"image\">\n<img src=\"https://zindpublic.blob.core.windows.net/public/uploads/image_attachment/image/339/3f589ae1-b902-4f21-bbf5-6ee1d5cc59cc.png\"> </div></p><p>Let’s use these parameter values and see if the XGB model performance will increase.</p><div class=\"codeblock\">\n<pre>from sklearn.metrics import confusion_matrix, accuracy_score\n\n\n# fit by setting best parameters and Evaluate model\nxgb_model = XGBClassifier(min_child_weight=1, gamma=1, subsample=0.8, max_depth=5)\n\nxgb_model.fit(X_Train, y_Train)\ny_pred = xgb_model.predict(X_val)\n\n# Get error rate\nprint(\"Error rate of the XGB classifier: \", 1 - accuracy_score(y_val, y_pred))</pre>\n<pre>Error rate of the XGB model: 0.10837229069273269</pre>\n</div><p>Our XGB model has improved from the previous performance of <span style=\"font-weight: bold;\" class=\"\">0.110</span> to <span style=\"font-weight: bold;\" class=\"\">0.108</span>.</p><h3>\n<span style=\"font-weight: bold;\" class=\"\">5. Making the first submission</span></h3><p>After improving the XGBoost model performance, let’s now see how the model performs on the competition test data set provided and how we rank on the competition leaderboard.</p><p>First, we make predictions on the competition test data set.</p><div class=\"codeblock\"><pre># Get the predicted result for the test Data\ntest_data.bank_account = xgb_model.predict(processed_test_data)</pre></div><p>Then we create a submission file according to the instruction provided in the SubmissionFile.csv.</p><div class=\"codeblock\"><pre># crete submission DataFrame\nsubmission = pd.DataFrame({\"uniqueid\": test_data[\"uniqueid\"] + \" x \" + test_data[\"country\"],\n\n\"bank_account\": test_data.bank_account})</pre></div><p>Let’s observe the sample results from our submission dataFrame.</p><div class=\"codeblock\"><pre>#show the five sample\nsubmission.sample(5)</pre></div><p></p><p><div class=\"image\">\n<img src=\"https://zindpublic.blob.core.windows.net/public/uploads/image_attachment/image/340/3aacd9bf-2005-4a5b-96a0-41e8c4705eb6.png\"> </div></p><p>Save results in the CSV file.</p><div class=\"codeblock\"><pre># Create submission csv file csv file\nsubmission.to_csv('data/submission/first_submission.csv', index = false)</pre></div><p>We named our submission file a <span style=\"font-weight: bold;\" class=\"\">first_submission.csv</span>. Now we can upload it to the Zindi competition page by clicking the submit button and selecting the file to upload., You also have an option to add comments for each submission.</p><p><div class=\"image\">\n<img src=\"https://zindpublic.blob.core.windows.net/public/uploads/image_attachment/image/341/59add969-877b-4a20-beb7-4ecda2f812ce.png\"> </div></p><p>Then click the submit button to upload your submission file. Congratulations, you just made your first Zindi submission! The system will evaluate your results according to the evaluation methods for this competition.</p><p><div class=\"image\">\n<img src=\"https://zindpublic.blob.core.windows.net/public/uploads/image_attachment/image/342/7ff645aa-7d04-4177-9cdb-dc1f159777f9.png\"> </div></p><p>Now you can see the performance of our XGB model is 0.109 on the test dataset provided.</p><p>You can also see your position on the Leaderboard.</p><h3>Wrap up</h3><p>In this article, we have given an overview of how to make your first submission to a Zindi competition. We suggest you take further steps to handle the imbalance of data and find alternative feature engineering and selection techniques you can apply to increase your model performance, or trying other machine learning algorithms. If you get stuck, don’t forget to ask for help on the discussion boards!</p><p>You can access the notebook for this article in the link below.</p><p><a href=\"https://github.com/Davisy/How-to-Enter-Your-First-Zindi-Competition\" target=\"_blank\" rel=\"noreferrer noopener\">Davisy/How-to-Enter-Your-First-Zindi-Competition</a></p><p>If you learned something new or enjoyed reading this article, please share it so that others can see it. Feel free to leave a comment on the discussion board too.</p><h3>About the author</h3><p>Davis David is a data scientist at ParrotAI and Zindi Ambassador. He is passionate about artificial intelligence, machine learning, deep learning and big data. He is a co-organizer and facilitator of the AI movement in Tanzania; conducting AI meetups, workshops and events with a passion to build a community of data scientists to solve local problems. He can be reached on Twitter <a href=\"https://twitter.com/Davis_McDavid\" target=\"_blank\" rel=\"noreferrer noopener\">@Davis_McDavid</a>.</p><p>You can read the original blog post <a href=\"https://medium.com/@Davis_David/how-to-enter-your-first-zindi-competition-3e9ce335d34b\" target=\"_blank\" rel=\"noreferrer noopener\">here</a>.</p>","published_at":"2020-03-12T07:33:20.653Z"}},"queries":{"\"how-to-enter-your-first-zindi-competition\"":{"data":"how-to-enter-your-first-zindi-competition","loading":false,"error":null}}},"fullCompetitions":{},"fullDiscussions":{"data":{},"queries":{"default":{"loading":false,"error":null}}},"fullJobs":{"data":{},"queries":{}},"jobs":{"data":{},"queries":{}},"jobApplications":{"data":{},"queries":{}},"myTeams":{},"notificationSubscriptions":{"data":{},"queries":{}},"participations":{"data":{},"queries":{}},"submissions":{"data":{},"queries":{}},"submissionLimits":{"data":{},"queries":{}},"teams":{"data":{},"queries":{}},"userDiscussions":{"data":{},"queries":{}},"userParticipations":{"data":{},"queries":{}},"userProfiles":{"users":{}},"users":{"data":{},"queries":{}}}</script>
<script>
window.ga =
window.ga ||
function () {
;(ga.q = ga.q || []).push(arguments)
}
ga.l = +new Date()
ga("create", "UA-125419148-1", "auto")
ga("send", "pageview")
ga('set', 'appName', 'zindi.web')
ga('set', 'dimension1', 'nextgen');
</script>
<script async="" src="./How to enter your first Zindi competition - Zindi_files/analytics.js"></script>
<noscript><iframe
src="https://www.googletagmanager.com/ns.html?id=GTM-KRG85D8"
height="0"
width="0"
style="display: none; visibility: hidden"
></iframe
></noscript>
<script>!function(l){function e(e){for(var r,t,n=e[0],o=e[1],u=e[2],i=0,a=[];i<n.length;i++)t=n[i],Object.prototype.hasOwnProperty.call(p,t)&&p[t]&&a.push(p[t][0]),p[t]=0;for(r in o)Object.prototype.hasOwnProperty.call(o,r)&&(l[r]=o[r]);for(s&&s(e);a.length;)a.shift()();return c.push.apply(c,u||[]),f()}function f(){for(var e,r=0;r<c.length;r++){for(var t=c[r],n=!0,o=1;o<t.length;o++){var u=t[o];0!==p[u]&&(n=!1)}n&&(c.splice(r--,1),e=i(i.s=t[0]))}return e}var t={},p={runtime:0},c=[];function i(e){if(t[e])return t[e].exports;var r=t[e]={i:e,l:!1,exports:{}};return l[e].call(r.exports,r,r.exports,i),r.l=!0,r.exports}i.m=l,i.c=t,i.d=function(e,r,t){i.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(r,e){if(1&e&&(r=i(r)),8&e)return r;if(4&e&&"object"==typeof r&&r&&r.__esModule)return r;var t=Object.create(null);if(i.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:r}),2&e&&"string"!=typeof r)for(var n in r)i.d(t,n,function(e){return r[e]}.bind(null,n));return t},i.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(r,"a",r),r},i.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},i.p="https://assets.zindi.africa/";var r=(n=window.webpackJsonp=window.webpackJsonp||[]).push.bind(n);n.push=e;for(var n=n.slice(),o=0;o<n.length;o++)e(n[o]);var s=r;f()}([]);
//# sourceMappingURL=runtime.8d4eb9324d7c3d54849b.js.map</script><script type="text/javascript" src="./How to enter your first Zindi competition - Zindi_files/vendor.019171b12285f6597772.js" defer=""></script><script type="text/javascript" src="./How to enter your first Zindi competition - Zindi_files/bundle.9c8d652f1bf8225cb2ca.js" defer=""></script>
<script type="text/javascript" id="">(function(a,e,f,g,b,c,d){a[b]=a[b]||function(){(a[b].a=a[b].a||[]).push(arguments)};a[b].l=1*new Date;c=e.createElement(f);d=e.getElementsByTagName(f)[0];c.async=1;c.src=g;d.parentNode.insertBefore(c,d)})(window,document,"script","https://mc.yandex.ru/metrika/tag.js","ym");ym(67869277,"init",{clickmap:!0,trackLinks:!0,accurateTrackBounce:!0,webvisor:!0});</script>
<noscript><div><img src="https://mc.yandex.ru/watch/67869277" style="position:absolute; left:-9999px;" alt=""></div></noscript>
<div class="ReactModalPortal"></div><div id="fatkun-drop-panel">
<a id="fatkun-drop-panel-close-btn">×</a>
<div id="fatkun-drop-panel-inner">
<div class="fatkun-content">
<svg class="fatkun-icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5892"><path d="M494.933333 782.933333c2.133333 2.133333 4.266667 4.266667 8.533334 6.4h8.533333c6.4 0 10.666667-2.133333 14.933333-6.4l2.133334-2.133333 275.2-275.2c8.533333-8.533333 8.533333-21.333333 0-29.866667-8.533333-8.533333-21.333333-8.533333-29.866667 0L533.333333 716.8V128c0-12.8-8.533333-21.333333-21.333333-21.333333s-21.333333 8.533333-21.333333 21.333333v588.8L249.6 475.733333c-8.533333-8.533333-21.333333-8.533333-29.866667 0-8.533333 8.533333-8.533333 21.333333 0 29.866667l275.2 277.333333zM853.333333 874.666667H172.8c-12.8 0-21.333333 8.533333-21.333333 21.333333s8.533333 21.333333 21.333333 21.333333H853.333333c12.8 0 21.333333-8.533333 21.333334-21.333333s-10.666667-21.333333-21.333334-21.333333z" p-id="5893"></path></svg>
<div class="fatkun-title">Drag and Drop</div>
<div class="fatkun-desc">The image will be downloaded</div>
</div>
</div>
</div></body></html>