<?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 Simisola Akinoso on Medium]]></title>
        <description><![CDATA[Stories by Simisola Akinoso on Medium]]></description>
        <link>https://medium.com/@ceemiakins?source=rss-25f28a8446d2------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*R52WXoSblk6uESP3</url>
            <title>Stories by Simisola Akinoso on Medium</title>
            <link>https://medium.com/@ceemiakins?source=rss-25f28a8446d2------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 03:55:07 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ceemiakins/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[Wine Quality Prediction]]></title>
            <link>https://medium.com/@ceemiakins/wine-quality-prediction-c75991c68d2b?source=rss-25f28a8446d2------2</link>
            <guid isPermaLink="false">https://medium.com/p/c75991c68d2b</guid>
            <dc:creator><![CDATA[Simisola Akinoso]]></dc:creator>
            <pubDate>Sat, 11 Mar 2023 19:17:39 GMT</pubDate>
            <atom:updated>2023-03-11T19:17:39.959Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>T</strong>he main aim of this project is to predict which of the physicochemical features makes a good wine.</p><blockquote>Men are like wine — some turn to vinegar, but the best improve with age.”</blockquote><blockquote>Pope John XXIII</blockquote><h3><strong>What is wine?</strong></h3><p>Wine is an alcoholic drink typically made from fermented grapes.</p><p>The dataset for this project can be gotten from <a href="https://www.kaggle.com/yasserh/wine-quality-dataset">Kaggle</a></p><h3>Roadmap</h3><ol><li>Import the required libraries</li><li>Reading the csv file</li><li>Information on the dataset</li><li>Exploratory Data analysis</li><li>Data preprocessing</li><li>Selecting Input and target data</li><li>Train the models</li><li>Make predictions</li><li>Check model performance</li><li>Conclusion</li></ol><h3>Objective:</h3><ul><li>To use different machine learning models to predict the quality of the wine</li><li>Determine the features that are really important for a good wine</li></ul><h3><strong>Features of the dataset</strong></h3><ul><li>Fixed acidity: Influences the flavor of the wine. A significant reduction in acids can lead to wines that taste flat. Examples of fixed acids are tartaric, malic, citric, and succinic, which can be found in grapes (except succinic). It is measured in g/dm3.</li><li>Volatile acidity: These acids must be distilled out from the wine before the end of the production process. Excess of volatile acids are undesirable and lead to unpleasant flavor. It is measured in g/dm3.</li><li>Citric acid: The amount of citric acid in the wine, which most of it is usually consumed during the fermentation process. It acts as a preservative and small quantities can add freshness and flavor. It is measured in g/dm3.</li><li>Residual sugar: The amount of sugar remaining after the end of the fermentation. The goal is to have a perfect balance between sweetness and sourness. Wines with more than 45g/dm3 are considered sweet. It is measured in g/dm3.</li><li>Chlorides: The amount of salt in the wine.</li><li>Free sulfur dioxide: The amount of sulfur dioxide (SO2) in free form. They are also known as sulfites and too much of it is undesirable and gives a pungent odor. It is measured in g/dm3.</li><li>Total sulfur dioxide: The total amount of SO2 in the wine. This is added to kill harmful bacteria and preserve quality and freshness. It is measured in mg/dm3.</li><li>Density: It is used as a measure of the conversion of sugar to alcohol. Sweeter wines have higher density.</li><li>pH: Describes how acidic or basic a wine is on a scale from 0 (very acidic) to 14 (very basic).</li><li>Sulfate: The amount of mineral salts containing sulfur in the wine. It is an additive which can contribute to sulfur dioxide gas (SO2) levels and acts as an antimicrobial and antioxidant. They are related to the fermentation process and affect the aroma and flavor of the wine.</li><li>Alcohol: Alcohol is formed as a result of yeast-converting sugar during the fermentation process. It’s usually measured in % volume or alcohol by volume (ABV).</li><li>Quality: A quality label in the range of 0 (very bad) to 10 (very excellent). It is the median of at least three evaluations made by wine experts.</li></ul><h4><strong>Importing the required libraries</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1006/1*TzwT6Mzkx3INYRHoQ3yORw.png" /></figure><h4><strong>Reading the csv file</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1020/1*8RPIJ59sn7Cu1XJ4YdXoDw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1012/1*hNaDK7SEslbvICM-wR-lQg.png" /></figure><h4><strong>Information on the dataset</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/772/0*-MeW7KkHRrPqSFJT" /><figcaption><strong>There are 1143 records and 13 features in our dataset. We can see that from the 13 features in the dataset we have 11 floats(decimal numbers) and 2 integers(whole numbers).</strong></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1006/0*ZbxnBWbDaZtfkjK7" /><figcaption><strong>Here we have all the names of all the features in our dataset</strong></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/786/0*Qhbf8HhS2RhemhJn" /><figcaption><strong>The described method is used to show the statistical analysis of all numerical columns in our dataset.</strong></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1012/0*jKzpylZt9G8VemZk" /><figcaption><strong>The isnull() is used to check for missing values in our dataset. We can’t work with datasets that has missing values. From the above we can see that our dataset is clean. There are no missing values in our dataset</strong>.</figcaption></figure><h3>Exploratory Data analysis</h3><h4>Univariate Analysis</h4><p>Univariate analysis is the simplest form of analyzing data. uni means one. Univariate analysis is the analysis of one variable. The purpose of univariate analysis is to understand the distribution of values for a single variable.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1005/0*lPYBGDFqAwoXECUK" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/967/0*_2wXz0FUjRdWtDSG" /></figure><h4>Bivariate Analysis</h4><p>This is the analysis of two variables</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1015/0*RiGEt2ZQtKIlg3UW" /></figure><p>The above scatter plot is showing the visualization between density and fixed acidity.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1007/0*zlv5L-EM8OArC9OO" /></figure><p>The scatterplot above shows the visualization between density and alcohol.</p><h3><strong>Correlation matrix for features</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1006/0*iRMibpMeKqWAb_-W" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*snMID17k9IIE4qze" /></figure><ul><li>Alcohol is the most correlated to quality</li><li>Fixed acidity and density are the most highly correlated.</li></ul><p><strong>Data preprocessing: This is the manipulation or dropping of data before it is used in order to ensure performance which is important in the data mining process.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/999/0*KptDIQawcoAJ0pwb" /></figure><p>The bin() function is used to return the binary representation of a specified integer. We classified 2–6 as bad, any wine quality that falls within that range is a bad wine while 6–8 as good wine.</p><p>“pd.cut” is a function used to separate the array into different bins. “pd.cut” function is used to perform statistical analysis on scalar data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1009/0*MgKrVC_dGdkVXHqu" /></figure><p>This is the proportion of the good wines and the bad wines.</p><p><strong>Data Modeling</strong></p><p><strong>Standardizing feature variables and splitting the data</strong></p><p>It is important to standardize our data in order to equalize the range.</p><p>After standardizing, the data was spitted to both training and test set.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1017/0*F7uXTI4PaaL8wRWM" /></figure><h4><strong>Modeling</strong></h4><p>Different modeling techniques were used to check their accuracy. The modeling method used was linear regression and RandomForestClassifier .</p><p><strong>Linear Regression: </strong>This is used to predict the value of a variable based on the value of another variable.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1001/0*vMWVbZHVKlgW0gvI" /></figure><h4><strong>Random forest</strong></h4><p>Random forest is an ensemble learning method for classification, regression and other tasks that operates by constructing a multitude of decision trees at training time. Random forest generally outperform decision trees but their accuracy is lower than gradient boosted trees.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1013/0*QWO8rGZeN-h549v8" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1005/0*ej3bqsWwyT_Bw3x_" /></figure><p>Using random forest classifier, we had an accuracy of 91.2 which performed better than our linear regressor.</p><h4><strong>Conclusion</strong>: Our model performed better using randomforestclassifier.</h4><p>Note that when performing modeling, there is a need to try out different modeling techniques to see the one which is most accurate for the dataset. Alcohol on the average and residual sugar on the average are one of the qualities of knowing a good wine.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c75991c68d2b" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>