<?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 Tobenson on Medium]]></title>
        <description><![CDATA[Stories by Tobenson on Medium]]></description>
        <link>https://medium.com/@tobikasali?source=rss-c5f5608b001c------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*pJpsWJfnUSUcX_fW.jpg</url>
            <title>Stories by Tobenson on Medium</title>
            <link>https://medium.com/@tobikasali?source=rss-c5f5608b001c------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 14:51:55 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@tobikasali/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[Unconscious Bias]]></title>
            <link>https://medium.com/@tobikasali/unconscious-bias-72bd297e4fa3?source=rss-c5f5608b001c------2</link>
            <guid isPermaLink="false">https://medium.com/p/72bd297e4fa3</guid>
            <dc:creator><![CDATA[Tobenson]]></dc:creator>
            <pubDate>Wed, 01 Jul 2020 22:10:16 GMT</pubDate>
            <atom:updated>2020-07-01T22:10:16.094Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Changing expectations</strong></p><p>A couple of my friends and colleagues have asked me about the black lives matter protests and if I had any experiences of racism. I live and work in Aberdeen, Scotland, and they didn’t think some of the things shown on TV and some of the issues being discussed existed or could ever occur in Aberdeen. They hadn’t seen any racist acts or behaviours and wanted to understand if I had any experiences and what they were.</p><p>Reflecting on my experiences and discussions with friends and colleagues, I realised that discrimination can be difficult to “see,” especially if it’s not directed at you. What stands out to me is not overt and intentional discrimination but an unconscious bias which manifests in different ways, one of which is lowered expectations.</p><p>In my first place of work in the UK, a colleague of mine offered to give me a ride home and asked where I lived. Before I could respond, she said, “It’s one of those council flats, isn’t it? since you’re on benefits and everything”. The insinuation being that because I was an immigrant, I had to be on benefits and, consequently, live in a council flat. I had just finished my Master’s degree and was on a work visa with no recourse to public funds. I certainly didn’t have access to benefits and I didn’t know anything about council flats either. Her quick summary took me by surprise. Why did she expect me to live there? According to her, She thought I had come over on a boat across the channel and she wasn’t being facetious! My colleague is one of the nicest and the most helpful people I know. However, she had an expectation of where I ought to live. The neighbourhood or community I should “naturally belong to.”</p><p>Now, there’s nothing wrong with living in council flats and the expectation of where I ought to live might not be worth discussing when it’s my colleague offering me a ride home, but it certainly becomes an issue when a young black man is running in a neighbourhood, and he’s followed and attacked because he “doesn’t fit” into that neighbourhood. The expectation is that he should not be there or couldn’t possibly live there, simply based on his skin colour.</p><p>Revisiting the incident with my colleague earlier, I was surprised and puzzled by the paradox of prejudice and heartfelt kindness. I thought of prejudiced people as being deliberately disdainful. The reality, however, is more complex. A friend asked me this question, “Can a person who is nice, friendly and helpful also have racist views, prejudice and unconscious bias?”. In my opinion, Yes.</p><p>In the fight against overt and intentional forms of discrimination, how do we ensure that we don’t lose sight of this hidden but real and prevalent problem of prejudice and unconscious bias? What has become clear to me through discussions with people of different cultures and from different parts of the world is that we all have prejudices and some form of unconscious bias. Our prejudices and biases arise primarily as a result of our upbringing, lack of exposure as well as the constant reinforcement of stereotypes, and they need to be acknowledged and addressed.</p><p>We need open and honest conversations about how our biases affect the decisions we make and the impact they have on others. Additionally, we need to understand how unconscious bias affects our expectations of people, what opportunities we think they are suited for or what roles they should aspire to. This is especially important for leaders in the workplace as they have an important role to play in shaping the careers of those they lead.</p><p>Furthermore, I’ve heard institutional discrimination mentioned often in the last few weeks but I doubt you could find a private or public institution in the UK that has laws promoting or condoning any form of discrimination. Instead, it’s normal people like you and me that have prejudices and biases that make up these institutions. The challenge is for all of us to examine ourselves, and organisations their processes, to ensure we are being as fair and equitable as possible in our judgements and decision making.</p><p>The Majority of us will never experience the horrors we’ve seen on TV over the last weeks with regards to the killing of George Floyd. For most of us, it’s the unconscious bias and the unintended consequences that affect our hopes and opportunities for a better future.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=72bd297e4fa3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[University level factors affecting Graduation rates]]></title>
            <link>https://medium.com/@tobikasali/university-level-factors-affecting-graduation-rates-b06f39d7ab2a?source=rss-c5f5608b001c------2</link>
            <guid isPermaLink="false">https://medium.com/p/b06f39d7ab2a</guid>
            <category><![CDATA[udacity-nanodegree]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Tobenson]]></dc:creator>
            <pubDate>Sun, 28 Apr 2019 17:38:11 GMT</pubDate>
            <atom:updated>2019-04-28T17:51:58.123Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/318/1*NH6BvuuUS76kBcFKBWfdSA.jpeg" /></figure><h4>A capstone project for Data Scientist Nanodegree</h4><h3>Definition</h3><p><strong>Project Overview</strong></p><p>Going to university is seen as one of the best ways to have a successful life and many parents and students plan for this grand adventure from an early age. The decision to attend university is one that is weighed carefully due to the costs ,time and effort resources that have to be put to achieve a successful outcome — graduation. Any hindrances to graduation can leave students in debt and without the degree many feel is essential to starting a successful career.</p><p>In the project, I will explore the college scorecard data set and look to understand the factors that affect graduation rate.</p><p><strong>Problem statement</strong></p><p>The goal of the project is to determine the university level factors that predict and affect graduation rate at American universities using the College Scorecard dataset.</p><p>In this dataset, graduation rates are only reported for cohorts of full-time, first-time students, so graduation rate information is not available for students who may have previous higher education experience or for part-time students. Another limitation is that outcomes are not recorded for students who transfer from the institution. Therefore I will be focusing on the completion rates for first-time,full-time students at four year institutions and less than four year institutions.</p><p>The data used in this project is from the College Scorecard project and is designed to increase transparency, putting the power in the hands of students and families to compare how well individual post secondary institutions are preparing their students to be successful. The project provides data to help students and families compare college costs and outcomes as they weigh the trade offs of different colleges, accounting for their own needs and educational goals.¹</p><p>The following tasks will be performed:</p><ol><li>Investigate and process the data</li><li>Evaluate 3 regression algorithms and select the best model that predicts the graudation rate,</li><li>Select the most important features from the best performing model.</li></ol><p><strong>Metrics</strong></p><p>The <em>quality</em> of a regression model is how well its predictions match up against actual values and <strong>error metrics </strong>are used to judge the quality of a model and enable us to compare regressions against other regressions with different parameters²</p><p>To Evaluate the 3 regression algorithms mentioned above, I will be using the Root Mean square error. The mean square error (MSE) calculates the residual for every data point, squares the differences and summing them all.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/712/1*jsP9PWYcPN30vs4PkLNprg.png" /></figure><p>The Root mean squared error<strong> (</strong>RMSE) is the square root of the MSE. Because the MSE is squared, its units do not match that of the original output. I prefer to use RMSE to convert the error metric back into units used for the graduation rates, making interpretation easier.</p><h3>Analysis</h3><p><strong>Data Exploration</strong></p><p>The college scorecard dataset contains data from each academic year from 1997 -2017, but I will be using data from the last 10 years. In the documentation accompanying the dataset, there are differences in some of the features reported in previous years.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/885/1*q9W-GksD3qs_37IiAjMHvg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dD57ij4ityXVSeevH_h1xg.png" /><figcaption>merged data years</figcaption></figure><p>The merged dataset consists of 74171 rows and 1899 columns.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LF2OC5AX_QstKIsbwz8NLw.png" /><figcaption>Data set types</figcaption></figure><p>Reviewing the different data types in the dataset , the object columns seemed excessively large and it was clear that a lot of the object columns are actually float or numeric columns but because some values are “Privacy Suppressed” , which is essentially a null value, they have have recorded as object or string columns.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MJUd-jLba_oEnHAHsl6tCg.png" /></figure><p>Checking the object columns above against the data dictionary provided it is clear that most of them are either integer or float.</p><p><strong><em>Notes</em></strong></p><p>I will have to investigate these columns in the pre-processing stage and change all of the “Privacy Suppressed” data to Nan.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BLbYiUPxiCmCRCzm-uudXQ.png" /></figure><p>Furthermore, the float columns are not of a similar scale. There are units of money, number of branches and even interval features like SCH_DEG — which represents the Predominant degree awarded.</p><p><strong><em>Notes</em></strong></p><p>I will have to do some standardisation before I perform any machine learning steps.</p><p><strong>Feature Summary</strong></p><p>The data set contains information grouped into different groups:</p><p><strong><em>Institution</em></strong></p><p>These features provide basic descriptive information about the institution in question. These include: identifiers, location, degree type and profile, programs offered, and the academic profile of students enrolled.</p><p><strong><em>Costs</em></strong></p><p>These features provide Information about the costs to students of an institution. These include: Average Cost of Attendance, Tuition and Fees</p><p><strong><em>Student body</em></strong></p><p>This information describes the demographics of the student body of the institution. These include number of Undergraduate Students and the number of Undergraduate Students by race, gender and age.</p><p><strong><em>Financial Aid &amp; Repayment</em></strong></p><p>These features describe the percentage of students receiving different loans and the debts of students including Percent of Undergraduates receiving Federal Loans, Percentage of Pell Students and Cumulative Median debt.</p><p><strong><em>Earnings</em></strong></p><p>These features provide information on the earning and employments prospects of former students. These include the Mean and Median Earnings of former students.</p><p><strong><em>Completion and Retention</em></strong></p><p>The features provides details about completion and retention rates for each institution. These include the completion rates for completion rates for full-time, first-time students (100 and 150 Percent, and 6- and 8-years after entry)</p><p><strong>For the purposes of this project, I will be using the completion rate as my target variable.</strong></p><p>In this dataset, some features are recorded for academic year institutions and program year institutions separately, for example, average cost of attendance, tuition and fees. Additionally, some features are reported separately for public and private institutions for example, average Net Price for colleges. Finally, some features including our target features completion rate have data recorded separately for four-year institutions and less than four year institutions.</p><p><strong><em>Notes</em></strong></p><p>In the example of completion rate, there were over 20,000 observations for four-year institutions and over 45,000 for less-than four year institutions. Treating this as a singular feature and merging the two features would give a more accurate representation of the missing data because each observation in the dataset is an institution and therefore you could only get one value for each institution either for the four-year institutions or the less-than four year institution</p><p><strong>Data Visualization</strong></p><p>I have so many features and after reviewing the data dictionary, I created groups of interesting features to review and visualise using a correlation map and pairplot.</p><p>One group of interesting features include:</p><p>* Full-time and part students enrolled.<br> * Average net price for the diffrent types of institutions, public, private etc.<br> * Average cost of attendance for program-year institutions and academic year institutions, and number of graduates who receive a pell grant.<br>* Retention rates<br>* Number of students working and not enrolled 10 years after entry in the lowest, middle and highest income percentile<br>* The number of students in diffrent program degrees.</p><p><strong><em>Features Correlation Map</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/976/1*7yOqyx4d62w0zV8vwWQCrA.png" /></figure><p>There appears to be strong correlations between COSTT4_A(Average cost of attendance (academic year institutions)) and NPT4_PUB (average net price) which makes sense!</p><p><strong><em>Pairplot of interesting features</em></strong></p><p>I’ll aslo pick another set of interesting features and visualise with pairplot to see any dependies between them</p><p>cols_plot = [‘COSTT4_A’,’PCTPELL’,’RET_FT4&#39;,’SCH_DEG’,’SAT_AVG_ALL’]</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dKHKN-RqqCnNreUim8DvzQ.png" /><figcaption>Pairplot of Intresting features</figcaption></figure><p>An interesting observation here is that the overall average sat score increases with the retention rate</p><h3><strong>Methodology</strong></h3><p><strong>Data Preprocessing</strong></p><p>The pre-processing steps I completed can be summarised below matching the headings in my final notebook “capstone_education_final”.</p><ol><li>Merge the completion rate for years institutions and less than 4 year institutions for full-time students. This is my target column</li></ol><p>Firstly, As mentioned previously, there is a need to merge the completion rate for years institutions and less than 4 year institutions for full-time students. The columns will be combined to form a final completion target column because the values are recorded depending on the type of institution, there is a recorded value in either C100_4 (four year institution) or C1004_L4 (less than four year instition) but not for both features.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gdIO4lOmVkKUJf2nA67gKw.png" /><figcaption>Merged completion column</figcaption></figure><p>2. Merge other columns that have collect data form only certain types of data. It is important to join those columns before we review any additional missing data.</p><p>COSTT4_A,COSTT4_P — Average Cost of Attendance, Tuition and Fees for Academic year institutions and program year institutions</p><p>NPT4_PRIV,NPT4_OTHER,NPT4_PUB,NPT4_OTHER — Average Net Price for public colleges,private colleges,program andother academic institutions.</p><p>RET_PTL4 and RET_PT4 — The retention rate for years institutions and less than 4 year institutionsfor part time students</p><p>RET_FTL4 and RET_FT4 — The retention rate for years institutions and less than 4 year institutionsfor full time students</p><p>3. Drop columns with all missing values &amp; which provide no additional information.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mH8GnItZb4U0wVkNaB-lgA.png" /></figure><p>4. Change columns misidentified as object to Int and float and update rows with missing values including the “privacy supressed” rows.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jTaHHyBZwcrVa9nZ9-SfqQ.png" /></figure><p>5. Drop all rows with any missing data</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*S_tdIrg-ibnCHzKeZK2D1g.png" /><figcaption>Dataset shape</figcaption></figure><p>At this point, I have an all numeric dataset without missing values bit I still have a huge number of features,.</p><p><strong>Implementation</strong></p><p>As mentioned above, I still have a large number of features 357 and used PCA as a dimensionality reduction technique.</p><p>Due to the large number of columns that int and misidentified as string/object, I had some challenges trying to scale the data, fitting with dataset without missing values and trying to transform on the clean (no missing dataset).</p><p><strong><em>Dimensionality reduction</em></strong></p><p>I chose 150 components a mid-way point for the features to check the variability of features explained by these number of components.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xQcWYRwHioxrieC24ogVuw.png" /></figure><p>From the figure above, 90 % of the variance is explained by 20 pricincipal components. I’m also interested in explained variance for each principal component.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7C7yG9lnncCuCpnsZPjAJQ.png" /><figcaption>Explained variance per principal component</figcaption></figure><p>The first component explains 86.0 percent and the second 6.1 percent of the total variability of the data. 20 components explain more than 90% of the variance and I will stay along these lines .</p><p>These look very heavily wieghted and might be affected by the lack of scaling. I will introduce scaling in the pipeline for my algorthms.</p><p><strong><em>Algorithms</em></strong></p><p>As I’m at the features for completion rate which is numeric, I will compare three regression algorithms.</p><ul><li>Linear regression</li><li>Random Forest regression</li><li>Gradient Boosting regressor</li></ul><p><em>Split dataset to select target variable</em></p><p>I will use my non-scaled dataset here as I would like to use a pipeline with pca for the algorithms.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ARHKACoRoIFFeKbtDb0xSw.png" /></figure><p><em>Split data into test and training sets</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*g9kvhlxw7Amtj5S4YgXMQQ.png" /></figure><p><strong>Algorthm 1 — Linear regression</strong></p><p>The first algorithm I tested is linear regresssion and i’m going to create a pipeline with scalar, pca and regressor.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*j75Vl9B7yPYwM7EBAdff4Q.png" /></figure><p>I’m going to use Gridsearch to try to find the best parameter for each of the algorithms that I’m testing.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kacSzKpfGgPmyzvksClQyw.png" /></figure><p>Retrieve the best parameters</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GElmdVAGwGk2WFQ56klqrw.png" /></figure><p>Using the best estimator — fit the training data set</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TEJ-QiWWGN3sPSWo8EFXuw.png" /></figure><p>Calculate the training Root means square error (RSME) for the training set</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Puzbr-Q9aMuR7eiMGSoMag.png" /><figcaption>Root means square error</figcaption></figure><p><strong>Algorithm 2 — Random forest regressor</strong></p><p>The second algorithm is the random forest regressor and as before I’m using a scaler and pca.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*s1DGobCowJUSEfQf5h_3pg.png" /></figure><p>Using Gridsearch to find the best parameters for the algorithm</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*APWmARcPz_PQ61TiifnkuQ.png" /></figure><p>Get the best parameters and use the best estimator to fit the training data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DxGJwkw2XcwTHmIWyJPLDA.png" /></figure><p>Calculate the training Root means square error (RSME) for the training set</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kSflfvXIrkzyodSC57Tn2g.png" /></figure><p><strong>Algorithm 3— Gradient Boosting regressor</strong></p><p>The third algorithm is the Gradient boosting regressor and as before I’m using a scaler and pca.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3dhwlHNf8KLBNtoEnWKvtg.png" /></figure><p>Using Gridsearch to find the best parameters for the algorithm</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-sRcG5T0ab0H9hpXqL70CQ.png" /></figure><p>Get the best parameters and use the best estimator to fit the training data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*quLM4oiDCFKVBC1nFQI_gA.png" /></figure><p><strong>Refinement</strong></p><p>Running with PCA with 3 options (10, 20,150) was taking a very long time and in review of variability, 20 PCA components explained most of the variance,so I decided to reduce to two PCA options. With 150 components, I was able to see more of the features that could affect the level of prediction but there was a decreasing signficance after 10 features.</p><h3>Results</h3><p><strong>Model Evaluation and Validation</strong></p><p>The Liner regression test prediction: 0:12</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kMb6HkkQGMDjFl3KDT-OCg.png" /><figcaption>Linear regression</figcaption></figure><p>The random forest test prediction : 0:12</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pmTFUEf3EdqCQIZAWFlxgg.png" /><figcaption>Random forest Regressor — Test validation</figcaption></figure><p>The Gradient boosting regressor : 0.10</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZGPiNSIoRnIdbzCfdmoNvg.png" /><figcaption>Gradient Boosting Algorithm — Test validation</figcaption></figure><p>Based on the models I evaluated, the best results were Gradient boosting regressor which had a RSME score of 0.10 on the test data set. This means there is an error of about 10% or 0.10 between our predicted completion rate and the actual completion rate.</p><p>However, the main purpose of the project was not to predict the completion rate but to find the features which most contributed to a completion rate. I will get this features by extracting the important features which most contributed to the accuracy of the model.</p><p><strong>Justification</strong></p><p>The features selected by all three algorithms are quite similar but with different importances. I will look at the highest 6 features for the gradient boosting regressor as it was the best performing algorithm</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PWNWQ8WgQInOLgna9DQhQw.png" /></figure><p>NUMBRANCH: Number of branches for each institutions.</p><p>PCIP01 — Percentage of degrees awarded in Agriculture Operations And Related Sciences.</p><p>MAIN: main campus</p><p>SCH_DEG: Predominant degree awarded (recoded 0s and 4s)</p><p>PCIP11:Percentage of degrees awarded in Computer And Information SciencesAnd Support Services.</p><p>PCIP04 : Percentage of degrees awarded in Architecture And Related Services.</p><p>PCIP14: Percentage of degrees awarded in Engineering.</p><p>Looking at these features, it appears the most important feature that contributes to completion rate is the number of branches, followed by percentage of degrees awarded in Agriculture, operations and related sciences.</p><p>The Main campus feature also comes up here and I can see how being at the main campus surrounded can be advantageous to a completion rate as opposed to long distance or secondary campus that may not have the same support facilities at the main campus.</p><p>Finally, the completion rate is affected by the percentage of degrees awarded for Architecture, Engineering and computing. These are degrees usually taken by the higher performing students and I can see how institutions with a higher percetange of these students who have a good completion rate.</p><p>Conclusion</p><p><strong>Reflection</strong></p><p>The purpose of the project was to determine what features affected graduation rates and my approach was to test multiple machine learning algorithms models to predict the graduation rate, select the best model based on a selected d error metric and retrieve the most important features used by the best model. These features would be the factors I believe mostly affect the graduation rates.</p><p>The data pre-processing took a huge portion of my time as I tried to understand the data set and this was really the most challenging piece. Additionally, trying to decide what features to keep and drop was challenging with so many features as I worried I would be losing good features that predicted my target varibale — completion rate.</p><p><strong>Improvement</strong></p><p>I think the missing data could be investigated instead of dropping them all, as more observations generally help machine learning models to be better at predicting.</p><p>Addtionally, It would be interesting to try other dimensionality reduction methods and compare with PCA to determine which had the better performace and contributed more to a better model.</p><p>Furthermore, I would perform even more feature engineering and selection as I believe this could have an impact on the outcome.</p><p><strong>References</strong></p><p>¹ <a href="https://collegescorecard.ed.gov/assets/FullDataDocumentation.pdf">https://collegescorecard.ed.gov/assets/FullDataDocumentation.pdf</a></p><p>² <a href="https://www.dataquest.io/blog/understanding-regression-error-metrics/">https://www.dataquest.io/blog/understanding-regression-error-metrics/</a></p><ul><li><a href="https://www.ritchieng.com/machine-learning-evaluate-linear-regression-model/">Evaluating a Linear Regression Model</a></li><li><a href="https://www.kaggle.com/eliekawerk/regression-to-predict-house-prices#2.-Reading-the-Datasets-and-Exploring-their-Structures">Regression to Predict House Prices</a></li></ul><p><strong>Licensing and Acknowledments</strong></p><p>All rights for the image used above belong to <a href="https://www.mdcacademy.org/event/class-2019-graduation/">https://www.mdcacademy.org/event/class-2019-graduation/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b06f39d7ab2a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Exploratory Data Analysis with R]]></title>
            <link>https://medium.com/@tobikasali/exploratory-data-analysis-with-r-f0b0a5163ecd?source=rss-c5f5608b001c------2</link>
            <guid isPermaLink="false">https://medium.com/p/f0b0a5163ecd</guid>
            <category><![CDATA[udacity]]></category>
            <category><![CDATA[tennis]]></category>
            <category><![CDATA[data-analysis]]></category>
            <dc:creator><![CDATA[Tobenson]]></dc:creator>
            <pubDate>Sun, 17 Feb 2019 17:17:40 GMT</pubDate>
            <atom:updated>2019-02-17T17:30:47.196Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kwXTK0qDf2pUGkWBFruFqw.jpeg" /><figcaption>It gets better with Age!</figcaption></figure><p>ATP Tour 2012</p><h3>Abstract</h3><p>Tennis is one of my favorite sports and although I’m not the player I wish I was, I do watch a lot of tennis. Roger Federer is my favorite player and he’s had a big resurgence tin 2017 which has got people wondering — Has he changed his game? What is he doing differently? I had been on Kaggle and seen the ATP dataset and I thought I’ll use this for my project. I picked the data from 2012 because I wanted one far enough for me to have forgotten what actually happened in that season. So who won the most matches that year? What are the factors that influence players winning matches? This report explores a dataset containing results for Tennis players on the ATP tour in 2012.</p><h3>Dataset</h3><h4>Summary of the Dataset</h4><p>The dataset consists of 49 variables with about 3025 observations. Each observation represents matches played on the ATP Tennis Tour in 2012.</p><p>As each oberservation is a match, most variables come in twos; one for the winner and one for the loser. This is why there are 49 variables but actually 30 distinct variables with 19 variables with are doubled.</p><p>The singular variables are:</p><ul><li>torunament name, surface, tournament_id, draw_size, tournament_level,tournament_datematch_num, best_of, round, minutes, and score.</li></ul><p>The duplcated variables are:(prefixed with winner/w or loser/l)</p><ul><li>id, seed,entry,name,hand, ht, ioc,age,rank,rank_points,ace,df,svpt,df,svpt,1st1n,2ndIn, 1stWon,2ndWon, SvGms,bpSaved,bpFaced and ace.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/990/1*pJ2Gn0Mb3QDJW11gA0HfIQ.png" /><figcaption>Summary of Dataset</figcaption></figure><p>As previously noted, each observarion is a match between two players. My first interest is the number of wins for each player which is not a variable! However, I should be able to get that from the winner_name column.</p><h4>Player Wins — Who won the most matches in 2012?</h4><p>There are at least 305 match winners so the x-axis is a bit over crowded.I’ll look at a summary of the winner_name column and use that to subset players.</p><p>Running summary on the winner column gives me the counts(wins) for each player however, it doesn’t display median or quantile values. I’ll create a dataframe with the players and count the number of wins so i can have a better look at the distribution of data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*VcwDPjo-4GlSBZzL460zRA.png" /><figcaption>Player wins dataframe</figcaption></figure><p>Looking at the summary of wins, we have a median of 3 and an average of 9 wins per player. 75% of the players have 13 wins or less. if I ordered the data and it would be a very long tail.</p><p>25% of players or lower had only one win and I will start by plotting with player with over 3 wins which is the median.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/932/1*QuXJQhT0P-4YX-1YDuvXWg.png" /></figure><p>Looking at the peaks in this graph, you can see that a few players have a large number of wins. It’s a bit difficult to scan along the lines and pick out the highest peaks. I think flipping the same data on the side and ordering with the highest number of wins first might help. I’ll also decrease the sample of data so we can see the highest winners more clearly. I’ll look at players with more than the average number of wins.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/994/1*Zh0HP-sFrxzGbIG_kSWB0A.png" /><figcaption>Highest number of wins — players</figcaption></figure><p>The players with the highest number of wins are clearer to see this way. The players with the top 10 wins from 2012 are:</p><ol><li>David Ferrer</li><li>Novak Djokovic</li><li>Roger Federer</li><li>J.M Del Potro</li><li>Tomas Berdych</li><li>Nicolas Almagro</li><li>Andy Murray</li><li>JW Tsonga</li><li>Janko Tioservic</li><li>Milos Raonic</li></ol><h4>Observations</h4><p>David Ferrer won the highest number of matches and Rafa Nadal is missing from the top 10 wins. These two unexpected results could be down to the number of matches played — David Ferrer might have played far more matches than everyone else. I’ll have a look at the number of macthes played and also check the number of wins per matches played.</p><h4>Win Ratio — Is the number of wins just down to the number of matches played?</h4><p>The win to matches played ratio might shed a better light on who wins most of the matches they play.</p><p>Again, there’s no column for this so I’ll have to make one. I’ll need to count the player names from both the winner_name and loser_name columns to get the total number of matches.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CNLkvfPxmkLB49nRA6walw.png" /><figcaption>Player win ratio</figcaption></figure><h4>Observations</h4><p>Using the win ratio(for players with more than 13 wins), the data looks more normalised than before. I used the number of wins as the label so the win ratio could easily be seen in comparison to the number of wins.We can see that although David Ferrer has a high win ratio, he didn’t have the best, with Novak Djovokic, Roger Federer and Rafa Nadal having higher win ratios. I wondered about Rafa Nadal when he ddin’t appear in the top 10 wins but his win ratio was second best!</p><p>To the left is Jerzy Janwoicz, who has a higher win ratio than some of the guys with the top 10 wins : Tomas Berdych and Nicolas Almagro even though they had more wins.</p><p>Is the win ratio a better judge of the ability of a player to win matches than the number of wins? Or is slighlty affected by number of matches played? Next, I’ll take a look at who had the most tournament wins, will it be players with the most wins or players with the highest win ratio?</p><h4>Tournement Wins</h4><p>There’s actually no variable in the dataset showing who won torunaments but we have rounds which show the final round and the winner of the final round will be the tournament winner.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/964/1*Dpv01sqL09u2Uq68lbzkSA.png" /><figcaption>Tournament Wins</figcaption></figure><h4>Observations</h4><ol><li>David Ferrer won the most tournaments — 7 (and he also had the highest number of wins)</li><li>Roger Federer and Novak Djokovic came in tied second place, with Juan Monaco,JM Del Potro and Rafa Nadal on 4 each.</li></ol><p>It appears that the the number of matches won correspinds largely win the number of Tournament wins. This is also true with the win ratio. The 5 players with the highest win ratio were also among the top 7 players with the highest number of tournaments wins. However, with Rafa Nadal winning 4 tournaments having played fewer matches suggests that win ratio might be a better <em>suggestion</em> of who would win more tournaments. Also here is Juan Monaco — who isn’t in the top 10 wins or the top ten win_ratio, yet he won 4 tournaments.</p><h4>Tournament wins — Juan Monaco — Where ?</h4><p>The tours_win dataset has surface and tournel_level variables which show the type of surface the tournament was won on and the level of tournament.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VW_084dBNGBtzET9sqrP8g.png" /><figcaption>Tournament winners by surface</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LGsasTdIH0bIuBeBe-MPhA.png" /><figcaption>Tournament winners by Tournament Type</figcaption></figure><h4>Observations</h4><p>Juan Monaco won all his tournaments at the A Tour level and also won 3 of his 4 tournaments on Clay. I can also see Rafa Nadal only won tournaments on Clay. Novak Djokovic also won all of his 6 titles on Hard Courts. D. Ferrer, Roger Federer were the only players to win across all surfaces. It’s still not too apparent why Juan Monaco was able to win that many tournaments, without being in the top 10 of wins and win_ratio but it would appear that some players do seem to perform very well on particular surfaces. What were the percentage wins of these players on the various surfaces?</p><h4>Players win ratio per surface for the tournament winners</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uudNFiR4uHB61ObLL416jA.png" /><figcaption>Percentage of wins per surface</figcaption></figure><p>This shows the percentage of the total wins that each player had per surface. So for example, 55% of rafa Nadal’s wins came on Clay and 67% of Novak Djovokic’s win came on clay. We can see some players like Nicolas Amalgro, Tomas Belluci and Juan Monaco having a large perctange of their wins on clay. Also, Sam Querrey, Jurgen Melzer, Alexander Dolgpolov had a large percentage of thier wins of Hard. This does show that some players tend to win more on particular surfaces. However, they could also have played more matches on these surfaces because they preferred it. I would like to see thier win_ratio per surface i.e For the number of matches they played on each surface, what was thier win_ratio?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/977/1*ws050nyBbvl-4hwtbFwjqg.png" /><figcaption>Win ratio per surface</figcaption></figure><h4>Observations</h4><p>OK…This looks more like what I wanted to see for the tournament winners. The y axis has high percentage range beacuse it’s showing the win ratio per 3 surfaces so that’s a 300% max value. Rafa Nadal with 4 Clay tournaments won 96% percent of all matches he played on Clay. Novak Djovokic won 91% of matches he played on Hard courts. Roger Federer had high percentages across all surfaces as did David Ferrer. Juan Monaco with 78% — not a lot players with higher win ratios on clay — won more tournaments on clay than Tomas Berdych, Roger Federer and Novak Djokovic who all had higher win_ratios on the surface. Novak and Roger’s high win_ratio on Hard, did translate to the highest tournament wins on the surface respectively.</p><p>There are some players like Tomas Berdych who had high win ratios on Clay or Hard for instance but didn’t quite translate to Tournament wins? Rafa Nadal also had a high win ratio on Hard Court, only behind Roger and Novak, yet he didn’t win any Hard court tournaments. These players might have been getting to a lot of finals or semi-finals but not actually winning the tournament.</p><h4>Dataset Update</h4><p>I’ll add tournament_wins for each player to the merged_count_wins so I can build a new dataframe of variables to test correlations with.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/956/1*B572o8e8_ZV5Jy-5uuwhfQ.png" /></figure><p>Now that that’s complete, I’ll like to take a quick look at wins across the different levels of tournament.</p><h4>Tournament Types</h4><p>The ATP tour website describes these torunament level types:</p><ul><li>C- Challenger — 2nd Tier</li><li>A — ATP Tour level — 1st Tier (Ranking points depends draw size: 500 or 250 points)</li><li>D — Davis Cup — International Country competition</li><li>F — Futures — Third and 4th Tier of Tennis</li><li>G — Grandslam — 1st Tier (Most Prestigious — Winner 2000)</li><li>M — Masters — 1st Tier (2nd Most Prestigious — Winner 1000 points)</li></ul><p>So let’s look at the Tournement_level variable.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1010/1*1S-kOyF9K1A9VOvlSqRUWQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/965/1*mM4hEwaL_W_nVficOrBzgA.png" /><figcaption>Wins per tournament</figcaption></figure><h4>Observations</h4><p>I subsetted the data to only look at players who had more than 5 wins on the Tour that year and I noticed a few things:</p><ol><li>Most players on Tour have a lot of thier wins at the ATP Tournament Level with close to 70% of these players having wins only at that level. Although it’s not surprisng that most players have more wins at this level, I didn’t quite expect that quite so many would have wins only at this level.</li><li>Players with higher number of wins, have a good mix of Masters and Grandslam wins.</li></ol><h4>Player seeds</h4><p>Next, I’d like to look at it winner_seed. This shows the seed (rank for tournament) of the winner who won the matches.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/948/1*ZUnJjMG3-_O2aIQB7KZocA.png" /></figure><p>Looking at this summary, I was a bit thrown for a moment at the large number of NA’s. However, A seed is different from a ranking and there are about a 1/4 seeds per draw size. So drawsize 128 would have 32 seeds, drawsize 96 would have 16 seeds and so on.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/971/1*bKGNqPy6keFeK-jNOKKXWw.png" /><figcaption>Winners by seed</figcaption></figure><p>This distribution is skewed to the right…There are far more winners who are seeded in from 1–8. With Most matches being won by the player seeded Number one for the tournament. In sum, higher seeded players win more matches than lower ranked seed players. Quel (not) Surprise! What about for tournaments? Are seeds more likely to win tournaments?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/999/1*nJbwqB8abDMEjjn-wvKCbw.png" /></figure><p>Wow!,In 2012 seeds were more likely to win especially if you were ranked 1–8!. Only 6 tournaments were won by Unseeded players and I bet they were all ATP — A level tournaments as well!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JbdBUBTfqiQbsr1XDsvbtA.png" /></figure><h4>Observations</h4><p>Yes, all the tournaments won by unseeded players were ATP level A general tournaments. For the Masters and Grandslams,the seeds ranked 1–4 won all the tournaments at that level. That’s some consistency!</p><p>On the ATP tour in 2012, Seeded players were most likely to win tournaments.</p><h4>Summary Observations</h4><p>So far, I’ve looked at the number of wins and the win ratio for the players. I noticed that the win_ratio was likely a better determinant of the ability of a player to win matches as it showed the number of wins per matches played. Also, the players with the most wins and highest win ratio won the most number of tournaments.</p><p>Also, some players did very well on certain surfaces having a very high win ratio on those surfaces and in most cases that translated to toruanment wins; However, players did also have high win ratios on certain surfaces with no tournaments wins to show.</p><p>One of the most interesting observations was that most players with 5 wins and above only won matches at the ATP level. I expetced there to be a better distribution of wins across tournament types. It seemed that a few players were winning most matches at the higher tournament levels. This was more noticeable in the number of tournaments won by seeded players at the higher tournaments levels. Unseeded players won only ATP level tournaments.</p><h3>Match Winners and Losers</h3><p>It’s time to look at variables that involve both the winners and losers of matches. Are there are any variables that stand out or can show the differences between winners and losers?</p><p>First and Second Serve percentage — Is there a difference between Match winners and Losers?</p><p>Variables:</p><ul><li>1stIn — Number of First serves in</li><li>svpt — total serve points</li><li>1stWon — Number of points won on 1st serve</li><li>2ndWon — Number of points won on 2nd serve</li><li>df — number of double faults</li></ul><p>The values for these 4 variables are absolute values and could be skewed depending on how long the match was or how many sets the players had to play. It would be better to calculate the percentage of first serve points won based on the total amount of first serves put in play and the same with the second serve.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/977/1*1_CxUHopX5EORI9S3MIorQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*xkMukIKL5gOm6Dv79pEWLw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/953/1*EaGfPbz1-LOqhnLqTryGrQ.png" /></figure><h4>Observations</h4><p>Looking at the histogram, The first serve percentage points won data appears to be normally distributed for both winners and loser; I plotted the winner and loser first serve percentage on the same graph so it could be easier to see the differences immediately.</p><p>Majority of the first serve percentage points won falls between 60% and 90%. However, we can see that the green colour shades more to the left showing that there are more values of green to the left which indicates a lower percentage of points won on the first serve by players that lose. Also, the pinkish colour shades more the right, with all winners of matches having 50% or higher first serve percentage.</p><p>The box plot shows that the median for the first serve perctentage points won for match winners is almost 10 points higer than those of match losers. Also, concentration of values for the top 25% shows a bigger number for the winners than losers. On average, winners have higher first percentage points won.</p><p><strong>First serve percentage points — Match wins</strong></p><p>The high_fsperc_won is a new dataframe with 1st serve percentage points won for both winners and losers. Each observation is a match and I checked who had the higher 1st serve percentage points won in the match. I then recoreded whether it was the winner or loser of the match in the player type column.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*TMbwUv64bKp-zDhxXPPy4A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pu8Cdwi3AcF9vgJ44NrVyw.png" /></figure><p><strong>Observations</strong></p><p>The bar graph shows that a player is 4 times as likely to win a match when they have a higher first serve percentage. Of the matches played, over 2500 were won by players with a higher first serve percentage points won.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/973/1*mWheRGCpbx81y6yClr0Tbg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ICyrm5jC0kGR3VedEdOj2Q.png" /></figure><h4>Observations</h4><p>The median for the second serve percentage won for winners is almost 10 points higher than that for the losers. Also, the histogram shows the winner — shaded pink — with more values to the right of histogram indicating that players who won matches had won more points on thier second serve. The average and median of all second serve perctange points won are 56.16 and 56.25 respectively, looking at the box plot, majority of the match winners had higher values higher than this.</p><p>In Tennis Matches, players get a two chances to serve for each point. You only get a second serve if you miss the first. If the serving player missed the second serve, the opposing player is automatically awarded a point. Players usually have very fast and powerful first serves making it harder for the opposing player to return it the serve.Also, players take more risks because they know they have a another chance. On the second serve however, if you lose it, you know that the oppsoing player will win the point, so player take less risk and the serve is therefor slower and less powerful. This gives the opposing player a better chance to attack the serve and win more points of it.</p><p>This is most likely the reason why we have this large difference in 2nd serve percentage points won between winners and losers. The players who are able to win more points on thier (weaker) second serves win more matches.</p><p><strong>Second Serve Percenatage — Match Wins</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/983/1*nVxX5WNNQVaXBJhKg7YPyg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ndeIwzQf7T9IXVP88kKorw.png" /></figure><p>Again, it can be seen here that when a player has a higher second server percentage points won, he/she was more likely to win the match — almost 4 times as likely!</p><h4>Break Points</h4><p>Break points faced</p><p>Break point faced shows the amount of opportunities the opponent had to break serve. Each time a player wins a service game (on serve i.e the player is serving) they get awared a point,if the opposing player wins ie. breaks hte opposing player’s serve), the point is added to them isntead.</p><p>The variables are:</p><ul><li>bpSaved = break point saved</li><li>bpFaced = break point faced</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/974/1*eh7eICJM8IZpJuauCvo1LA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/961/1*9GYyN5c-UfGrKTHcJLlj3Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8kKOhYwOJNSUCRXDCQUePA.png" /></figure><p><strong>Observations</strong></p><p>The green shade for losers does edge to the right indicating a higher number of opportunities presented to the opponent to the break the serve. The histogram for winners edges closer to the left and we can see that players who won matches generally faced less break points.</p><p>The median for break points faced by winner is 4 while those for losers is about 8.75% or less of the winners face 7 breakpoints or less which is just slightly more than the median and mean of all the players.This definately makes sense because the less opportunitues your opponent has of breaking your serve, the less likely he is to break them. And if he/she can’t break your serve, it tougher for them to beat you.</p><p>It would be interesing to the relationship between winners and percentage of break points saved.</p><p><strong>Percentage break points saved</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/934/1*_aJ4fa7cE7mZlTIuxmEcog.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/963/1*iyY5akk-s_9jzJvMkJby6g.png" /></figure><p><strong>Observations</strong></p><p>I expected a clearer distinction between winners and losers in general. However, one thing that was clear though was that, far more winners saved 100% of break points that they faced; at least over 500 winners. Again, if a player saves all the break points that they face, then they are very unlikely to lose the matches. Those who saved 100% break points and lost thier matches would have done so in tie-breaks.</p><p><strong>Summary Correlations</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/971/1*b8nlmSMfePiZsuRXYiKL9w.png" /><figcaption>Correlation plot</figcaption></figure><h4>Three Final Plots</h4><p>In the sections above, I tried to work through the different variables to find those which those which could show me interesting patterns about the winners(and losers) on Tour in 2012. I’ll choose the 3 which I think were most interesting (and surprising) to me.</p><p><strong>Ratio of Wins to Matches</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/946/1*SKHDunpbPp4TWgdmVyGMjQ.png" /></figure><p>I include this plot because it was plot that first showed the differences between match wins and win ratio. It also got me wondering how players did across different surfaces and how that might affect thier tournament wins.</p><p><strong>Win ratio for Tournament winners by surface.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*16MkXmIahfgU-J3W6JB9wQ.png" /></figure><p>This plot goes further to show the percentage of wins on each surface for players who won the most tournaments. It helped explain why some players like Djokovic with 91% win on Hard court, won more hard court tornaments than anyone else — the same with Rafa Nadal on Clay but it also raised a some questions — Some players with High win ratio on certain surfaces didn’t win any tournaments on those surfaces.</p><p><strong>Percentage points won on first server by winners and losers.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/990/1*lb76deTeWbl4Bh7261GD5w.png" /></figure><p>Although, I started out looking at winners of matches across the season, looking at vairables that show what causes players to win individual matches proved to be very interesting.I really wanted to put the first and second server perctentage plots togther here but I had to go with one and I went with the first serve percentage. There was a clear distinction showing that most winners of matches had 50% or higher first serve percentage.</p><h3>Reflections</h3><h4>Issues</h4><p>Due to the high number of number of players and variables; it was very difficult to use ggpairs to look at correlations and I spent a lot time investigating and then discarding certian variables. I also had to do a lot of data manipulations because the data was not always in the format that I needed.</p><p>Additionally, when I started out, I thought I might be able to get a model to predict the winners of matches, but I didn’t think I had enough winner or loser data; I would have liked to have a breakdown how points where won : forehand winners, backhand winners , unforced errors etc for winners and losers. Furthermore, With the dataset I had, it was very different to the way the price prediction on the course worked; and I would need to predict who would win matches againts other players! Therefore each player would need some sort of score based on the model to predict thier ability to not only win matches but beat the other player.</p><p>I think I would need more data and more knowledge of Modelling with Categorical variables to create a model.</p><p><strong>Conclusion</strong></p><p>Starting out with this data from the ATP Tour in 2012, I was interested in discovering what really influenced players winning matches. A number of things stood out to me. Firstly, the amount of tournaments won my seeds especially at the Masters and Grandslam levels. These tournaments are very difficult to win and while it may make sense that the better players should naturally win these tournaments, the fact that it’s tough to win means the same players usually can’t win most of them. In 2012, however, The top 4 seeds won most of the Granslams and Masters and these were actually the same group of players. Being Seeded especially 1–4, meant a player was very likely to win matches and tournaments.</p><p>Secondly, In comparing winners and losers per match — it was clear that having a higher percentage points won on the first serve meant the player was more than 4 times likely to win the match. In this case, it’s not just having a high value — over 50% in general.</p><p>Lastly, there were some players with high win_ratios per surface who didn’t quite turn those into tournament wins. They appears to be some intagibles here that are not recorded that could be influencing the inability to cross the final Hurdle — Mental Toughness ? Experience?. I would be interested in expoloring this dataset further.</p><p>Note: I claim no ownership to the images used above and the image was downloaded from nytimes.com and credited to Thomas Peter/Reuters.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f0b0a5163ecd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Decisions, Decisions Decisions!]]></title>
            <link>https://medium.com/@tobikasali/decisions-decisions-decisions-24acd05d4585?source=rss-c5f5608b001c------2</link>
            <guid isPermaLink="false">https://medium.com/p/24acd05d4585</guid>
            <dc:creator><![CDATA[Tobenson]]></dc:creator>
            <pubDate>Thu, 17 Jan 2019 01:34:42 GMT</pubDate>
            <atom:updated>2019-01-18T13:38:37.354Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jNm6oxmMZI_hLbW-9b8umw.jpeg" /><figcaption>This will be the best AirBnB listing, ever!</figcaption></figure><h3>A Data science project Investigating AirBnB data.</h3><p><strong>Introduction</strong></p><p>I have couple of friends who had two very different reasons to be interested in AirBnB. <strong>Tony is considering buying a property and making a listing on the AirBnB website</strong> while <strong>Pepper is looking for a great fit for a planned holiday.</strong> Being such a good friend, I thought it would be a good idea to have a look at the data and try to find out some information from the datasets that would help my friends.</p><p>There are two datasets for Boston and Seattle which contain information about 3800 listings in Seattle and about 3600 listings in Boston. Some of the information includes price, the number of bedrooms, number of bathrooms and locations of the listings.</p><p>To help out my friends, I’ll ask 3 questions.</p><p><strong><em>Question 1 — What locations have the highest price homes in Seattle?</em></strong></p><p>This was not as easy as I thought it would be. I couldn’t just take the highest prices as the prices would differ depending on the number of rooms, number of persons etc. Therefore, for each listing, I decided to get the prices per room and prices per person and find the average for each zipcode. This way, we could see what zipcode on average had the highest earning homes in Seattle.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ePPdfusoThNXTdVHM1Ctvg.png" /><figcaption>Average highest priced listings</figcaption></figure><p>Based on the data and looking at this map, the highest earning homes per person are located downtown along the water front in Seattle. I can see a water front park which has a lot of attractions.</p><p><strong>Note to Tony </strong>: Having your listing in an area with attractions people will enable you to set a good price. If it’s in Seattle, it should be downtown.</p><p><strong>Note to Pepper</strong>: If you’re looking for a place with a location that’s close to the attractions and water front, go downtown. It will make a dent in your pocket though.</p><p><strong><em>Question 2 — What do the different types of properties earn on Average ? Compare rates between Seattle and Boston.</em></strong></p><p>Now that we know that it would beneficial to have a listing near attractions in the city of choice, I’d like to know what the different property types earn. Again, I’d look at the average prices per person and per room for each property type.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BIdk4GXLyISBtVqcIC5xvw.png" /><figcaption>Prices per person for each property type</figcaption></figure><p>There’s an ‘Other’ Column which has the highest prices per person but we don’t know what they are! Focusing on the property types that we do have, there’s doesn’t seem to be a lot of differences in price for the different property types. However, For most of them, Boston is more expensive than Seattle. This difference is especially pronounced when it comes to Dorm rooms.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1017/1*zCPWspe8k6_oukVErDVZYQ.png" /><figcaption>Prices per room for each property type</figcaption></figure><p>We can see a similar trend in the prices per room as Boston is more expensive that Seattle for all property types that they both have. There are some property types that exist in once city but not the other. For example, Bungalows, Cabins or Chalets, tents or Treehouses only exist in Seattle while you have Villas and Guesthouses in Boston. Seattle certainly seems to have more diverse property types.</p><p><strong>Note to Tony : </strong>Listings in Boston earn higher for every property type except boats when priced per person. I know you like boats, but don’t buy a boat in Boston! A condominium or an Apartment will be fine.</p><p><strong>Note to Pepper </strong>: For camping in the woods and also taking in some city attractions, Seattle AirBnB listings will cater to both needs and they’re cheaper too.</p><p><strong><em>Question 3 — What are the factors that mostly affect AirBnB prices?</em></strong></p><p>This is a much tougher question to answer and I used a machine learning algorithm to get a model that could predict prices. The accuracy was wasn’t great — It was 54% on the test data. This means that the algorithm able to predict the price correctly over half the times. However, I was able to get extract the top 5 features that contribute to price and they are shown below.</p><pre>bathrooms<br>review_scores_location<br>room_type_Private room<br>room_type_Shared room<br>cancellation_policy_strict<br></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/922/1*mJtb3pm9LjSJuFwpFP7S6Q.png" /><figcaption>Correlation Matrix</figcaption></figure><p>Looking at<strong> the correlation matrix of the top 5 features with price, above </strong>you can see that the <strong>number of bathrooms</strong> is the most strongly correlated with the price, followed by the<strong> cancellation_policy_strict</strong> and <strong>review_scores_location</strong>. This<strong> </strong>resonates with me because private bathrooms in apartment shares always make a difference in the price. Also, <strong>cancellation_policy_strict </strong>is<strong> </strong>a feature that describes how strict the cancellation policy is. Other options were <strong>cancellation_policy_moderate. </strong>With like hotels, the stricter the cancellation policy the higher the price and vice-versa so I can understand how this feature has an impact on the price.</p><p>The <strong>review_scores_location </strong>refers to the reviews that were given for the listing about the location. We saw previously that the highest average prices were at the waterfront downtown and if excellent locations like that have great reviews, then it clear to see the how they could determine price.</p><p>Finally<strong>, </strong>the <strong>room_type_Private room </strong>and <strong>room_type_Shared room </strong>features show that price is heavily dependent on the types of room either private or shared.</p><p><strong>Note to Tony: </strong>In Considering the type of property for your listing<strong>,</strong>the number of bathrooms and type of room will be important. We already know how important the location is, however, the cancellation policy as well will be an important factor to consider.</p><p><strong>Note to Pepper: </strong>Thinking about the budget for your holiday, you should consider what kind of cancellation policy would be best for you as this will affect the price. Also, are you will to share bathrooms or rooms? Decisions, Decisions, Decisions!</p><p><strong>Conclusion</strong></p><p>Looking at the AirbnB datasets for Seattle and Boston, my report to Tony and Pepper are as follows:</p><ol><li>It appears that listings in Seattle near the waterfront with a number of attractions are rented out at higher prices. Think about this when choosing a property to purchase(Tony) or a place to rent (Pepper).</li><li>Boston though has higher prices in every property type.</li><li>The number of bathrooms, room type and cancellation are very important when considering setting property_prices and …</li></ol><p>It’s time to decide!</p><p>Another friend Friday, helped a lot with this analysis to see more details, the link to my Github is available <a href="https://github.com/tobikasali/Create-a-blog-post/blob/master/airbnb_final.ipynb">here</a></p><p><em>Note</em>: Marvel Inc owns all rights to the image used above.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=24acd05d4585" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Don’t look back in Anger]]></title>
            <link>https://medium.com/@tobikasali/dont-look-back-in-anger-e5ce26bbc5f?source=rss-c5f5608b001c------2</link>
            <guid isPermaLink="false">https://medium.com/p/e5ce26bbc5f</guid>
            <category><![CDATA[reflections]]></category>
            <category><![CDATA[christianity]]></category>
            <dc:creator><![CDATA[Tobenson]]></dc:creator>
            <pubDate>Sun, 13 Jan 2019 02:21:10 GMT</pubDate>
            <atom:updated>2019-01-13T02:21:10.915Z</atom:updated>
            <content:encoded><![CDATA[<p>Don’t look back in Anger</p><p>David had just fled from the Saul and the bible records that “All those who were in distress or in debt or discontented gathered around him, and he became their commander. About four hundred men were with him.”</p><p>We join the story here in 1 Sam 23:</p><p><em>1 When David was told, “Look, the Philistines are fighting against Keilah and are looting the threshing floors,” 2 he inquired of the Lord, saying, “Shall I go and attack these Philistines?”</em></p><p><em>The Lord answered him, “Go, attack the Philistines and save Keilah.”</em></p><p><em>3 But David’s men said to him, “Here in Judah we are afraid. How much more, then, if we go to Keilah against the Philistine forces!”</em></p><p><em>4 Once again David inquired of the Lord, and the Lord answered him, “Go down to Keilah, for I am going to give the Philistines into your hand.” 5 So David and his men went to Keilah, fought the Philistines and carried off their livestock. He inflicted heavy losses on the Philistines and saved the people of Keilah</em>.</p><p>David asked God if he should go to Keilah and fight against the philistines, The Lord said yes, but his men were scared and rightfully so. Saul was hunting them, they were a hastily assembled unit, untried and untested. Go to Keilah? Why? The guys weren’t up for it and you couldn’t blame them.</p><p>So David asked the Lord again, s<em>hall I go </em>? and the Lord said Yes, Go. David and his men went, defeated the philistines and saved Keilah.</p><p>Things were looking good. Let’s read on:</p><p><strong>7 </strong><em>Saul was told that David had gone to Keilah, and he said, “God has delivered him into my hands, for David has imprisoned himself by entering a town with gates and bars.” </em><strong><em>8 </em></strong><em>And Saul called up all his forces for battle, to go down to Keilah to besiege David and his men.</em></p><p><strong><em>9 </em></strong><em>When David learned that Saul was plotting against him, he said to Abiathar the priest, “Bring the ephod.” </em><strong><em>10 </em></strong><em>David said, “Lord, God of Israel, your servant has heard definitely that Saul plans to come to Keilah and destroy the town on account of me.</em></p><p><strong><em>11 Will the citizens of Keilah surrender me to him? Will Saul come down, as your servant has heard? Lord, God of Israel, tell your servant.”</em></strong></p><p><em>And the Lord said, “</em><strong><em>He will</em></strong><em>.”</em></p><p>You can almost hear the fear and pleading in the David’s voice. This turn of events must have been shocking to him. The men of Keilah whom I just risked my life and the lives of my men to save would hand me over to Saul? No protection, no safe haven ??? He must have expected they would help him somehow.</p><p>David asked the Lord again, just to be sure.</p><p><strong><em>12 </em></strong><em>Again David asked, “</em><strong><em>Will the citizens of Keilah surrender me and my men to Saul?”</em></strong></p><p><em>And the Lord said, “</em><strong><em>They will</em></strong><em>.”</em></p><p>He must have been thinking “Lord, you said it was ok to for me and the men to come here. I asked you twice!! And you said yes! Now, Saul knows where we are and we have nowhere to go.”</p><p>David and his men must have spent their energy, the little resources they had, time to save the city and it seemed like it was a total waste of time and the end result was trouble and exposure to loss. They must have been disappointed and discouraged.</p><p>Are you looking at a business venture that you believe God asked you to start and you have committed time, money and other resources but it appears you’ve gotten nothing out of it? Did you take a new job and you asked the Lord if it was the right decision and he said go ahead and then you got fired? Did you start a ministry and it just didn’t go anywhere?</p><p>Does the whole experience seem like a failed enterprise? Did you suffer loss? Does thinking about it bring pain?</p><p>David was expecting that the city would offer him some refuge after saving them but that didn’t happen, why then did God permit David go to and save the city of Keilah?</p><p>David’s men were a band of misfits and this would be their first battle together. In this adventure to save Keilah, the band of misfits would learn that they were warriors; they would no longer be a group of discontented and distressed men but become men who fought with honour and integrity,protecting the innocent and doing the right thing even though they didn’t get the reward they were expecting. This seemingly thankless adventure would be the making of David’s mighty Men. They would learn they were leaders. This would be the foundation upon which David and his men would go on to win every battle they would face.</p><p>That Business may have failed or be failing, that job may be lost, the attempt at using your gift might have ended in disaster. You didn’t get what you were expecting — financial freedom, promotion, success, leading people to Christ with your gift etc. Does it feel like God called you and then left you hanging? To fend for yourself ?</p><p>God asked you to do it, therefore, It is the foundation of something greater. You have grown and you have learnt. It will stand you in good stead for the future. That adventure will be the foundation of greater accomplishments; bigger and better than you ever imagined.</p><p>God is able to do exceedingly, abundantly more than we can ever ask or imagine.</p><p>Don’t look back in Anger.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e5ce26bbc5f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Have you settled?]]></title>
            <link>https://medium.com/@tobikasali/have-you-settled-6130201e2f0c?source=rss-c5f5608b001c------2</link>
            <guid isPermaLink="false">https://medium.com/p/6130201e2f0c</guid>
            <category><![CDATA[reflections]]></category>
            <category><![CDATA[christianity]]></category>
            <dc:creator><![CDATA[Tobenson]]></dc:creator>
            <pubDate>Sun, 06 Jan 2019 00:59:18 GMT</pubDate>
            <atom:updated>2019-01-06T00:59:18.071Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Genesis 11:31 “ </strong>Terah took his son Abram, his grandson Lot son of Haran, and his daughter-in-law Sarai, the wife of his son Abram, and together they set out from Ur of the Chaldeans to go to Canaan. But when they came to Harran, they settled there.”</p><p>Read it again. Please.</p><p><strong>Genesis 11:31 “ </strong>Terah took his son Abram, his grandson Lot son of Haran, and his daughter-in-law Sarai, the wife of his son Abram, and together they set out from Ur of the Chaldeans to go to Canaan. But when they came to Harran, they settled there.”</p><p>Do you see it?</p><p><strong>Genesis 11:31 </strong>Terah took his son Abram, his grandson Lot son of Haran, and his daughter-in-law Sarai, the wife of his son Abram, and together they set out <em>from Ur of the Chaldeans to go to Canaan</em>. But when they came to Harran, they settled there.</p><p>Now, the Bible doesn’t say that God spoke to Terah and asked him to go to Canaan but isn’t it interesting that he <em>was</em> going to Canaan? The promise land? Why did he settle in Harran?</p><p>Did Terah get to Haran and find it comfortable? Was there good farmland? Accessible wells of water? Good community living? Was it so comfortable that he forgot where he was going in the first place? Or had the initial journey took so long or was so hard, he decided to stop?</p><p>I’ve always wondered why God chose Abraham. Was it by election? — God is Sovereign and He will have Mercy on whom he will have Mercy, or by foreknowledge? — God is Omniscient and He knew Abraham would obey him? Could it have been Terah? Was the difference between Terah and Abraham continuing obedience? Perseverance? The ability to keep going despite failures, setback and even some success? What If Terah hadn’t settled in Haran? What if he had continued to Canaan? Would Terah’s story have had a different ending?</p><p>I don’t know.</p><p>What we do know is that God’s ultimate plan won’t change but if you and I won’t <em>go,</em> He’ll find someone who will.</p><p>Where has God called you to go?What has God called you to do? And where have you settled? What comforts or discomforts have caused you to forget your original destination, caused you to downgrade the dreams you had when you started out on your journey?</p><p>In 2019, Where does God want you to be? What does God want you to do?</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6130201e2f0c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Failures Past, Looking Foward]]></title>
            <link>https://medium.com/@tobikasali/failures-past-looking-foward-cbfff3d1d859?source=rss-c5f5608b001c------2</link>
            <guid isPermaLink="false">https://medium.com/p/cbfff3d1d859</guid>
            <category><![CDATA[reflections]]></category>
            <category><![CDATA[christianity]]></category>
            <dc:creator><![CDATA[Tobenson]]></dc:creator>
            <pubDate>Thu, 27 Dec 2018 05:42:35 GMT</pubDate>
            <atom:updated>2018-12-27T05:42:35.819Z</atom:updated>
            <content:encoded><![CDATA[<p>What is my birthright as a child of God? I believe it is the general position I have as a child of God but also believe it includes the specific gift(s) that God has given me or placed in me — privileges or blessings given to me by virtue of being a child of God, nothing I could ever claim to have worked for. In the book of Genesis, Esau’s birthright was not just a blessing of being the first-born, it was a blessing that provided an opportunity to be a part of God’s plan and fulfill a Godly purpose.</p><p>Why am I going on about birthrights? 2018 was a very difficult year for me and one of my lowest moments was the realization that I had despised my birthright — like Esau. I had always wondered how Esau could exchange his very important birthright; his inheritance, his gift, his opportunity to walk closely with God, for a bowl of soup but I’ve come to realize that I do exactly the same thing.</p><p>What do I exchange for presence of God? Instead of spending time with God, what do I do instead?</p><p>God has given me so many gifts, one of which is revelation through dreams. Over the years, I’ve come to understand that my dreams are very important not only for my life but for the lives of so many people around me. Yet how bothered am I to write them down? Get their interpretations? Sometimes I wake up in the middle of night and I’ve had a dream and I know I should write them so I don’t forget, but I don’t write them down because I’m a light sleeper and I know writing those dreams for 5 minutes could cost me 3 hours of sleep. So I hope I remember them in the morning, exchanging a few hours of sleep for knowledge and revelation that could change my life and the lives of others. Dreams that could be part of God’s purpose and plan not just for myself but also for others. Dreams that could cost and save lives. Esau was hungry, I was sleepy. I’ve always thought, what was he thinking? How could he? I guess the real question is: <em>What am I thinking? How could I?</em></p><p>Why do I take take this gift from God so lightly? What steps have I taken to pursue and develop this gift? Have I sought God to help me with it?</p><p>I don’t have a twin Jacob who is offering me stew for my birthright but am I throwing it away anyhow? What have I lost? How am I paying for this lack of diligence? This carelessness?</p><p>I read a devotional which describes Luke 15 at the lost chapter; That which was lost unwittingly — The Lost sheep, That which was lost carelessly — The Lost coin and that which was lost wilfully — The Lost Son, In all cases, someone went looking. In the parable of the Lost son, sometimes referred to as the prodigal son, the son who had wasted his inheritance came to his senses one day, rose up and went back to his Father, accepting he had done wrong and willing to accept servant hood; relinquishing any inheritance or birthright. However, his father saw him from afar, ran to his son, hugged him and forgave him.</p><p>2018 has been a year filled with failures, not spending time with God as I should, not praying as I should, not spending time with the word as I should, blessings lost carelessly and wilfully due to laziness, disobedience and sin.</p><p>But I have come to my senses and I’m rising up and going back to my Father. For 2019 and beyond, I will appreciate the gift of salvation and the privilege of being a child of God. I will be grateful for the gifts and blessings he has given me. I will be diligent. I will be obedient. I will dwell in his presence. I will be fruitful. By His Grace and Mercy. I know He is waiting for me.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cbfff3d1d859" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>