<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Ossai Vivian on Medium]]></title>
        <description><![CDATA[Stories by Ossai Vivian on Medium]]></description>
        <link>https://medium.com/@vivianchizzy90?source=rss-2fb84da9419b------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Stories by Ossai Vivian on Medium</title>
            <link>https://medium.com/@vivianchizzy90?source=rss-2fb84da9419b------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 15:26:40 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@vivianchizzy90/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[A CLASSIFICATION MODEL FOR WATER POTABILITY ANALYSIS USING LOGISTIC REGRESSION.]]></title>
            <link>https://medium.com/@vivianchizzy90/a-classification-model-for-water-potability-analysis-using-logistic-regression-d7f0532b5e39?source=rss-2fb84da9419b------2</link>
            <guid isPermaLink="false">https://medium.com/p/d7f0532b5e39</guid>
            <dc:creator><![CDATA[Ossai Vivian]]></dc:creator>
            <pubDate>Tue, 10 Aug 2021 12:29:50 GMT</pubDate>
            <atom:updated>2021-08-10T12:29:50.431Z</atom:updated>
            <content:encoded><![CDATA[<p>This is a Capstone project done in fulfillment of the Kadatemy Data Science programme. This project was done as a team with the following members Chika Njoku, Kamdilichukwu Egenti, Christian Okoye, and myself Vivian Ossai</p><p><strong>INTRODUCTION</strong></p><p>The quality of water needs to be examined in order to ascertain its safety to people, whether it is for drinking, domestic use, food production or recreational purposes. Quality water supply and sanitation can boost countries’ economic growth and overall public health. According to the UN General Assembly in 2010, everyone has the right to sufficient, continuous, safe, acceptable, physically accessible and affordable water for personal and domestic use What is Potable Water? Safe drinking-water or potable water is water of sufficiently high quality that can be consumed or used with low risk of immediate or long term harm. In most developed countries, the water supplied to households, commerce and industry is all of drinking water standard, even though only a very small proportion is actually consumed or used in food preparation. Typical uses include washing and landscape irrigation (Brisbane City Council Information, 2005). Current position for drinking-water, over large parts of the world, humans have inadequate access to potable water and use sources contaminated with disease vectors, pathogens or unacceptable levels of toxins or suspended solids. Such water is not wholesome and drinking or using such water in food preparation leads to widespread acute and chronic illnesses and is a major cause of death and misery in many countries. Actually, over one sixth of the world’s population lacks safe drinking-water sources. Unsafe water supplies, along with deficient sanitary infrastructure and inadequate personal hygiene, contribute substantially to the burden of 2.2 million annual deaths from diarrhoeal diseases. Although the definitive solution to the problem of access to safe drinking-water is the universal provision of piped and treated water, this option remains elusive because of the enormous expenditure of money and time that is required (WHO, UNICEF, 2005). Statement of the problem Many citizens receive high quality drinking-water every day from public water systems (which may be publicly or privately owned). Nonetheless, drinking-water safety cannot be taken for granted. Lack of access to safe drinking-water and sanitation continues to be a major problem in both rural and urban communities. There are a number of threats to drinking-water, that is, improperly disposed of chemicals, animal wastes, pesticides, human threats, wastes injected underground and naturally occurring substances. Therefore, there was a need to determine whether the chemical content of the water exceeds the WHO standards laid down for safe drinking-water. However, even when water is safe for drinking at the source, it is commonly re-contaminated during collection, storage and use at home.</p><p><strong>Objectives</strong></p><p>The main objective is to assess water potability .</p><p>The specific objectives are;</p><p>1. To use the WHO drinking-water benchmarks to establish whether the contaminants exceed the safe levels.</p><p>2.To use logistic regression model to determine; a) the key contaminants of drinking-water.</p><p>b) the level of safety of drinking-water in particular sources.</p><p>Supervised learning is a machine learning algorithm with powerful tools to classify and process data.The model can be used to recognise new patterns and assign a target to them. Applications of supervised learning include classification (e.g. classifying players according to their behaviour during a game) and regression (e.g. Predicting household prices according to features). Classification is an instance of supervised learning that includes a training phase to create a model (Classifier). Its task is to predict the class of items in a data set using a certain model of a classifier. The model is constructed using already-labelled items of similar data sets. This step allows classification techniques to be considered as a supervised machine learning method. There are many classification techniques but the one used here is Logistic Regression.</p><p><strong>MATERIAL AND METHODOLOGY</strong></p><p>The data analysis tool used in this study is <strong>Matplotlib, Scikit-learn, python </strong>etc.<strong> Matplotlib</strong> is a plotting and visualization library. It was used in generating graphs with the analysed data such as bar plot, scatter plot etc. <strong>Scikit-learn </strong>was used for implementing machine learning algorithms. <strong>Pandas</strong> <strong>Library</strong> for data preprocessing analysis.<strong> Statistics Module</strong> for statistical analysis. <strong>Seaborn</strong> for data visualisation.</p><p><strong>DATASET</strong></p><p>In this study, secondary data was used to build the logistic regression and this data was downloaded from <a href="https://www.kaggle.com/adityakadiwal/water-potability.">https://www.kaggle.com/adityakadiwal/water-potability.</a> The analysis is carried out using publicly available data for water potability. The data is said to be synthetically generated. The dataset contains 3276 rows and 10 columns and we had a total of 1,434 missing values which we filled up with the median because we noticed a significant number of outliers in the data set that resulted in unbalanced classes. We couldn’t drop any columns because of the large presence of missing values that may invariably affect our model performance.</p><p>Boxplot Analysis and Outlier Detection We chose box plot analysis for outlier detection because most of the parameters varied enough and were at the higher end of values and a box plot provides insightful visualization to decide outlier detection threshold values depending on the problem domain. Boxplot analysis shows most of the parameters lying outside the box deeming outliers normal so we adopted a strategy to fill out the missing values in the specific columns with median which is not easily affected by outliers and efficient for robust dataset like ours. For a specific column ‘Trihalomethanes’ that had a total of 162 missing values we used the median figure which is 66.22485 so as not to bias the dataset.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/575/0*nuUuIzgKpGD2su0q" /></figure><p><strong>DATA ANALYSIS</strong></p><p>After all the data preprocessing and before applying machine learning algorithm there were some preliminary steps like data correlation analysis and data splitting to prepare the data to be given as input to actual machine learning algorithm Water quality parameters which is used for creating Model Several factors can interfere with surface water quality. Ten parameters were selected for the analysis. The parameters which were used to determine whether the water is clean is pH, Solids, Chloramines, Sulfate, Conductivity, Organic carbon, Trihalomethanes, Turbidity. Parameters Estimated Who Standards ● pH 6.5–8.5 ● Solids 500mg/l -1000mg/l ● Chloramines &lt; 4mg/l ● Sulfate 3–30 mg/L ● Conductivity &lt; 2 mg/L ● Trihalomethanes</p><p><strong>Classifiers Used</strong></p><p>For this research,Pandas libraries were selected for DataPreprocessing analysis. Matplotlib also has tools for preprocessing, basic statistics, data normalization, classification, Logistic regression.</p><p>The logistic Regression classifiers were run 10 times, the best result was added for this research, and the performance of the label evaluated, in compliance with the percentage of the correct classification. For the experiment, the water potability datasets were divided into two datasets: (1) training dataset with the 70% for training and testing dataset with 30% for validation.</p><p><strong>Evaluation process</strong></p><p>The confusion matrix helps practitioners to form a clear idea of whether the results have a high performance. The confusion matrix elements were: (1) true positive (TP), which tells that the water was potable and safe for drinking and was correctly predicted; (2) true negative (TN), where the water was not potable and unsafe for drinking was correctly predicted ; (3) false negative (FN), where the water was potable and safe for drinking but was wrongly falsely predicted as being not potable; and (4) false positive (FP), where the water was not potable and unsafe for drinking but was falsely predicted as being potable and safe for drinking water. In the medical field, false negatives are the most dangerous predictions. In this dataset classification we are more concerned with false positives (FP) . Our dataset was a binary classification. We have a 2 x 2 matrix with four values as shown below.</p><p>The different performance metrics were calculated using a confusion matrix. Accuracy (Acc) measured the properly classified instances [<a href="https://www.sciencedirect.com/science/article/pii/S2352914820300125#bib1">1</a>]. The formula for calculating accuracy was given as the ratio between the number of correct predictions and the total number of predictions.</p><p>Accuracy simply measures how often the classifier makes the correct prediction.. The accuracy metric is not suited for unbalanced classes.</p><p><strong>Accuracy = TP + TN / TP + FP + FN + TN</strong></p><p>Accuracy has its own disadvantages, for imbalanced data, when the model predicts that each point belongs to the majority class label, the accuracy will be high. But, the dataset is not unbalanced. Our accuracy score was 0.65.</p><p>Our dataset has an unbalanced class so the precision score is more accurate and gives us better model performance.</p><p>Precision was the positive predictive value defined as the ratio of the total number of correctly classified positive classe<em>s</em> divided by the total number of predicted positive classes. Which ideally should be 1 but we still had a good value of 0.75.</p><p><strong>Precision = TP / TP + FP OR Positive Predicted Value</strong></p><p>Recall identified the proportion of water being potable as the ratio of the total number of correctly classified positive classes<em> </em>divided by the total number of positive classes.</p><p><strong>Recall = TP / TP + FN</strong></p><p>The F1 score is considered a harmonic average between precision and recall.</p><p><strong>F1 Score = 2 * (Recall * Precision) / (Recall + Precision)</strong></p><p>The confusion matrix below shows 604 + 2 = 606 correct predictions and 371 + 6 = 377 as incorrect ones.</p><ul><li><strong>TP : True Positives (TP) : 6</strong></li><li><strong>TN : True Negative (TN) : 604</strong></li><li><strong>FP : False Positives (FP) : 2 (Type 1 error)</strong></li><li><strong>FN : False Negative (FN) : 371 (Type 11 error)</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/352/0*N1L4Qva3vtllQsoy" /></figure><p><strong>Fig. 1: Confusion matrix of the dataset</strong></p><p>From the above figure using the statistics it is clear that the model is <strong>more precise </strong>than <strong>accurate.</strong></p><p><strong>Exploratory Visual Analysis</strong></p><p>We also determined the ratio of water potability or not potable . We have the water potability count at a low rate of 1278 while the not potable has a high value count as 1998 from the fig below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/395/0*dtfLpomt88R2uxM-" /></figure><p><strong>Fig. 2: Potability distribution graph of the dataset</strong></p><p>This graph indicates the ratio of potable water to non potable water as contained in the dataset where 0.0 is an indicator for non potable whereas 1.0 indicates potable water.</p><p>The purpose of this step is to see the distribution of the data as shown below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*snD-Rp3uAd_GjZUB" /></figure><p><strong>Fig. 3: Distribution graphs of the features of the dataset</strong></p><p><strong>From the graphical representations above, we can deduce the following:</strong></p><p><strong>pH Distribution graph</strong>: this shows the ph content of the different water sources in the dataset with the highest distributions having a ph in the range of 6–8 which are in the range of WHO standards. WHO has recommended a maximum permissible limit of pH from 6.5 to 8.5.</p><p><strong>Hardness Distribution graph:</strong> Hardness is mainly caused by calcium and magnesium salts and the length of times these materials are in contact with water determines its degree of hardness. The graph shows that from 150–250 has a high degree of these chemicals hence producing a hard water.</p><p><strong>Solid Distribution graph:</strong> The water with high solid value indicates that water is highly mineralized. The Desired limit for solid is 500 mg/l and maximum limit is 1000 mg/l which is prescribed for drinking purpose. The graph shows the dataset contains water with high solid content values as high as 1000–4000.</p><p><strong>Chloramine Distribution graph:</strong> The dataset contains water sources with high chloramines with the highest distribution being between 6–8 as against the reference range of 4 mg/l.</p><p><strong>Sulfate Distribution graph:</strong> This shows a high concentration of sulfate between 250–350 in the distribution graph. Sulfates are naturally occurring substances that are found in minerals, soil, and rocks and range from 3–30 mg/l in most fresh water supplies although much higher concentration(1000 mg/l) can be found in some locations.</p><p><strong>Conductivity Distribution graph:</strong> Conductivity actually measures the ionic process of a solution that enables it to transmit current. According to WHO standards, conductivity value should not exceed 400 μS/cm. From the graph, it is shown that the dataset contains water with high conductivity which is as a result of high solid content.</p><p><strong>Organic Carbon Distribution graph:</strong> This is the organic content present in water and naturally, all forms of water contain organic carbon with a maximum acceptable limit of 2 mg/L for drinking water. From the distribution graph, over 99% of the samples are over the accepted limit. High organic carbon content signifies increase in growth of microorganisms in the water which results in a depletion of oxygen present in the water.</p><p><strong>Trihalomethanes Distribution graph:</strong> Natural organic matter in water reacts with chlorine used in water purification to give trihalomethanes. At concentrated levels, they are known to be carcinogenic and impede natural reproduction. The maximum acceptable limit is 80 ppm (parts per million) and the distribution of the dataset shows the majority of the samples falling within the 0–80 ppm range with highest distribution between 63–67 ppm.</p><p><strong>Turbidity Distribution graph:</strong> According to WHO, turbidity is defined as the amount of cloudiness in water. It is caused by the number of individual particles present in the water and these particles include dust, sand, organic materials, etc. Turbidity is an important test of water quality/potability. The lower the turbidity, the clearer the water and vice versa. The graph shows that a vast majority of the water sources are within the acceptable limit with highest distributions between 3.5–4.5 NTU and this is usually indicative of clear water.</p><p><strong>Potability Distribution graph:</strong> Water is either drinkable or not. Potability is the ability of water to be safe for drinking. This is represented within the graph as “0.0” for non-potable (not fit for drinking) water and “1.0” for potable (fit for drinking) water. It is clear that the majority of the water sources are not fit for drinking with about 2000 of these sources (which accounts for roughly 61% of the samples) shown to be not potable with readings of 0.0 .</p><p><strong>LIMITATIONS: </strong>We would have loved for the dataset to contain geographical locations and well as date of collections of data. It would have helped in getting a more precise result.</p><p><strong>CONCLUSION</strong>:</p><p>In this study, water potability was implemented using data analysis tools. The analysis of water Chloramines, pH level and conductivity etc. can play a major role in assessing water quality. Modeling and prediction of water quality are very important for the protection of the environment. Several popular methods, such as Mann-Kendall, the seasonal Kendall test, and multiple regression methods,</p><p>are provided to detect and assess changes of various water portability parameters (Helsel,1992).</p><p>First, the present study explored an alternative method of predicting water quality by employing minimal and available water quality parameters. Datasets used for this analysis were obtained from Kaggle.</p><p>After examining the robustness and efficiency of the proposed model for predicting the water potability, in future work, the developed models will be implemented to predict the water quality.</p><p>Here is the github link for you <a href="https://github.com/Vivian-chizzy/classification-project">https://github.com/Vivian-chizzy/classification-project</a></p><p><strong>REFERENCES:</strong></p><p>Ahmed U. et al, (2019). Efficient Water Quality Prediction Using Supervised Machine Learning. Published by Springer. <a href="https://www.researchgate.net/publication/336808732_Efficient_Water_Quality_Prediction_Using_Supervised_Machine_Learning">https://www.researchgate.net/publication/336808732_Efficient_Water_Quality_Prediction_Using_Supervised_Machine_Learning</a></p><p>Brisbane City Council, (2005). Retrieved from <a href="https://www.brisbane.qld.gov.au/planning-and-building/planning-guidelines-and-tools/brisbane-city-plan-2014/superseded-brisbane-city-plan-2000/superseded-subdivision-and-development-guidelines/2005-edition">https://www.brisbane.qld.gov.au/planning-and-building/planning-guidelines-and-tools/brisbane-city-plan-2014/superseded-brisbane-city-plan-2000/superseded-subdivision-and-development-guidelines/2005-edition</a></p><p>Gakii C., Jepkoech J., (2019). A Classification Model For Water Quality Analysis Using Decision Tree. Published by European Centre for Research Training and Development UK, Vol.7, №3, pp.1–8.</p><p>Helsel, D.R. and Hirsch, R.M. (1992) Statistical Methods in Water Resources. Published by Elsevier, Vol 49.</p><p>Nuzulul K. N., (2021). How to Predict Coronary Heart Disease Risk using Logistic Regression? Medium. <a href="https://medium.com/analytics-vidhya/how-to-predict-coronary-heart-disease-risk-using-logistic-regression-c069ab95cbec">https://medium.com/analytics-vidhya/how-to-predict-coronary-heart-disease-risk-using-logistic-regression-c069ab95cbec</a></p><p>Retrieved from <a href="https://en.m.wikipedia.org/wiki/Total_organic_carbon">https://en.m.wikipedia.org/wiki/Total_organic_carbon</a></p><p>Retrieved from <a href="https://en.m.wikipedia.org/wiki/Turbidity">https://en.m.wikipedia.org/wiki/Turbidity</a></p><p>Retrieved from <a href="https://www.kaggle.com/kanncaa1/water-quality-explanatory-data-analysis">https://www.kaggle.com/kanncaa1/water-quality-explanatory-data-analysis</a></p><p>USGS. Turbidity and Water. Retrieved from <a href="https://www.usgs.gov/special-topic/water-science-school/science/turbidity-and-water?qt-science_center_objects=0#qt-science_center_objects">https://www.usgs.gov/special-topic/water-science-school/science/turbidity-and-water?qt-science_center_objects=0#qt-science_center_objects</a></p><p>World Health Organization, UNICEF, (2005). Water for life: Making it happen. Retrieved from <a href="http://www.who.int/water_sanitation_health/monitoring/jmp2005/en/">http://www.who.int/water_sanitation_health/monitoring/jmp2005/en/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d7f0532b5e39" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[This was a analysis on USA shooting dataset found on Kaggle for the year 2015–2020.]]></title>
            <link>https://medium.com/@vivianchizzy90/this-was-a-analysis-on-usa-shooting-dataset-found-on-kaggle-for-the-year-2015-2020-dc489b9ea581?source=rss-2fb84da9419b------2</link>
            <guid isPermaLink="false">https://medium.com/p/dc489b9ea581</guid>
            <category><![CDATA[data-visualization]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[code-review]]></category>
            <category><![CDATA[coding]]></category>
            <dc:creator><![CDATA[Ossai Vivian]]></dc:creator>
            <pubDate>Fri, 16 Jul 2021 04:00:02 GMT</pubDate>
            <atom:updated>2021-07-16T04:00:02.476Z</atom:updated>
            <content:encoded><![CDATA[<p>This was a analysis on USA shooting dataset found on Kaggle for the year 2015–2020. It was a data science training assignment done in fulfillment of the program training.</p><p>Tools used: Python, Jupyter notebook, Matplotlib</p><p>The issue of police shooting indiscriminately has become a global menace, and needs to be addressed and solutions need to be proffered. The dataset used for this analysis was found on Kaggle, analyzed in order to get a better understanding of the whole process and possibly offer a solution.</p><p><strong>Thought process</strong></p><p>The US database worked on contained the suspects details such as name, age, gender, race, attempted attack on the police, attempted to flee, if armed or not, signs of mental illness and also date of the incidence.</p><p><strong>Problem</strong> <strong>Statement</strong></p><p>When the people meant to protect you are the ones likely to shot/kill you, then it becomes a big issue that need to be addressed. The incidence of police shooting indiscriminately at harmless and unarmed individuals has become something of a great concern. This problem is being experience by people of other countries not just US. Last year, in addition to protest staged by Americans with the hashtag #Blacklivesmatters, which trended between June to September 2020, the Nigerian youths started an #endsars movement from October 9th till October 2020, registering their displeasure at this menace and imploring the government to intervene. Protest have been going on and off in Congo against police brutality since January last year till April 8, 2021.</p><p><strong>Visualization and Interpretation</strong></p><p>In 2015, there was increased publicity against the USA police force as people began to register their displeasure about the ugly act perpetuated by the USA police force. It was observed that officers on duty were shooting randomly and several people were victims of that ugly act.</p><p>The data gathered and analyzed above was from the 2015–2020 incidents. The data relies primarily on new accounts, social media postings and police reports</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/395/1*TEA8bKf4inidBqPeeh2HJg.png" /></figure><h4>From the graph above, it was observed that the shootings occurred most in 2015, there was a slight decrease in 2016 but that wasn’t sustainable as it rose again in 2017. However it is noticeable from the chart that the menance has been greatly curbed in 2020 as there is a significant decrease of almost 60% in the 2020.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/396/1*Er3twconI8YPrMZHmYwR3Q.png" /><figcaption><strong>From the visualization of this data, it is observed that White, Black and Hispanic were greatly affected with the most being the White.</strong></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/389/1*WBonwXP5IkMp9Zc4lCAVEw.png" /><figcaption><strong>The incidence of police shootings cut across about 50 states in United State of America, with the state with the highest number of incidence occurring Arizona</strong></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/381/1*118CLsUsLpn5MOsORGeFAw.png" /><figcaption><strong>Majority of the victims were male as can be seen from the chart. Over 95% of the people that were shot were male and young between the age of 25–29years old.</strong></figcaption></figure><p><strong>RECOMENDATION</strong></p><p>I recommend that a constructive analysis should be carried out in other states with similar problem of police shooting especially here in Nigeria as it has become a common occurrence. Thanks</p><p>Here is the link to the whole analysis on my github account <a href="https://github.com/Vivian-chizzy/US-police_shooting-analysis/blob/main/constructive%20analysis.ipynb">https://github.com/Vivian-chizzy/US-police_shooting-analysis/blob/main/constructive%20analysis.ipynb</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dc489b9ea581" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>