Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Social Network Analysis Project to Unsupervised Learning and Blood Donations Prediction to Prediction Models Module #686

Merged
merged 3 commits into from
Oct 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,277 changes: 1,277 additions & 0 deletions Prediction Models/Blood Donations Prediction/Blood Donation Prediction.ipynb

Large diffs are not rendered by default.

21 changes: 21 additions & 0 deletions Prediction Models/Blood Donations Prediction/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2018 Souvik Banerjee

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
60 changes: 60 additions & 0 deletions Prediction Models/Blood Donations Prediction/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# Predict-Blood-Donations [![](https://img.shields.io/github/license/sourcerer-io/hall-of-fame.svg?colorB=ff0000)](https://github.com/souvikb07/Predict-Blood-Donations/blob/master/LICENSE) [![](https://img.shields.io/badge/Souvik-Banerjee-blue.svg)](https://souvikb07.github.io)

<img src = "https://github.com/souvikb07/souvikb07.github.io/blob/master/images/blood_donationcover.jpeg">

## Problem
Predicting if a Blood Donor will donate within a given time window?

### Application
By solving this problem the blood donation camps can get 40% more blood donors.

### Sourcerer
[![](https://sourcerer.io/fame/souvikb07/souvikb07/Predict-Blood-Donations/images/0)](https://sourcerer.io/fame/souvikb07/souvikb07/Predict-Blood-Donations/links/0)[![](https://sourcerer.io/fame/souvikb07/souvikb07/Predict-Blood-Donations/images/1)](https://sourcerer.io/fame/souvikb07/souvikb07/Predict-Blood-Donations/links/1)[![](https://sourcerer.io/fame/souvikb07/souvikb07/Predict-Blood-Donations/images/2)](https://sourcerer.io/fame/souvikb07/souvikb07/Predict-Blood-Donations/links/2)[![](https://sourcerer.io/fame/souvikb07/souvikb07/Predict-Blood-Donations/images/3)](https://sourcerer.io/fame/souvikb07/souvikb07/Predict-Blood-Donations/links/3)[![](https://sourcerer.io/fame/souvikb07/souvikb07/Predict-Blood-Donations/images/4)](https://sourcerer.io/fame/souvikb07/souvikb07/Predict-Blood-Donations/links/4)[![](https://sourcerer.io/fame/souvikb07/souvikb07/Predict-Blood-Donations/images/5)](https://sourcerer.io/fame/souvikb07/souvikb07/Predict-Blood-Donations/links/5)[![](https://sourcerer.io/fame/souvikb07/souvikb07/Predict-Blood-Donations/images/6)](https://sourcerer.io/fame/souvikb07/souvikb07/Predict-Blood-Donations/links/6)[![](https://sourcerer.io/fame/souvikb07/souvikb07/Predict-Blood-Donations/images/7)](https://sourcerer.io/fame/souvikb07/souvikb07/Predict-Blood-Donations/links/7)

### Code Requirements
The example code is in Python ([version 3.6.6](https://www.python.org/downloads/release/python-366/) or higher will work).

### Dependencies

1) import pandas
2) import numpy
3) import seaborn
4) import matplotlib
5) import Counter
6) import sklearn

## Description

Use Python to explore data related to blood donors and we want to predict whether or not a donor will give blood the next time when the blood donation will be organised.

* This process will be done using a Jupyter Notebook.
* The code should run w/o errors.
* Appropriate use of
* data structures/types
* loops/conditional statements
* Packages
* functions
* coding practices (i.e. Docstrings, comments, variable names & general
readability)
* Analysis
* Pose questions about the data
* Inspect the structure of the original data (very important)
* Clean the data
* Answer questions about the data using descriptive statistics
* Visualize the data (using plt and seaborn)
* Perform additional exploratory analysis
* Consider where data analysis can be applied to other fields.
* Feature Engineering
* Using domain knowledge of the data to create features that make machine learning algorithms work.
* Machine Learning
* Use of Random Forest, Extra Trees, Gradient Boosting, SVC classifiers.

## File Descriptions

* ./data/ contains the various datasets.
* ./Blood Donation Prediction.ipynb is a Jupyter notebook containing the work I have done.

## References & Citations

