<?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 Anthony Vessicchio on Medium]]></title>
        <description><![CDATA[Stories by Anthony Vessicchio on Medium]]></description>
        <link>https://medium.com/@anthonyvessicchio?source=rss-cb9ce8e1c959------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*iv4oHiscJWAQYaioIUWOEw.jpeg</url>
            <title>Stories by Anthony Vessicchio on Medium</title>
            <link>https://medium.com/@anthonyvessicchio?source=rss-cb9ce8e1c959------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 13:05:54 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@anthonyvessicchio/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[Your First Decision Tree in Python (NFL Combine)]]></title>
            <link>https://medium.com/@anthonyvessicchio/your-first-decision-tree-in-python-nfl-combine-85496725e4fa?source=rss-cb9ce8e1c959------2</link>
            <guid isPermaLink="false">https://medium.com/p/85496725e4fa</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[decision-tree]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[sports]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Anthony Vessicchio]]></dc:creator>
            <pubDate>Wed, 22 Feb 2023 03:54:49 GMT</pubDate>
            <atom:updated>2023-02-22T03:54:49.508Z</atom:updated>
            <content:encoded><![CDATA[<p>Can a player’s performance in the NFL Combine predict whether or not they will be drafted? Let’s build a model to find out!</p><p><strong>What is a Decision Tree?</strong></p><p>A decision tree is a machine learning algorithm that is used for classification and regression tasks. It is a type of supervised learning algorithm, meaning that it is trained on labeled data. The basic idea behind a decision tree is to create a model that predicts the value of a target variable based on several input variables.</p><p><strong>How can we use it here?</strong></p><p>As stated above, decision trees can be used for classification (whether or not a player will be drafted) with labeled data (the NFL Combine results from the past).</p><p><strong>Let’s Implement This in Python (Full Notebook found here: </strong><a href="https://github.com/ant-vessicchio/learn_data_science_through_sports/blob/main/NFL_Combine/NFL_Combine_1st_Decision_Tree.ipynb">https://github.com/ant-vessicchio/learn_data_science_through_sports/blob/main/NFL_Combine/NFL_Combine_1st_Decision_Tree.ipynb</a>)</p><p>First, the imports we will need:</p><pre>import pandas as pd<br>import numpy as np<br>import matplotlib.pyplot as plt<br><br>from sklearn.model_selection import train_test_split<br>from sklearn.tree import DecisionTreeClassifier<br>from sklearn.metrics import accuracy_score<br>from sklearn import tree</pre><p>Then we ingest the data (dataset found here: <a href="https://www.kaggle.com/datasets/redlineracer/nfl-combine-performance-data-2009-2019">https://www.kaggle.com/datasets/redlineracer/nfl-combine-performance-data-2009-2019</a>)</p><pre>master_table = master_table = pd.read_csv(&quot;NFL.csv&quot;)<br>master_table.head()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kVeKKl0pebMB_ynCICAaCw.png" /></figure><p>We then will extract our performance features and whether or not a player will be drafted.</p><pre>X = master_table.iloc[:,3:9]<br>Y = master_table.iloc[:,-1]</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/970/1*gnpwK2uUmJOxgyeR8hcEXw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/586/1*oyPR5msuMlkrCZvG1MDyRQ.png" /></figure><p>Let’s do some cleaning:</p><pre>#Drop Records Containing Null Values<br>X.dropna(inplace=True)  <br>X.isnull().sum() #Check</pre><p>We then need to “Split” the data into training and test sets.</p><p><strong>What does this mean?</strong></p><p>This is a technique used in machine learning algorithms in order to evaluate the performance of a model without bias.</p><p>The training set is the portion of the data that is used to train the machine learning model. In this dataset, the model “knows” the outcome (it is presented with the output label from Y), and it will use this information to “fit” a model that will be able to generalize to new and “unseen” data.</p><p>The test set is used to evaluate how well the trained model performs on new, unseen data. The testing data includes both input data and corresponding output labels, but the output labels are __not__ used during testing. Instead, the model makes predictions on the testing data, and the predicted outputs are compared to the actual outputs to evaluate the model’s performance.</p><pre>X_train, X_test, y_train, y_test = train_test_split(X,Y, test_size = 0.3, random_state=100)</pre><p>What is this doing? It is taking 30% (0.3) of the data and assigning it to the “test” set. A 70/30 or 80/20 split are usually the most common and considered the gold standard for splitting. The “random_state” assignment is used so that you can get the same “random” split in the future for reproducibility or debugging.</p><p><strong>Training and Evaluating The Model</strong></p><p>We will use the DecisionTreeClassifier in sklearn. The first step is to create an instance of the class and specify any hyperparameters you want to use. Some of the commonly used hyperparameters include:</p><p>- max_depth: the maximum depth of the decision tree<br>- min_samples_split: the minimum number of samples required to split an internal node<br>- criterion: the function used to measure the quality of a split (e.g., ‘gini’ or ‘entropy’)</p><p>We will not use more than this for now. And I encourage you to read the sklearn documentation for more info!<br><a href="https://scikit-learn.org/stable/modules/generated/sklearn.tree.DecisionTreeClassifier.html">https://scikit-learn.org/stable/modules/generated/sklearn.tree.DecisionTreeClassifier.html</a></p><pre>clf = DecisionTreeClassifier(criterion = &#39;gini&#39;,min_samples_split = 3, max_depth = 3)</pre><p>We will then “fit” the model on the training data:</p><pre>clf.fit(X_train, y_train)</pre><p>Predict on our test data:</p><pre>y_pred = clf.predict(X_test)</pre><p>And to evaluate the model:</p><pre>print(f&quot; Accuracy score: {accuracy_score(y_test,y_pred)}&quot;)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/430/1*h8DJQ4sqJoMasZ9KwdSh2A.png" /></figure><p>Not a fantastic accuracy but not terrible. Above 70% is usually considered “good”. There are several things that can be done to make this model better in the future including hyperparameter turning, adding more features, etc. We will cover that more in the course as we progress.</p><p><strong>Visualize what’s going on:</strong></p><p>A pretty cool feature of a decision tree is the visualizations they can provide. Where you can essentially see the cutoff point for each feature in the decision making, how many samples were classified in each class, and the gini index which is the measure of how well a given attribute separates the training examples in a decision tree.</p><pre>plt.figure(figsize=(12,8))<br>from sklearn import tree<br>tree.plot_tree(clf.fit(X_train,y_train), feature_names = X_train.columns )<br>plt.show()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Uj_l7zs6MpB997MJcjHEDg.png" /></figure><p><strong>Feature Importance:</strong></p><p>A very cool feature of a decision tree is the generation of feature importance. Feature importance in a decision tree refers to a measure of how important each feature or input variable is in determining the final output of the tree.</p><pre># let&#39;s create a dictionary of features and their importance values<br>feat_dict= {}<br>for col, val in sorted(zip(X_train.columns, clf.feature_importances_),key=lambda x:x[1],reverse=True):<br>  feat_dict[col]=val<br><br>feat_df = pd.DataFrame({&#39;Feature&#39;:feat_dict.keys(),&#39;Importance&#39;:feat_dict.values()})<br>feat_df</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/337/1*OAL7XAlwpYt5PKYF01X9Fw.png" /></figure><p>If you are an avid football fan and combine enthusiast, it would be no surprise to you that 40 yard dash is the most determinant factor in whether or not a player gets drafted!</p><p>And to make a simple illustration of feature importance:</p><pre>import seaborn as sns<br>values = feat_df.Importance    <br>idx = feat_df.Feature<br>plt.figure(figsize=(10,8))<br>clrs = [&#39;green&#39; if (x &lt; max(values)) else &#39;red&#39; for x in values ]<br>sns.barplot(y=idx,x=values,palette=clrs).set(title=&#39;Feature Importance - Player Drafted (Y/N)&#39;)<br>plt.show()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*c6gDBBIAZ4jJnxyvsDdZmA.png" /></figure><p>Next Steps: This exercise lays the foundation for how to create and evaluate a decision tree classifier. I encourage you to take this dataset and create your own model(s)!</p><p>Some ideas:</p><ul><li>Change/add hyperparameters</li><li>Build a model for each position and see if that improves accuracy!</li><li>Maybe try handling missing data differently?</li></ul><p>The possibilities are endless! Get creative!</p><p>If you enjoyed this article, please comment below, follow me for more content, and follow along with my entire “Learn Data Science Through Sports” Free course hosted on my GitHub and SubReddit:</p><ul><li><a href="https://github.com/ant-vessicchio/learn_data_science_through_sports">GitHub - ant-vessicchio/learn_data_science_through_sports: Journey through the world of data science from beginner to advanced concepts and methodologies. In this repository, I will walk you through DS skills, hints, tips, and tricks all with Sports relevant examples!</a></li><li><a href="https://www.reddit.com/r/sportsanddatascience/">r/sportsanddatascience</a></li></ul><p>Also, feel free to reach out to me on LinkedIn! <a href="https://www.linkedin.com/in/anthony-vessicchio/">https://www.linkedin.com/in/anthony-vessicchio/</a></p><p>Thank you so much and I hope you enjoyed this article!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=85496725e4fa" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Calling All Aspiring Data Scientists (And Sports Fans)! Learn Data Science Through Sports]]></title>
            <link>https://medium.com/@anthonyvessicchio/calling-all-aspiring-data-scientists-and-sports-fans-learn-data-science-through-sports-345e8ef0ebc?source=rss-cb9ce8e1c959------2</link>
            <guid isPermaLink="false">https://medium.com/p/345e8ef0ebc</guid>
            <category><![CDATA[data]]></category>
            <category><![CDATA[analytics]]></category>
            <category><![CDATA[sports]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Anthony Vessicchio]]></dc:creator>
            <pubDate>Fri, 10 Feb 2023 00:13:03 GMT</pubDate>
            <atom:updated>2023-02-10T00:13:57.341Z</atom:updated>
            <content:encoded><![CDATA[<p>Sports and Data Science: The Perfect Combination!</p><p><strong>Who Am I?</strong></p><p>I have worked professionally as a Data Scientist of different levels for over 4 years now. I’ve always enjoyed onboarding, teaching, and mentoring Data Scientists and Data Analysts. I’ve worked primarily in marketing/advertising but my passion has always been sports!</p><p><strong>Getting into Data Science is Overwhelming<br></strong>When you begin to look for resources to start your data science career, you will immediately realize how much information is out there. What courses do I take? How much should I pay? What coding languages do I need to learn? How do I apply any of this to a real life use case I’m actually interested in? Believe me, this was all of us at the beginning.</p><p><strong>Learn Data Science Through Sports!</strong></p><p>I’ve decided to create a course that I wish someone created for me when I first got into data science: “Learn Data Science Through Sports”. This is absolutely a work in progress and I actually cannot wait to keep expanding this. But I would love some feedback/bring my course to light for anyone that it can help!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Fk9z_1dfU7g19APGfar_Kg.png" /><figcaption>A Preview of The Curriculum</figcaption></figure><p>Right now, the course is hosted 100% free on my personal GitHub: <a href="https://github.com/ant-vessicchio/learn_data_science_through_sports">https://github.com/ant-vessicchio/learn_data_science_through_sports</a></p><p>Journey through the world of data science from beginner to advanced concepts and methodologies. In this repository, I will walk you through DS skills, hints, tips, and tricks all with Sports relevant examples!</p><p>I will provide walkthroughs, notebooks, and code snippets weekly using some of my favorite examples from the sports world. We will go over concepts such as Python fundamentals, SQL fundamentals, Data Visualization, Data Cleaning, Data Mining, Algorithm development, automation, machine learning, AI, and more!</p><p>Love sports? Want to get into the world of data science? You’ve come to the right place!</p><p><strong>You also have access to Professional Support and Advice!</strong></p><p>I am very engaged with my community of students. I am happy to connect on LinkedIn: <a href="https://www.linkedin.com/in/anthony-vessicchio/">https://www.linkedin.com/in/anthony-vessicchio/</a> or on the course’s official Subreddit: <a href="https://www.reddit.com/r/sportsanddatascience/">https://www.reddit.com/r/sportsanddatascience/</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/340/1*0lQu5Sm9i_gU4ub44rwOrQ.png" /><figcaption>SubReddit</figcaption></figure><p>Feel free to join the community and reach out to me or discuss sports and data concepts with fellow members! I want this to be a teaching tool for anyone who has ever wanted to get into Data Science but never could figure out where to start or was too bored with the classic courses that give no context to their examples and overcharge.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=345e8ef0ebc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Your first Kaggle Dataset and Python (MLB Databank)]]></title>
            <link>https://medium.com/@anthonyvessicchio/your-first-kaggle-dataset-and-python-mlb-databank-7c021ba75575?source=rss-cb9ce8e1c959------2</link>
            <guid isPermaLink="false">https://medium.com/p/7c021ba75575</guid>
            <category><![CDATA[kaggle]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[learning-to-code]]></category>
            <category><![CDATA[sports]]></category>
            <dc:creator><![CDATA[Anthony Vessicchio]]></dc:creator>
            <pubDate>Wed, 08 Feb 2023 00:47:21 GMT</pubDate>
            <atom:updated>2023-02-08T00:47:21.682Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Introduction</strong></p><p>If you are, thinking about becoming, or even just heard the term “Data Scientist”, you have probably come across Kaggle.com where there is a seemingly endless amount of datasets spanning across hundreds of categories and use cases. It may seem quite overwhelming at first, but here is a nice breakdown of how to find a dataset you like, download it, and ingest it into a Jupyter notebook so you can have some fun with it!</p><p><strong>Navigating Kaggle</strong></p><p>This will be the first screen you see:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VZo-u5gbucnaSNMwh9yayQ.png" /></figure><p>There is a ton here. But let’s go to the relevant section for this article. Go the right pane and click on “Datasets”. This next screen is wonderful.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HQA07GS9hj4Iws_XzpKBHQ.png" /></figure><p>You can browse through this for hours (so be careful haha). For this example I want you to simply go to this link: <a href="https://www.kaggle.com/datasets/open-source-sports/baseball-databank">https://www.kaggle.com/datasets/open-source-sports/baseball-databank</a></p><p>This will bring you to this page:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Rbx1cCyVnGLIJfLFiTUUQQ.png" /></figure><p>Get used to reading the Data Card tab just to become familiar with the overall dataset. After you read a bit, click the “Download” button on the top right of the screen. This will download a zip file containing all of the dataset files that make up the databank. Unzip them and put them in a folder of your choice.</p><p><strong>Getting this data into a Jupyter Notebook Environment</strong></p><p>If you do not have a Jupyter Notebook environment or have no idea what I’m talking about, refer to this link: <a href="https://github.com/ant-vessicchio/learn_data_science_through_sports">https://github.com/ant-vessicchio/learn_data_science_through_sports</a> and scroll down to “Before We Begin”. (This is the page of my “Learn Data Science Through Sports” curriculum hosted on my GitHub- more on that later).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*amm3vcs3ZL111eby1gcswA.png" /></figure><p>Once you have a Jupyter Notebook Environment set up, you will want to upload these files.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*K8V5PiPuzK07pcseZ-l8JQ.png" /></figure><p>Navigate to the top right of your Jupyter workspace and click upload. Select all of the files from the unzipped folder.</p><p><strong>Playing with the data in Python</strong></p><p>Open up a new Python notebook (.ipynb file).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kzx3agvqVTHG1fO8ty5prQ.png" /></figure><p>Once you have a new notebook file open, you will want to ingest the csv’s into your Python environment. Start with the Master table.</p><pre>import pandas as pd<br>master_table = pd.read_csv(&quot;Master.csv&quot;)<br>master_table.head() #By default shows the top 5 records in the dataframe</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wLXBW7_yFXPSduqAx1CmOw.png" /></figure><p>Congrats! You have successfully accessed your first Kaggle data file in a Python environment. This is a HUGE step in your data science career!</p><p><strong>What can we do with this dataset?</strong></p><p>Follow along with this full notebook: <a href="https://github.com/ant-vessicchio/learn_data_science_through_sports/blob/main/Baseball_Databank_Exploration/Baseball_Databank_Exploration.ipynb">Baseball Databank Exploration</a> to see a rundown of some of the things you can do including valuable tips and skills you can use as a data scientist.</p><p>This notebook is a part of my entire “Learn Data Science Through Sports” curriculum available for free on my <a href="https://github.com/ant-vessicchio/learn_data_science_through_sports">GitHub</a>. I encourage you to follow along as I add more content. And if this example is too advanced or you want a refresher on some more basic Python skills, start the course from the beginning!</p><p>Thank you for reading and I hope you enjoyed!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7c021ba75575" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>