<?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 Samuel Dafe on Medium]]></title>
        <description><![CDATA[Stories by Samuel Dafe on Medium]]></description>
        <link>https://medium.com/@simplydaphey93?source=rss-4a22eb1096eb------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*lXtoS9a50JvcvaU1</url>
            <title>Stories by Samuel Dafe on Medium</title>
            <link>https://medium.com/@simplydaphey93?source=rss-4a22eb1096eb------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 10:35:20 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@simplydaphey93/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[Nike Sales Performance Analysis]]></title>
            <link>https://medium.com/@simplydaphey93/nike-sales-performance-analysis-12ea45f639ea?source=rss-4a22eb1096eb------2</link>
            <guid isPermaLink="false">https://medium.com/p/12ea45f639ea</guid>
            <dc:creator><![CDATA[Samuel Dafe]]></dc:creator>
            <pubDate>Tue, 15 Jul 2025 20:33:14 GMT</pubDate>
            <atom:updated>2025-07-15T20:33:14.431Z</atom:updated>
            <content:encoded><![CDATA[<h3>Nike Sales Performance Analysis</h3><h3>Introduction</h3><p>This project presents a comprehensive sales performance analysis, utilizing Nike, Inc. as a real-world case study. The primary objective was to delve into various facets of Nike’s sales data to uncover key trends, identify performance drivers, and provide actionable insights. Through a rigorous examination of sales metrics, market dynamics, and product performance, this analysis aims to illustrate the application of data analytics in understanding and optimizing business strategies within the competitive athletic apparel and footwear industry. The findings herein offer a data-driven perspective on Nike’s market position and operational efficiency, serving as a testament to the power of analytical methodologies in strategic decision-making.</p><h3>Background</h3><p>Nike, Inc. stands as a global leader in the design, development, manufacturing, and worldwide marketing and sales of footwear, apparel, equipment, accessories, and services. Operating in a highly dynamic and competitive market, Nike’s success is intrinsically linked to its ability to understand consumer behavior, adapt to market shifts, and maintain robust sales performance across diverse geographical regions and product categories.</p><p>This project was initiated to explore the underlying factors contributing to Nike’s sales figures. It involved gathering and analyzing relevant sales data, which, while hypothetical for the purpose of this portfolio piece, is designed to reflect the complexities and scale typical of a major multinational corporation. The analysis sought to answer critical questions such as: What are the top-performing product categories? How do seasonal trends impact sales? Are there specific regions that consistently outperform others? What insights can be derived regarding pricing strategies or promotional effectiveness?</p><p>The insights gained from this analysis are crucial for understanding the intricacies of sales operations in a global enterprise. They highlight the importance of data-driven insights in optimizing inventory, refining marketing campaigns, and informing future product development. This project demonstrates proficiency in data collection, cleaning, analysis, and visualization, culminating in a narrative that translates complex data into clear, strategic recommendations.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HMEZGr0tzT4SmdsXQVx1Ug.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/909/1*aUKSe_WTo8pLkk4yLhUztg.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=12ea45f639ea" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Shop’24 end of the year sales]]></title>
            <link>https://medium.com/@simplydaphey93/shop24-end-of-the-year-sales-d98f4d3635ff?source=rss-4a22eb1096eb------2</link>
            <guid isPermaLink="false">https://medium.com/p/d98f4d3635ff</guid>
            <dc:creator><![CDATA[Samuel Dafe]]></dc:creator>
            <pubDate>Fri, 03 Jan 2025 21:53:42 GMT</pubDate>
            <atom:updated>2025-01-03T21:53:42.868Z</atom:updated>
            <content:encoded><![CDATA[<p>Shop’24 a sales organization in the USA is looking at closing her books for the year and have given you the task as the Data Scientist at Shop’24.<br>Your task is to fetch valuable details of the company’s business processes from the database which includes customer, product and sales data.<br>You are to analyze them and create a dashboard to visualize every insight discovered and present to the board.</p><p>The store had 500 customers, 1500 business transactions, 5 different product categories with multiple products in offering.</p><p>The project took different stages, some of which included:<br>a. Data cleaning and preparation</p><p>b. Data modelling</p><p>c. Creating calculated columns</p><p>d. Creating pivot tables and pivot charts</p><p>e. Dashboard creation</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tC9mxQavYTrAmp8u-A36Yw.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d98f4d3635ff" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Supervised Machine Learning:]]></title>
            <link>https://medium.com/@simplydaphey93/supervised-machine-learning-9806345c98b0?source=rss-4a22eb1096eb------2</link>
            <guid isPermaLink="false">https://medium.com/p/9806345c98b0</guid>
            <category><![CDATA[data-analysis]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[data-visualization]]></category>
            <dc:creator><![CDATA[Samuel Dafe]]></dc:creator>
            <pubDate>Thu, 02 Jan 2025 01:29:00 GMT</pubDate>
            <atom:updated>2025-01-02T01:29:00.669Z</atom:updated>
            <content:encoded><![CDATA[<p>A case study of NexusHealthNG</p><h3>NexusHealth Analysis</h3><h3>1. Case Study Background</h3><h4>Domain: Healthcare</h4><h4>Scenario:</h4><p>Imagine you&#39;re part of a healthcare analytics team at a hospital, where the objective is to predict patient outcomes based on diagnostic data. For instance, predicting if a patient will respond positively to a particular treatment (classification) or estimating the recovery duration (regression).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0zet_ayGxRfCfWAeZU6MpA.jpeg" /></figure><h4>Objective:</h4><p>The project aims to analyze patient diagnostic data and train models to: Classify whether patients have specific conditions based on symptoms and diagnostics. Predict the time required for recovery based on their profile and initial diagnosis.</p><h3>2. Project Goals</h3><p>Supervised Learning: Understand and apply the fundamentals of supervised learning, covering both classification and regression tasks. Data Preprocessing: Handle missing values, encode categorical variables, normalize/scale features, and understand feature importance. Model Evaluation: Learn to evaluate models using appropriate metrics, like accuracy, precision, recall, F1-score for classification, and RMSE/MAE for regression. Model Optimization: Understand hyperparameter tuning and cross-validation.</p><h3>3. Dataset</h3><h4>Attributes:</h4><p>Patient Information: Patient ID, age, gender, lifestyle factors (e.g., smoking status, activity level).</p><p>Medical History: Existing conditions, past treatments, family history of disease.</p><p>Current Diagnostics: Test results (e.g., blood pressure, cholesterol levels, heart rate, glucose level, diagnostic codes).</p><h4>Outcome Variables:</h4><p>Classification: Diagnosis of a target condition (e.g., &#39;Yes&#39; or &#39;No&#39; for diabetes, hypertension). Regression: Days until recovery or improvement post-diagnosis.</p><h4>Size:</h4><p>9000 rows, ensuring a mix of categorical and numerical features.</p><p>In [2]: Importing all necessary libraries</p><pre>import pandas as pd<br>import numpy as np<br>import seaborn as sns<br>import matplotlib.pyplot as plt<br>from sklearn.model_selection import train_test_split<br>from sklearn.preprocessing import StandardScaler, LabelEncoder<br>from sklearn.metrics import accuracy_score, classification_report, mean_squared_error, mean_absolute_error, confusion_matrix, precision_score<br>from sklearn.linear_model import LogisticRegression, LinearRegression, SGDClassifier<br>from sklearn.tree import DecisionTreeClassifier<br>from sklearn.ensemble import RandomForestClassifier, RandomForestRegressor</pre><h4>Load the Dataset</h4><pre>data = pd.read_csv(&quot;Patient_Diagnostics_Dataset.csv&quot;, index_col=&quot;Patient_ID&quot;)<br><br>data.head(10)</pre><p>Out[4]:</p><p>AgeGenderSmoking_StatusActivity_LevelExisting_ConditionsFamily_HistoryBlood_PressureCholesterol_LevelHeart_RateGlucose_LevelDiagnosisTarget_ConditionRecovery_DaysPatient_ID169MaleNon-SmokerHighNaNYes143170112166Condition_BYes34232MaleSmokerLowDiabetesNo10518472137Condition_CNo42389MaleSmokerLowHypertensionYes124253119127Condition_ANo25478MaleSmokerHighHypertensionNo164203119175Condition_CYes31538MaleSmokerHighNaNNo17627368123Condition_DNo31641MaleNon-SmokerMediumHypertensionNo11925773154Condition_DYes32720FemaleNon-SmokerHighNaNNo13719376117Condition_CYes31839MaleNon-SmokerHighHeart DiseaseNo15823494174Condition_ANo25970MaleSmokerMediumHypertensionYes9715377170Condition_CYes371019FemaleSmokerMediumHypertensionYes14027271179Condition_BNo36</p><pre>data.columns</pre><p>Out[5]:</p><pre>Index([&#39;Age&#39;, &#39;Gender&#39;, &#39;Smoking_Status&#39;, &#39;Activity_Level&#39;,<br>       &#39;Existing_Conditions&#39;, &#39;Family_History&#39;, &#39;Blood_Pressure&#39;,<br>       &#39;Cholesterol_Level&#39;, &#39;Heart_Rate&#39;, &#39;Glucose_Level&#39;, &#39;Diagnosis&#39;,<br>       &#39;Target_Condition&#39;, &#39;Recovery_Days&#39;],<br>      dtype=&#39;object&#39;)</pre><h3>Basic Stat of the Data</h3><pre>data.info()</pre><pre>&lt;class &#39;pandas.core.frame.DataFrame&#39;&gt;<br>Index: 9000 entries, 1 to 9000<br>Data columns (total 13 columns):<br> #   Column               Non-Null Count  Dtype <br>---  ------               --------------  ----- <br> 0   Age                  9000 non-null   int64 <br> 1   Gender               9000 non-null   object<br> 2   Smoking_Status       9000 non-null   object<br> 3   Activity_Level       9000 non-null   object<br> 4   Existing_Conditions  6746 non-null   object<br> 5   Family_History       9000 non-null   object<br> 6   Blood_Pressure       9000 non-null   int64 <br> 7   Cholesterol_Level    9000 non-null   int64 <br> 8   Heart_Rate           9000 non-null   int64 <br> 9   Glucose_Level        9000 non-null   int64 <br> 10  Diagnosis            9000 non-null   object<br> 11  Target_Condition     9000 non-null   object<br> 12  Recovery_Days        9000 non-null   int64 <br>dtypes: int64(6), object(7)<br>memory usage: 984.4+ KB</pre><p>In [8]:</p><pre>data.describe()</pre><p>Out[8]:</p><p>AgeBlood_PressureCholesterol_LevelHeart_RateGlucose_LevelRecovery_Dayscount9000.0000009000.0000009000.0000009000.0000009000.0000009000.000000mean53.539778133.792111225.20855689.466667134.58366729.308778std20.72796726.07274043.30352717.19357637.4828739.984970min18.00000090.000000150.00000060.00000070.000000-7.00000025%36.000000111.000000188.00000075.000000102.00000023.00000050%53.000000134.000000226.00000089.000000135.00000029.00000075%72.000000156.000000263.000000104.000000167.00000036.000000max89.000000179.000000299.000000119.000000199.00000066.000000</p><p>In [9]:</p><pre>data.describe(include=&#39;object&#39;)</pre><p>Out[9]:</p><p>GenderSmoking_StatusActivity_LevelExisting_ConditionsFamily_HistoryDiagnosisTarget_Conditioncount9000900090006746900090009000unique2233242topFemaleNon-SmokerLowHypertensionNoCondition_BYesfreq4550454131082329459122954565</p><p>In [10]:</p><pre>data[&quot;Existing_Conditions&quot;].unique()</pre><p>Out[10]:</p><pre>array([nan, &#39;Diabetes&#39;, &#39;Hypertension&#39;, &#39;Heart Disease&#39;], dtype=object)</pre><h3>Data PreProcessing</h3><p>Data preprocessing in machine learning is a critical step that involves preparing raw data to make it suitable for modeling. It transforms data into a clean, structured, and ready-to-use format, enabling algorithms to train more efficiently and produce accurate predictions. Preprocessing can include cleaning, transforming, and reducing data, among other steps.</p><h3>Missing Data Analysis &amp; Data Cleaning</h3><p>In [13]:</p><pre># Check for missing data<br><br>missing_values = data.isnull().sum()<br><br>missing_values</pre><p>Out[13]:</p><pre>Age                       0<br>Gender                    0<br>Smoking_Status            0<br>Activity_Level            0<br>Existing_Conditions    2254<br>Family_History            0<br>Blood_Pressure            0<br>Cholesterol_Level         0<br>Heart_Rate                0<br>Glucose_Level             0<br>Diagnosis                 0<br>Target_Condition          0<br>Recovery_Days             0<br>dtype: int64</pre><p>In [14]:</p><pre># Display the Percentage of missing data statistics<br><br>missing_data_percentage = (missing_values / len(data)) * 100<br><br>missing_data_percentage</pre><p>Out[14]:</p><pre>Age                     0.000000<br>Gender                  0.000000<br>Smoking_Status          0.000000<br>Activity_Level          0.000000<br>Existing_Conditions    25.044444<br>Family_History          0.000000<br>Blood_Pressure          0.000000<br>Cholesterol_Level       0.000000<br>Heart_Rate              0.000000<br>Glucose_Level           0.000000<br>Diagnosis               0.000000<br>Target_Condition        0.000000<br>Recovery_Days           0.000000<br>dtype: float64</pre><p>In [15]:</p><pre>mode_value = data[&#39;Existing_Conditions&#39;].mode()[0]<br><br>mode_value</pre><p>Out[15]:</p><pre>&#39;Hypertension</pre><p>In [16]:</p><pre># check for duplicates<br><br>data.duplicated().sum()</pre><p>Out[16]:</p><pre>0</pre><p>In [17]:</p><pre>data.shape</pre><p>Out[17]:</p><pre>(9000, 13)</pre><p>In [18]:</p><pre>data.head(10)</pre><p>Out[18]:</p><p>AgeGenderSmoking_StatusActivity_LevelExisting_ConditionsFamily_HistoryBlood_PressureCholesterol_LevelHeart_RateGlucose_LevelDiagnosisTarget_ConditionRecovery_DaysPatient_ID169MaleNon-SmokerHighNaNYes143170112166Condition_BYes34232MaleSmokerLowDiabetesNo10518472137Condition_CNo42389MaleSmokerLowHypertensionYes124253119127Condition_ANo25478MaleSmokerHighHypertensionNo164203119175Condition_CYes31538MaleSmokerHighNaNNo17627368123Condition_DNo31641MaleNon-SmokerMediumHypertensionNo11925773154Condition_DYes32720FemaleNon-SmokerHighNaNNo13719376117Condition_CYes31839MaleNon-SmokerHighHeart DiseaseNo15823494174Condition_ANo25970MaleSmokerMediumHypertensionYes9715377170Condition_CYes371019FemaleSmokerMediumHypertensionYes14027271179Condition_BNo36</p><h3>Univariate Analysis of Numerical Columns</h3><p>In [20]:</p><pre>numerical_data = data.select_dtypes(exclude=&#39;object&#39;)<br><br>numerical_data.drop(columns=&#39;Recovery_Days&#39;, inplace=True)<br><br>numerical_data</pre><p>Out[20]:</p><p>AgeBlood_PressureCholesterol_LevelHeart_RateGlucose_LevelPatient_ID1691431701121662321051847213738912425311912747816420311917553817627368123..................89967090171811608997471712556010889982011517998988999601331541011749000249421010794</p><p>9000 rows × 5 columns</p><p>In [21]:</p><pre># Visualization of numerical data on a Box plot<br><br><br>fig, axes = plt.subplots(nrows=3, ncols=2, figsize=(10,10))<br>ax = axes.flatten()<br><br>for index, column_name in enumerate(numerical_data):<br>    sns.boxplot(data[column_name], ax=ax[index], color=&quot;Orange&quot;)<br><br>plt.tight_layout()<br>plt.show()</pre><h3>Label Encoding</h3><p>Label encoding is a technique in machine learning used to convert categorical data (non-numeric data) into a numerical format so algorithms can process it. This is necessary because many machine learning algorithms only work with numerical inputs.</p><p>In [23]:</p><pre># Extract all columns with categorical data for encoding<br><br>cat_columns = [&#39;Gender&#39;, &#39;Smoking_Status&#39;, &#39;Activity_Level&#39;, &#39;Existing_Conditions&#39;, &#39;Family_History&#39;, &#39;Diagnosis&#39;, &#39;Target_Condition&#39;]<br>encoder = LabelEncoder()<br><br>for column_name in cat_columns:<br>    data[column_name] = encoder.fit_transform(data[column_name])<br><br>data.head(10)</pre><p>Out[23]:</p><p>AgeGenderSmoking_StatusActivity_LevelExisting_ConditionsFamily_HistoryBlood_PressureCholesterol_LevelHeart_RateGlucose_LevelDiagnosisTarget_ConditionRecovery_DaysPatient_ID16910031143170112166113423211100105184721372042389111211242531191270025478110201642031191752131538110301762736812330316411022011925773154313272000030137193761172131839100101582349417400259701122197153771702137101901221140272711791036</p><p>In [24]:</p><pre># Correlation Map showing relationships between features and target variables<br>plt.figure(figsize=(15, 6))<br><br>sns.heatmap(data.corr(), annot=True, fmt=&quot;.3f&quot;, cmap= &quot;Greens&quot;)<br>plt.title(&quot;Correlation Heatmap of Patient&#39;s Health Data&quot;)<br>plt.show()</pre><h3>Scaling Features</h3><p>Scaling in machine learning is a preprocessing technique used to adjust the range and distribution of numerical data, bringing features to a comparable scale.</p><p>In [26]:</p><pre>## Data2<br><br>data2 = data.copy(deep=True)</pre><p>In [27]:</p><pre># For numerical data<br><br># Scaling numerical columns<br><br>scaler = StandardScaler()<br>numerical_cols = [&#39;Age&#39;, &#39;Blood_Pressure&#39;, &#39;Cholesterol_Level&#39;, &#39;Heart_Rate&#39;, &#39;Glucose_Level&#39;]<br><br>data2[numerical_cols] = scaler.fit_transform(data2[numerical_cols])<br><br>data2.head(10)</pre><p>Out[27]:</p><p>AgeGenderSmoking_StatusActivity_LevelExisting_ConditionsFamily_HistoryBlood_PressureCholesterol_LevelHeart_RateGlucose_LevelDiagnosisTarget_ConditionRecovery_DaysPatient_ID10.745904100310.353181-1.2749911.3106400.83819811342-1.03922311100-1.104361-0.951674-1.0159400.064469204231.71083811121-0.3755900.6418181.717791-0.202335002541.180124110201.158665-0.5128861.7177911.07832121315-0.749743110301.6189411.103700-1.248598-0.30905630316-0.60500310220-0.5673720.734194-0.9577750.51803431327-1.618183000300.123043-0.743827-0.783282-0.46913821318-0.701496100100.9285270.2030300.2636791.051641002590.79415111221-1.411212-1.667591-0.7251170.944920213710-1.666430012210.2381121.080606-1.0741041.1850431036</p><h3>CLASSIFICATION</h3><p>Classification in machine learning is a type of supervised learning task where the goal is to predict a discrete label or category for a given input. In a classification problem, the algorithm learns from labeled data (training data) and uses this knowledge to classify new, unseen data into predefined categories.</p><p>In [29]:</p><pre>Classification_df = data.copy(deep=True)<br>Classification_df.drop(columns = &#39;Recovery_Days&#39;, inplace = True)<br><br>Classification_df.head()</pre><p>Out[29]:</p><p>AgeGenderSmoking_StatusActivity_LevelExisting_ConditionsFamily_HistoryBlood_PressureCholesterol_LevelHeart_RateGlucose_LevelDiagnosisTarget_ConditionPatient_ID169100311431701121661123211100105184721372038911121124253119127004781102016420311917521538110301762736812330</p><p>In [30]:</p><pre>Classification_df.shape</pre><p>Out[30]:</p><pre>(9000, 12)</pre><p>In [31]:</p><pre>data.head()</pre><p>Out[31]:</p><p>AgeGenderSmoking_StatusActivity_LevelExisting_ConditionsFamily_HistoryBlood_PressureCholesterol_LevelHeart_RateGlucose_LevelDiagnosisTarget_ConditionRecovery_DaysPatient_ID1691003114317011216611342321110010518472137204238911121124253119127002547811020164203119175213153811030176273681233031</p><p>In [32]:</p><pre>clf_data = Classification_df.sample(frac = 0.25)<br><br># Define feature matrix x and target vectors y<br>x = clf_data.drop([&#39;Target_Condition&#39;], axis=1) # fetures<br>y = clf_data[&#39;Target_Condition&#39;]  # Label<br><br><br><br># Splitting data into training and testing sets for each task<br>x_train_clf, x_test_clf, y_train_clf, y_test_clf = train_test_split(x, y, test_size=0.2, random_state=42)<br>x_train_clf.shape, x_test_clf.shape, y_train_clf.shape, y_test_clf.shape</pre><p>Out[32]:</p><pre>((1800, 11), (450, 11), (1800,), (450,))</pre><p>In [33]:</p><pre># Logistic Regression for Classification<br><br>clf_logreg = LogisticRegression()<br>clf_logreg.fit(x_train_clf, y_train_clf)<br>y_pred_clf_logreg = clf_logreg.predict(x_test_clf)<br><br># Logistic Regression Evaluation<br>print(&quot;Logistic Regression Classification Report: &quot;)<br>print(classification_report(y_test_clf, y_pred_clf_logreg))<br><br>print(f&quot;Training Score: {clf_logreg.score(x_train_clf, y_train_clf)}&quot;)<br>print(f&quot;Test Score: {clf_logreg.score(x_test_clf, y_test_clf)}&quot;)<br><br><br><br><br># Random Forest Classifier for classification<br>clf_rf = RandomForestClassifier()<br>clf_rf.fit(x_train_clf, y_train_clf)<br>y_pred_clf_rf = clf_rf.predict(x_test_clf)<br><br># Random Forest Evaluation<br>print(&quot;Random Forest Classification Report:&quot;)<br>print(classification_report(y_test_clf, y_pred_clf_rf))<br><br>print(f&quot;Training Score: {clf_rf.score(x_train_clf, y_train_clf)}&quot;)<br>print(f&quot;Test Score: {clf_rf.score(x_test_clf, y_test_clf)}&quot;)<br><br><br><br># Support Vector Classifier<br>from sklearn.svm import SVC<br>svc = SVC(class_weight=&#39;balanced&#39;)<br>svc.fit(x_train_clf, y_train_clf)<br>svc_pred = svc.predict(x_test_clf)<br><br># Support Vector Evaluation<br>print(&quot;Support Vector Classifier Classification Report:&quot;)<br>print(classification_report(y_test_clf, svc_pred))<br><br>print(f&quot;Training Score: {svc.score(x_train_clf, y_train_clf)}&quot;)<br>print(f&quot;Test Score: {svc.score(x_test_clf, y_test_clf)}&quot;)<br><br>## svc.score(x_train_clf2, y_train_clf2)<br><br><br># Initialize and train Decision Tree Classifier<br>clf_dt = DecisionTreeClassifier(criterion=&#39;gini&#39;, max_depth=3, random_state=42)<br>clf_dt.fit(x_train_clf, y_train_clf)<br>dt_pred = clf_dt.predict(x_test_clf)<br><br># Decision tree Evaluation<br>print(&quot;Decision Tree Classifier Classification Report:&quot;)<br>print(classification_report(y_test_clf, dt_pred))<br><br>print(f&quot;Training Score: {clf_dt.score(x_train_clf, y_train_clf)}&quot;)<br>print(f&quot;Test Score: {clf_dt.score(x_test_clf, y_test_clf)}&quot;)<br><br><br><br><br># XGBoost Classification<br>from xgboost import XGBClassifier<br>from sklearn.metrics import classification_report<br><br># Define and train XGBoost model<br>xgb_clf = XGBClassifier(random_state=42, n_estimators=100, learning_rate=0.1, max_depth=4)<br>xgb_clf.fit(x_train_clf, y_train_clf)<br>y_pred_xgb = xgb_clf.predict(x_test_clf)<br><br># XGBoost Evaluation<br>print(&quot;XGBoost Classification Report:&quot;)<br>print(classification_report(y_test_clf, y_pred_xgb))<br><br>print(f&quot;Training Score: {xgb_clf.score(x_train_clf, y_train_clf)}&quot;)<br>print(f&quot;Test Score: {xgb_clf.score(x_test_clf, y_test_clf)}&quot;)</pre><pre>C:\Users\BRC\anaconda3\Lib\site-packages\sklearn\linear_model\_logistic.py:469: ConvergenceWarning: lbfgs failed to converge (status=1):<br>STOP: TOTAL NO. of ITERATIONS REACHED LIMIT.<br><br>Increase the number of iterations (max_iter) or scale the data as shown in:<br>    https://scikit-learn.org/stable/modules/preprocessing.html<br>Please also refer to the documentation for alternative solver options:<br>    https://scikit-learn.org/stable/modules/linear_model.html#logistic-regression<br>  n_iter_i = _check_optimize_result(</pre><pre>Logistic Regression Classification Report: <br>              precision    recall  f1-score   support<br><br>           0       0.47      0.26      0.34       221<br>           1       0.50      0.71      0.59       229<br><br>    accuracy                           0.49       450<br>   macro avg       0.48      0.49      0.46       450<br>weighted avg       0.48      0.49      0.46       450<br><br>Training Score: 0.5216666666666666<br>Test Score: 0.4911111111111111<br>Random Forest Classification Report:<br>              precision    recall  f1-score   support<br><br>           0       0.51      0.49      0.50       221<br>           1       0.53      0.54      0.53       229<br><br>    accuracy                           0.52       450<br>   macro avg       0.52      0.52      0.52       450<br>weighted avg       0.52      0.52      0.52       450<br><br>Training Score: 1.0<br>Test Score: 0.5177777777777778<br>Support Vector Classifier Classification Report:<br>              precision    recall  f1-score   support<br><br>           0       0.51      0.71      0.60       221<br>           1       0.55      0.34      0.42       229<br><br>    accuracy                           0.52       450<br>   macro avg       0.53      0.53      0.51       450<br>weighted avg       0.53      0.52      0.50       450<br><br>Training Score: 0.5044444444444445<br>Test Score: 0.5222222222222223<br>Decision Tree Classifier Classification Report:<br>              precision    recall  f1-score   support<br><br>           0       0.50      0.05      0.09       221<br>           1       0.51      0.95      0.66       229<br><br>    accuracy                           0.51       450<br>   macro avg       0.50      0.50      0.38       450<br>weighted avg       0.50      0.51      0.38       450<br><br>Training Score: 0.535<br>Test Score: 0.5088888888888888<br>XGBoost Classification Report:<br>              precision    recall  f1-score   support<br><br>           0       0.49      0.45      0.47       221<br>           1       0.51      0.55      0.53       229<br><br>    accuracy                           0.50       450<br>   macro avg       0.50      0.50      0.50       450<br>weighted avg       0.50      0.50      0.50       450<br><br>Training Score: 0.835<br>Test Score: 0.5</pre><h3>Feature Importance</h3><p>Feature importance refers to a measure of how valuable each feature is in predicting the target variable. It quantifies the influence each feature has on the decision-making process of the model. Feature importance scores are particularly useful for interpretability, feature selection, and understanding which variables are most influential.</p><p>In [35]:</p><pre># plot feature importance<br>from xgboost import plot_importance<br><br>plot_importance(xgb_clf)<br>plt.show()</pre><p>In [36]:</p><pre>top_6 = [&#39;Cholesterol_Level&#39;, &#39;Glucose_Level&#39;, &#39;Age&#39;, &#39;Blood_Pressure&#39;, &#39;Heart_Rate&#39;, &#39;Existing_Conditions&#39;]<br><br>top_6_df = clf_data[top_6]<br>top_6_df.head()</pre><p>Out[36]:</p><p>Cholesterol_LevelGlucose_LevelAgeBlood_PressureHeart_RateExisting_ConditionsPatient_ID223626986331608022852031047114781215372959168173830489016818039132712716127810442176740</p><p>In [37]:</p><pre>x_train, x_test, y_train, y_test = train_test_split(top_6_df, y, test_size = 0.2, random_state = 0)<br>x_train.shape, x_test.shape, y_train.shape, y_test.shape</pre><p>Out[37]:</p><pre>((1800, 6), (450, 6), (1800,), (450,))</pre><p>In [38]:</p><pre>from xgboost import XGBClassifier<br>from sklearn.metrics import classification_report<br><br># Define and train XGBoost model<br>xgb_clf = XGBClassifier(random_state=42, n_estimators=100, learning_rate=0.1, max_depth=4)<br>xgb_clf.fit(x_train, y_train)<br><br># Make predictions and evaluate<br>y_pred_xgb = xgb_clf.predict(x_test)<br>print(&quot;XGBoost Classification Report:&quot;)<br>print(classification_report(y_test, y_pred_xgb))</pre><pre>XGBoost Classification Report:<br>              precision    recall  f1-score   support<br><br>           0       0.53      0.39      0.45       238<br>           1       0.47      0.61      0.53       212<br><br>    accuracy                           0.49       450<br>   macro avg       0.50      0.50      0.49       450<br>weighted avg       0.50      0.49      0.49       450</pre><p>In [39]:</p><pre># Retrain model based on top_6 feature importance<br><br><br>from xgboost import XGBClassifier<br>from sklearn.metrics import classification_report<br><br># Define and train XGBoost model<br>xgb_clf2 = XGBClassifier(random_state=42, n_estimators=100, learning_rate=0.1, max_depth=4)<br>xgb_clf2.fit(x_train, y_train)<br>y_pred_xgb2 = xgb_clf.predict(x_test)<br><br># XGBoost Evaluation<br>print(&quot;XGBoost Classification Report:&quot;)<br>print(classification_report(y_test, y_pred_xgb2))<br><br>print(f&quot;Training Score: {xgb_clf2.score(x_train, y_train)}&quot;)<br>print(f&quot;Test Score: {xgb_clf2.score(x_test, y_test)}&quot;)</pre><pre>XGBoost Classification Report:<br>              precision    recall  f1-score   support<br><br>           0       0.53      0.39      0.45       238<br>           1       0.47      0.61      0.53       212<br><br>    accuracy                           0.49       450<br>   macro avg       0.50      0.50      0.49       450<br>weighted avg       0.50      0.49      0.49       450<br><br>Training Score: 0.8138888888888889<br>Test Score: 0.49333333333333335</pre><p>In [40]:</p><pre>from sklearn.model_selection import GridSearchCV <br><br># defining parameter range <br>param_grid = {&#39;C&#39;: [0.1, 1, 10, 100, 1000], <br>			&#39;gamma&#39;: [1, 0.1, 0.01, 0.001, 0.0001], <br>			&#39;kernel&#39;: [&#39;rbf&#39;]} <br><br>grid = GridSearchCV(SVC(), param_grid, refit = True, verbose = 3) <br><br># fitting the model for grid search <br>grid.fit(x_train, y_train)</pre><pre>Fitting 5 folds for each of 25 candidates, totalling 125 fits<br>[CV 1/5] END ........C=0.1, gamma=1, kernel=rbf;, score=0.528 total time=   0.3s<br>[CV 2/5] END ........C=0.1, gamma=1, kernel=rbf;, score=0.528 total time=   0.3s<br>[CV 3/5] END ........C=0.1, gamma=1, kernel=rbf;, score=0.528 total time=   0.3s<br>[CV 4/5] END ........C=0.1, gamma=1, kernel=rbf;, score=0.528 total time=   0.4s<br>[CV 5/5] END ........C=0.1, gamma=1, kernel=rbf;, score=0.528 total time=   0.3s<br>[CV 1/5] END ......C=0.1, gamma=0.1, kernel=rbf;, score=0.528 total time=   0.3s<br>[CV 2/5] END ......C=0.1, gamma=0.1, kernel=rbf;, score=0.528 total time=   0.3s<br>[CV 3/5] END ......C=0.1, gamma=0.1, kernel=rbf;, score=0.528 total time=   0.5s<br>[CV 4/5] END ......C=0.1, gamma=0.1, kernel=rbf;, score=0.528 total time=   0.5s<br>[CV 5/5] END ......C=0.1, gamma=0.1, kernel=rbf;, score=0.528 total time=   0.6s<br>[CV 1/5] END .....C=0.1, gamma=0.01, kernel=rbf;, score=0.528 total time=   0.3s<br>[CV 2/5] END .....C=0.1, gamma=0.01, kernel=rbf;, score=0.528 total time=   0.1s<br>[CV 3/5] END .....C=0.1, gamma=0.01, kernel=rbf;, score=0.528 total time=   0.2s<br>[CV 4/5] END .....C=0.1, gamma=0.01, kernel=rbf;, score=0.528 total time=   0.2s<br>[CV 5/5] END .....C=0.1, gamma=0.01, kernel=rbf;, score=0.528 total time=   0.2s<br>[CV 1/5] END ....C=0.1, gamma=0.001, kernel=rbf;, score=0.528 total time=   0.1s<br>[CV 2/5] END ....C=0.1, gamma=0.001, kernel=rbf;, score=0.528 total time=   0.2s<br>[CV 3/5] END ....C=0.1, gamma=0.001, kernel=rbf;, score=0.528 total time=   0.1s<br>[CV 4/5] END ....C=0.1, gamma=0.001, kernel=rbf;, score=0.528 total time=   0.2s<br>[CV 5/5] END ....C=0.1, gamma=0.001, kernel=rbf;, score=0.528 total time=   0.1s<br>[CV 1/5] END ...C=0.1, gamma=0.0001, kernel=rbf;, score=0.528 total time=   0.3s<br>[CV 2/5] END ...C=0.1, gamma=0.0001, kernel=rbf;, score=0.528 total time=   0.1s<br>[CV 3/5] END ...C=0.1, gamma=0.0001, kernel=rbf;, score=0.528 total time=   0.6s<br>[CV 4/5] END ...C=0.1, gamma=0.0001, kernel=rbf;, score=0.528 total time=   0.2s<br>[CV 5/5] END ...C=0.1, gamma=0.0001, kernel=rbf;, score=0.528 total time=   0.3s<br>[CV 1/5] END ..........C=1, gamma=1, kernel=rbf;, score=0.528 total time=   0.3s<br>[CV 2/5] END ..........C=1, gamma=1, kernel=rbf;, score=0.528 total time=   0.3s<br>[CV 3/5] END ..........C=1, gamma=1, kernel=rbf;, score=0.528 total time=   0.4s<br>[CV 4/5] END ..........C=1, gamma=1, kernel=rbf;, score=0.528 total time=   0.3s<br>[CV 5/5] END ..........C=1, gamma=1, kernel=rbf;, score=0.528 total time=   0.6s<br>[CV 1/5] END ........C=1, gamma=0.1, kernel=rbf;, score=0.528 total time=   0.3s<br>[CV 2/5] END ........C=1, gamma=0.1, kernel=rbf;, score=0.528 total time=   0.3s<br>[CV 3/5] END ........C=1, gamma=0.1, kernel=rbf;, score=0.528 total time=   0.3s<br>[CV 4/5] END ........C=1, gamma=0.1, kernel=rbf;, score=0.528 total time=   0.5s<br>[CV 5/5] END ........C=1, gamma=0.1, kernel=rbf;, score=0.525 total time=   0.4s<br>[CV 1/5] END .......C=1, gamma=0.01, kernel=rbf;, score=0.514 total time=   0.2s<br>[CV 2/5] END .......C=1, gamma=0.01, kernel=rbf;, score=0.519 total time=   0.2s<br>[CV 3/5] END .......C=1, gamma=0.01, kernel=rbf;, score=0.525 total time=   0.2s<br>[CV 4/5] END .......C=1, gamma=0.01, kernel=rbf;, score=0.539 total time=   0.2s<br>[CV 5/5] END .......C=1, gamma=0.01, kernel=rbf;, score=0.522 total time=   0.2s<br>[CV 1/5] END ......C=1, gamma=0.001, kernel=rbf;, score=0.478 total time=   0.2s<br>[CV 2/5] END ......C=1, gamma=0.001, kernel=rbf;, score=0.514 total time=   0.1s<br>[CV 3/5] END ......C=1, gamma=0.001, kernel=rbf;, score=0.475 total time=   0.2s<br>[CV 4/5] END ......C=1, gamma=0.001, kernel=rbf;, score=0.503 total time=   0.1s<br>[CV 5/5] END ......C=1, gamma=0.001, kernel=rbf;, score=0.525 total time=   0.1s<br>[CV 1/5] END .....C=1, gamma=0.0001, kernel=rbf;, score=0.486 total time=   0.1s<br>[CV 2/5] END .....C=1, gamma=0.0001, kernel=rbf;, score=0.481 total time=   0.2s<br>[CV 3/5] END .....C=1, gamma=0.0001, kernel=rbf;, score=0.511 total time=   0.2s<br>[CV 4/5] END .....C=1, gamma=0.0001, kernel=rbf;, score=0.525 total time=   0.3s<br>[CV 5/5] END .....C=1, gamma=0.0001, kernel=rbf;, score=0.531 total time=   0.2s<br>[CV 1/5] END .........C=10, gamma=1, kernel=rbf;, score=0.528 total time=   1.0s<br>[CV 2/5] END .........C=10, gamma=1, kernel=rbf;, score=0.528 total time=   0.7s<br>[CV 3/5] END .........C=10, gamma=1, kernel=rbf;, score=0.528 total time=   0.5s<br>[CV 4/5] END .........C=10, gamma=1, kernel=rbf;, score=0.528 total time=   0.7s<br>[CV 5/5] END .........C=10, gamma=1, kernel=rbf;, score=0.528 total time=   0.5s<br>[CV 1/5] END .......C=10, gamma=0.1, kernel=rbf;, score=0.528 total time=   0.4s<br>[CV 2/5] END .......C=10, gamma=0.1, kernel=rbf;, score=0.528 total time=   0.3s<br>[CV 3/5] END .......C=10, gamma=0.1, kernel=rbf;, score=0.528 total time=   0.4s<br>[CV 4/5] END .......C=10, gamma=0.1, kernel=rbf;, score=0.528 total time=   0.3s<br>[CV 5/5] END .......C=10, gamma=0.1, kernel=rbf;, score=0.525 total time=   0.4s<br>[CV 1/5] END ......C=10, gamma=0.01, kernel=rbf;, score=0.514 total time=   0.2s<br>[CV 2/5] END ......C=10, gamma=0.01, kernel=rbf;, score=0.542 total time=   0.1s<br>[CV 3/5] END ......C=10, gamma=0.01, kernel=rbf;, score=0.517 total time=   0.2s<br>[CV 4/5] END ......C=10, gamma=0.01, kernel=rbf;, score=0.528 total time=   0.3s<br>[CV 5/5] END ......C=10, gamma=0.01, kernel=rbf;, score=0.528 total time=   0.2s<br>[CV 1/5] END .....C=10, gamma=0.001, kernel=rbf;, score=0.436 total time=   0.2s<br>[CV 2/5] END .....C=10, gamma=0.001, kernel=rbf;, score=0.528 total time=   0.2s<br>[CV 3/5] END .....C=10, gamma=0.001, kernel=rbf;, score=0.508 total time=   0.2s<br>[CV 4/5] END .....C=10, gamma=0.001, kernel=rbf;, score=0.553 total time=   0.2s<br>[CV 5/5] END .....C=10, gamma=0.001, kernel=rbf;, score=0.525 total time=   0.2s<br>[CV 1/5] END ....C=10, gamma=0.0001, kernel=rbf;, score=0.475 total time=   0.2s<br>[CV 2/5] END ....C=10, gamma=0.0001, kernel=rbf;, score=0.472 total time=   0.2s<br>[CV 3/5] END ....C=10, gamma=0.0001, kernel=rbf;, score=0.483 total time=   0.2s<br>[CV 4/5] END ....C=10, gamma=0.0001, kernel=rbf;, score=0.528 total time=   0.2s<br>[CV 5/5] END ....C=10, gamma=0.0001, kernel=rbf;, score=0.489 total time=   0.2s<br>[CV 1/5] END ........C=100, gamma=1, kernel=rbf;, score=0.528 total time=   0.4s<br>[CV 2/5] END ........C=100, gamma=1, kernel=rbf;, score=0.528 total time=   0.4s<br>[CV 3/5] END ........C=100, gamma=1, kernel=rbf;, score=0.528 total time=   0.4s<br>[CV 4/5] END ........C=100, gamma=1, kernel=rbf;, score=0.528 total time=   0.3s<br>[CV 5/5] END ........C=100, gamma=1, kernel=rbf;, score=0.528 total time=   0.4s<br>[CV 1/5] END ......C=100, gamma=0.1, kernel=rbf;, score=0.528 total time=   0.3s<br>[CV 2/5] END ......C=100, gamma=0.1, kernel=rbf;, score=0.528 total time=   0.3s<br>[CV 3/5] END ......C=100, gamma=0.1, kernel=rbf;, score=0.528 total time=   0.4s<br>[CV 4/5] END ......C=100, gamma=0.1, kernel=rbf;, score=0.528 total time=   0.5s<br>[CV 5/5] END ......C=100, gamma=0.1, kernel=rbf;, score=0.525 total time=   0.5s<br>[CV 1/5] END .....C=100, gamma=0.01, kernel=rbf;, score=0.514 total time=   0.2s<br>[CV 2/5] END .....C=100, gamma=0.01, kernel=rbf;, score=0.542 total time=   0.2s<br>[CV 3/5] END .....C=100, gamma=0.01, kernel=rbf;, score=0.517 total time=   0.3s<br>[CV 4/5] END .....C=100, gamma=0.01, kernel=rbf;, score=0.528 total time=   0.2s<br>[CV 5/5] END .....C=100, gamma=0.01, kernel=rbf;, score=0.528 total time=   0.2s<br>[CV 1/5] END ....C=100, gamma=0.001, kernel=rbf;, score=0.458 total time=   0.7s<br>[CV 2/5] END ....C=100, gamma=0.001, kernel=rbf;, score=0.531 total time=   0.6s<br>[CV 3/5] END ....C=100, gamma=0.001, kernel=rbf;, score=0.500 total time=   0.6s<br>[CV 4/5] END ....C=100, gamma=0.001, kernel=rbf;, score=0.525 total time=   0.5s<br>[CV 5/5] END ....C=100, gamma=0.001, kernel=rbf;, score=0.517 total time=   0.6s<br>[CV 1/5] END ...C=100, gamma=0.0001, kernel=rbf;, score=0.469 total time=   0.3s<br>[CV 2/5] END ...C=100, gamma=0.0001, kernel=rbf;, score=0.469 total time=   0.3s<br>[CV 3/5] END ...C=100, gamma=0.0001, kernel=rbf;, score=0.483 total time=   0.3s<br>[CV 4/5] END ...C=100, gamma=0.0001, kernel=rbf;, score=0.514 total time=   0.4s<br>[CV 5/5] END ...C=100, gamma=0.0001, kernel=rbf;, score=0.522 total time=   0.3s<br>[CV 1/5] END .......C=1000, gamma=1, kernel=rbf;, score=0.528 total time=   0.5s<br>[CV 2/5] END .......C=1000, gamma=1, kernel=rbf;, score=0.528 total time=   0.4s<br>[CV 3/5] END .......C=1000, gamma=1, kernel=rbf;, score=0.528 total time=   0.4s<br>[CV 4/5] END .......C=1000, gamma=1, kernel=rbf;, score=0.528 total time=   0.4s<br>[CV 5/5] END .......C=1000, gamma=1, kernel=rbf;, score=0.528 total time=   0.5s<br>[CV 1/5] END .....C=1000, gamma=0.1, kernel=rbf;, score=0.528 total time=   0.3s<br>[CV 2/5] END .....C=1000, gamma=0.1, kernel=rbf;, score=0.528 total time=   0.3s<br>[CV 3/5] END .....C=1000, gamma=0.1, kernel=rbf;, score=0.528 total time=   0.4s<br>[CV 4/5] END .....C=1000, gamma=0.1, kernel=rbf;, score=0.528 total time=   0.4s<br>[CV 5/5] END .....C=1000, gamma=0.1, kernel=rbf;, score=0.525 total time=   0.4s<br>[CV 1/5] END ....C=1000, gamma=0.01, kernel=rbf;, score=0.514 total time=   0.2s<br>[CV 2/5] END ....C=1000, gamma=0.01, kernel=rbf;, score=0.542 total time=   0.1s<br>[CV 3/5] END ....C=1000, gamma=0.01, kernel=rbf;, score=0.517 total time=   0.2s<br>[CV 4/5] END ....C=1000, gamma=0.01, kernel=rbf;, score=0.528 total time=   0.2s<br>[CV 5/5] END ....C=1000, gamma=0.01, kernel=rbf;, score=0.528 total time=   0.2s<br>[CV 1/5] END ...C=1000, gamma=0.001, kernel=rbf;, score=0.469 total time=   0.5s<br>[CV 2/5] END ...C=1000, gamma=0.001, kernel=rbf;, score=0.522 total time=   0.7s<br>[CV 3/5] END ...C=1000, gamma=0.001, kernel=rbf;, score=0.494 total time=   0.8s<br>[CV 4/5] END ...C=1000, gamma=0.001, kernel=rbf;, score=0.525 total time=   0.7s<br>[CV 5/5] END ...C=1000, gamma=0.001, kernel=rbf;, score=0.528 total time=   0.7s<br>[CV 1/5] END ..C=1000, gamma=0.0001, kernel=rbf;, score=0.467 total time=   1.8s<br>[CV 2/5] END ..C=1000, gamma=0.0001, kernel=rbf;, score=0.475 total time=   1.5s<br>[CV 3/5] END ..C=1000, gamma=0.0001, kernel=rbf;, score=0.511 total time=   1.6s<br>[CV 4/5] END ..C=1000, gamma=0.0001, kernel=rbf;, score=0.514 total time=   2.0s<br>[CV 5/5] END ..C=1000, gamma=0.0001, kernel=rbf;, score=0.533 total time=   2.1s</pre><p>Out[40]:</p><p><strong>GridSearchCV</strong><a href="https://scikit-learn.org/1.4/modules/generated/sklearn.model_selection.GridSearchCV.html"><strong>?</strong></a><strong>i</strong></p><p><strong>estimator: SVC</strong></p><p>SVC<a href="https://scikit-learn.org/1.4/modules/generated/sklearn.svm.SVC.html">?</a></p><p>In [41]:</p><pre># Support Vector Classifier<br>from sklearn.svm import SVC<br>svc = SVC(class_weight=&#39;balanced&#39;)<br>svc.fit(x_train_clf, y_train_clf)<br>svc_pred = svc.predict(x_test_clf)<br><br># Support Vector Evaluation<br>print(&quot;Support Vector Classifier Classification Report:&quot;)<br>print(classification_report(y_test_clf, svc_pred))<br><br>print(f&quot;Training Score: {svc.score(x_train_clf, y_train_clf)}&quot;)<br>print(f&quot;Test Score: {svc.score(x_test_clf, y_test_clf)}&quot;)</pre><pre>Support Vector Classifier Classification Report:<br>              precision    recall  f1-score   support<br><br>           0       0.51      0.71      0.60       221<br>           1       0.55      0.34      0.42       229<br><br>    accuracy                           0.52       450<br>   macro avg       0.53      0.53      0.51       450<br>weighted avg       0.53      0.52      0.50       450<br><br>Training Score: 0.5044444444444445<br>Test Score: 0.5222222222222223</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9806345c98b0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Kwery Analytics Internet Sales (MS Excel) Report]]></title>
            <link>https://medium.com/@simplydaphey93/kwery-analytics-internet-sales-ms-excel-report-b417e134a46e?source=rss-4a22eb1096eb------2</link>
            <guid isPermaLink="false">https://medium.com/p/b417e134a46e</guid>
            <category><![CDATA[data-analysis]]></category>
            <category><![CDATA[data-analytics]]></category>
            <category><![CDATA[data-visualization]]></category>
            <category><![CDATA[dashboard]]></category>
            <dc:creator><![CDATA[Samuel Dafe]]></dc:creator>
            <pubDate>Mon, 10 Jun 2024 09:51:19 GMT</pubDate>
            <atom:updated>2024-06-10T09:51:19.560Z</atom:updated>
            <content:encoded><![CDATA[<p>Kwery Analytics (a self given name…..hoping to start an analytics company called Kwery someday) is an online store situated in Europe with customers scattered around France, Germany, Australia, The United Kingdom, Canada and the United States of America.</p><p>In this analysis, we were able to uncover relevant insights and answer certain questions, some of which includes:</p><ol><li>Total Revenue generated from online sales</li><li>Total orders placed between the year 2005–2008</li><li>Revenue generated by country</li><li>Top 5 selling products</li><li>Frequently used order line</li><li>Top 5 Ordered products</li><li>Average delivery days per order.</li></ol><figure><img alt="Dashboard creation and Visualization of discovered Insights" src="https://cdn-images-1.medium.com/max/1024/1*1rRZdpvevwAsz9dWqaLTww.png" /><figcaption>Analytics Dashboard/Visualization</figcaption></figure><p>THE DATASET<br>The dataset for this analysis consist of 6 excel worksheets embedded in a Workbook.<br>This includes a row count of 60398 rows in the first sheet (FactInternetSales) which included every necessary details about the pricing per product, product key, sales territory key, order date key, Tax, freight, etc</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zNfkW5-JZ44ANaRJx6Q8Hg.png" /><figcaption>Fact Internet Sales Data</figcaption></figure><p>The second sheet (DimProduct) includes data concerning the products listed on the sales platform.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*K-dRwblyormYBarsZhAcuA.png" /></figure><p>The third sheet (DimSalesTerritory) included the sales territory (Location) where orders are made from.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*k7qwSr39YEpFmzElSqxjDA.png" /></figure><p>The fourth sheet (DimDate) includes the date each product was ordered, shipped and delivered.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2JYr4XFQMSnM89aW7ypktw.png" /></figure><p>The fifth sheet (DimCustomer) involves the information about the customer. This includes; Customer First name, last name, title, date of birth, email address, education and work background, marital status, and gender.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Su3nh3J-qqVdRmVWT5FAHg.png" /></figure><p>All these sheets were thoroughly looked into to pick out relevant errors to be corrected in lieu of the business questions to be answered. This process is often referred to as Data Preparation.</p><p>Some of the errors/dirt discovered in the dataset includes:<br>Irrelevant columns, empty cells, spelling errors, data type errors, etc</p><p>After data preparation, the next procedure (Data Cleaning) was carried out.<br>In this process, advanced MS Excel functions were used<br>a. Concatenation (For combining strings in different cells into one)<br>b. VLOOKUP (For looking up matching values from the different sheets and importing the values into the needed sheet for analysis)<br>c. Date (Converting data from the number type to the date type)</p><p>Certain formulas were applied to ensure proper calculation of values which includes Total Revenue, Total Sales, Sum of Orders, Profit, Average days for delivery of products ordered, etc</p><p>After which the data was loaded into Power Query for further cleaning activities and combining the separate tables into one.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2MxUKSgW3co3p19UQq56Pg.png" /><figcaption>Data loaded from Power Query</figcaption></figure><p>After cleaning was done and the tables successfully combined using Power Query, relevant KPIs were generated using Pivot Tables to answer the business questions already listed above.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SZWcc4eAPDLRHDie2URejQ.png" /><figcaption>KPIS generated using Pivot Tables</figcaption></figure><p>It honestly took quite a while deciding on the last and final phase of the analytics process — Visualization and Dashboard Creation.</p><p>Well, thankfully I was able to channel my inner Vincent Van Gogh to create what I show below as the Dashboard and Visualization for this project</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1rRZdpvevwAsz9dWqaLTww.png" /><figcaption>Kwery Analytics Dashboard</figcaption></figure><p>Thank you for reading through<br>I hope you enjoyed it.</p><p>For Freelance gigs, projects and collaborations, <br>email: simplydaphey93@gmail.com</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b417e134a46e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Big Fashion Group Excel Project]]></title>
            <link>https://medium.com/@simplydaphey93/ms-excel-portfolio-project-2df1b455f468?source=rss-4a22eb1096eb------2</link>
            <guid isPermaLink="false">https://medium.com/p/2df1b455f468</guid>
            <category><![CDATA[sales-analytics]]></category>
            <dc:creator><![CDATA[Samuel Dafe]]></dc:creator>
            <pubDate>Tue, 07 Nov 2023 10:10:09 GMT</pubDate>
            <atom:updated>2023-11-08T10:24:26.955Z</atom:updated>
            <content:encoded><![CDATA[<p>After months of constant tutorials, YouTube videos, Online Courses and an almost frustrating process…..especially in this part of the world where almost everything is a battle including data and power supply and fuel, I finally mustered the courage to take on my first MS Excel project, and trust me it was quite a journey.</p><p>Well, here I will be taking you through the journey.</p><p>First of all was acquiring the datasets from an online source. The dataset includes a Marketing Plan data that contained about 72,000 rows from January to July of that year.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dsviWbJNKkW_fPq-NVXMeg.png" /></figure><p>The dataset also includes extra worksheet of data for the Month of August of that same year which contained about 4,500 rows of data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mq5QahCP_o3uPOYRYggRdw.png" /></figure><p>THE PROCESS</p><p>After this dataset was imported from a .csv format into an Excel worksheet, cleaning and analysis procedures started.<br>This procedures includes:<br>1. Spell Checking</p><p>2. Duplicate data removal</p><p>3. Number Formatting</p><p>4. Creating Pivot Tables to answer specific data driven question to provide insights.</p><p>5. Displaying Insights from Pivot Tables on a Pivot Chart for visualization</p><p>Some of such questions includes:</p><ol><li>Sales by chain</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3va8ml5qE2929fPUF6iuXA.png" /></figure><p>2. Sales by Category</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6ACy3wK4zIyPyxvXULP8SQ.png" /></figure><p>3. Sales by Manager</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NYF088OhgsWArrRPiZzOBQ.png" /></figure><p>4. Total Sales by State</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*phrdKaEydPWKyzm4JEKGPg.png" /></figure><h3>Final Visualization Dashboard</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*maiXRpWyL8pAWwrmd8kvug.png" /></figure><h3><strong>Limitations</strong></h3><ol><li>Excel’s data cleaning capabilities are limited compared to specialized data wrangling tools. It can be cumbersome to handle missing values, outliers, and inconsistencies in large datasets using Excel’s built-in functions. Dedicated data wrangling tools offer more efficient and automated approaches to data cleaning.</li><li>Data provided for the analysis were mostly blank, incorrect data types, and duplicated. This made cleaning process more than a handful.</li></ol><h3>Insights</h3><ol><li>There are quite a lot of regions where our products have not been making sales. We need to start by sending in our best selling products to those regions in order to gain market stance in those regions.</li><li>Based on marital status, people who identify as Alone, Widows seem to be low performers in patronizing our products. To solve this, we should first of all focus greatly on satisfying the greater population of patronizers (Married graduates, together graduates, single graduates). By continuous satisfaction of their needs, they will in turn be our indirect marketers to the low performance patronizers. One other factor could be the low turn out in Web Purchase. Increasing our visibility and seamless User experience on our website could trigger these populace to getting a product. Chances are that the condition of being alone, or a widow greatly affects their willing to take steps in going out to get products and also their interest in trying to figure out how to navigate a web channel when trying to buy a product.</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2df1b455f468" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>