1. Data provided by:
* [drivendata.org](https://www.drivendata.org/competitions/2/warm-up-predict-blood-donations/data/)
201 changes: 201 additions & 0 deletions Prediction Models/Blood Donations Prediction/data/test.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,201 @@
,Months since Last Donation,Number of Donations,Total Volume Donated (c.c.),Months since First Donation
659,2,12,3000,52
276,21,7,1750,38
263,4,1,250,4
303,11,11,2750,38
83,4,12,3000,34
500,3,21,5250,42
530,4,2,500,4
244,14,1,250,14
249,23,2,500,87
728,14,4,1000,64
129,13,3,750,16
534,11,7,1750,62
317,5,11,2750,75
401,4,1,250,4
696,4,4,1000,26
192,11,1,250,11
176,11,6,1500,26
571,7,14,3500,48
139,23,14,3500,93
423,3,4,1000,29
563,2,7,1750,29
56,4,6,1500,35
528,5,7,1750,26
101,4,1,250,4
467,2,3,750,38
382,5,14,3500,86
466,2,2,500,11
294,14,1,250,14
512,4,3,750,16
659,2,12,3000,52
389,4,14,3500,86
487,23,7,1750,88
701,2,1,250,2
419,4,7,1750,58
536,4,2,500,41
240,11,7,1750,29
508,2,2,500,41
515,14,1,250,14
283,4,6,1500,28
650,4,1,250,4
65,2,2,500,4
228,16,6,1500,35
741,16,6,1500,81
297,2,5,1250,26
464,14,3,750,31
63,2,1,250,2
231,4,4,1000,14
28,14,3,750,35
248,14,1,250,14
357,14,5,1250,28
300,2,14,3500,57
726,5,24,6000,79
680,14,4,1000,23
520,4,6,1500,39
254,23,2,500,38
582,11,8,2000,52
143,2,7,1750,77
98,4,5,1250,11
1,2,4,1000,35
221,2,15,3750,64
352,4,1,250,4
64,11,2,500,38
138,12,15,3750,71
745,2,13,3250,76
64,11,2,500,38
688,16,2,500,27
623,9,4,1000,65
289,21,16,4000,64
174,7,10,2500,47
690,4,1,250,4
105,11,5,1250,35
427,16,4,1000,23
48,38,1,250,38
14,4,1,250,4
657,23,4,1000,52
301,11,7,1750,64
455,14,3,750,28
579,4,11,2750,78
722,16,4,1000,33
98,4,5,1250,11
491,38,1,250,38
303,11,11,2750,38
466,2,2,500,11
65,2,2,500,4
300,2,14,3500,57
9,21,1,250,21
622,11,1,250,11
323,16,2,500,26
289,21,16,4000,64
568,2,4,1000,26
290,4,1,250,4
156,4,2,500,52
464,14,3,750,31
426,16,2,500,16
306,16,11,2750,40
4,11,11,2750,42
12,4,5,1250,23
187,11,12,3000,58
406,23,8,2000,64
96,4,2,500,4
509,2,1,250,2
733,11,6,1500,58
548,21,3,750,35
478,7,5,1250,35
501,11,2,500,16
127,2,4,1000,11
199,15,16,4000,82
299,2,10,2500,49
162,4,1,250,4
235,16,3,750,21
23,9,2,500,16
473,4,1,250,4
487,23,7,1750,88
683,4,8,2000,28
303,11,11,2750,38
309,23,3,750,48
569,23,1,250,23
34,4,7,1750,28
686,4,16,4000,38
84,2,2,500,23
733,11,6,1500,58
537,4,9,2250,26
181,11,4,1000,34
453,0,26,6500,76
67,2,10,2500,52
161,2,16,4000,81
307,4,6,1500,46
703,11,2,500,11
181,11,4,1000,34
246,14,2,500,14
316,3,5,1250,26
278,11,1,250,11
346,11,3,750,15
545,4,1,250,4
419,4,7,1750,58
694,4,2,500,4
622,11,1,250,11
663,11,3,750,76
262,2,13,3250,32
461,2,12,3000,98
373,2,34,8500,77
233,4,1,250,4
466,2,2,500,11
207,2,7,1750,77
263,4,1,250,4
16,23,1,250,23
513,23,3,750,35
449,4,5,1250,33
429,23,3,750,62
701,2,1,250,2
632,21,2,500,41
529,2,9,2250,22
245,11,9,2250,33
344,16,6,1500,40
353,16,3,750,19
241,8,15,3750,77
633,16,1,250,16
624,2,1,250,2
726,5,24,6000,79
189,11,1,250,11
138,12,15,3750,71
402,14,1,250,14
511,4,6,1500,23
590,9,9,2250,16
334,2,3,750,52
447,16,3,750,50
119,2,2,500,11
389,4,14,3500,86
644,4,1,250,4
423,3,4,1000,29
131,23,1,250,23
405,40,1,250,40
82,4,1,250,4
643,2,41,10250,98
156,4,2,500,52
617,21,3,750,38
574,2,3,750,9
272,2,12,3000,95
613,11,2,500,52
545,4,1,250,4
685,14,1,250,14
570,11,5,1250,33
537,4,9,2250,26
691,16,1,250,16
85,4,16,4000,70
483,14,2,500,14
455,14,3,750,28
93,11,1,250,11
744,2,1,250,2
33,14,2,500,14
321,4,23,5750,58
523,6,3,750,26
426,16,2,500,16
196,14,2,500,29
301,11,7,1750,64
103,16,1,250,16
224,21,2,500,23
454,23,8,2000,46
585,23,2,500,28
154,4,11,2750,64
Loading
Loading