<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Jamie</title>
    <description>The latest articles on DEV Community by Jamie (@jamiedumayne).</description>
    <link>https://dev.to/jamiedumayne</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F560089%2F5288935a-c931-49da-aa31-1e5ecb43dcbf.jpg</url>
      <title>DEV Community: Jamie</title>
      <link>https://dev.to/jamiedumayne</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/jamiedumayne"/>
    <language>en</language>
    <item>
      <title>Day 7: Building first KNN model</title>
      <dc:creator>Jamie</dc:creator>
      <pubDate>Fri, 22 Jan 2021 22:41:59 +0000</pubDate>
      <link>https://dev.to/jamiedumayne/day-7-building-first-knn-model-1b44</link>
      <guid>https://dev.to/jamiedumayne/day-7-building-first-knn-model-1b44</guid>
      <description>&lt;p&gt;Today's the day to build my first model!&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--2sT1MshL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thumbs.gfycat.com/DapperPlaintiveAmericanrobin.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--2sT1MshL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thumbs.gfycat.com/DapperPlaintiveAmericanrobin.webp" alt="Celebrate the good times"&gt;&lt;/a&gt;&lt;br&gt;
I decided to go with a K-Nearest Neighbours model since I've never done one of those before and I already have the code on how to do it. I've attempted to do linear regression and logistic regression before, but it didn't go well.&lt;br&gt;
Next, I hunted on Kaggle for some data that I could use. I wanted to find one that someone else has used with a KNN before, so that way I know it is possible. After a quick Google search I found this dataset on &lt;a href="https://www.kaggle.com/uciml/pima-indians-diabetes-database"&gt;Diabetes&lt;/a&gt;.&lt;br&gt;
I tried to follow the steps I'd been taught on the Data camp course and examine the data first. However, I hit a snag. I've not worked with data like this before so I don't know if it's okay for features such as skin thickness to be 0. So I found someone else's notebook that had worked on this before to see what they did (it's okay because I'm still learning right?). They also weren't sure, so they filled the zero values with the mean values, so I did this too. Now the brain is really sweating.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--EEVI1ozV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thumbs.gfycat.com/PerkyForkedIcefish.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--EEVI1ozV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thumbs.gfycat.com/PerkyForkedIcefish.webp" alt="Working so hard I start sweating"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Okay, so the next step was to build the actual model. I did this by only looking at my notes and I actually managed to get it to work first time! I did have some problems trying to get GridSearchCV (if you're unfamiliar, this is a way to find the best value for your hyper parameters). I think I'll come back to that on Monday and see if I can get that working. Instead, I managed to get a simple for loop working. Then I finished up by making a ROC curve and getting the area under the curve value. It's not perfect, but I'm pretty proud of getting this far and mostly understanding everything I've done.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--NdnfjPjM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thumbs.gfycat.com/LoathsomeUnsightlyEidolonhelvum.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--NdnfjPjM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thumbs.gfycat.com/LoathsomeUnsightlyEidolonhelvum.webp" alt="Super smiley Ron Swanson"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I don't really have code to show today since it was just putting everything together from the last week. However, if you'd like to see what I've done you can &lt;a href="https://www.kaggle.com/jamiedumayne/diabetes-data-set-knn/edit/run/52484973"&gt;look for yourself&lt;/a&gt;. Anyway, have a good weekend. I'll be back on Monday!&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--FQQGQWy2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thumbs.gfycat.com/SpecificThirstyIbadanmalimbe.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--FQQGQWy2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thumbs.gfycat.com/SpecificThirstyIbadanmalimbe.webp" alt="Waving bye"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>machinelearning</category>
      <category>python</category>
      <category>100daysofcode</category>
    </item>
    <item>
      <title>Day 5 + 6: Pre-processing data</title>
      <dc:creator>Jamie</dc:creator>
      <pubDate>Thu, 21 Jan 2021 20:03:31 +0000</pubDate>
      <link>https://dev.to/jamiedumayne/day-5-6-pre-processing-data-2b5l</link>
      <guid>https://dev.to/jamiedumayne/day-5-6-pre-processing-data-2b5l</guid>
      <description>&lt;p&gt;I decided to group day's 5 and 6 together (today and yesterday) since they were both on the same topic. I'd picked up a little bit on pre-processing data through my PhD, but I just didn't really know the actual terms to do things in Python.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--0h5U7O8j--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thumbs.gfycat.com/WavyQualifiedDogfish.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--0h5U7O8j--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thumbs.gfycat.com/WavyQualifiedDogfish.webp" alt="Clefairy trying to use a computer"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  The Code
&lt;/h1&gt;

&lt;p&gt;This is very helpful, being able to convert categories to binary so that it works better with machine learning&lt;br&gt;
&lt;code&gt;df_origin = pd.get_dummies(df)&lt;/code&gt;&lt;br&gt;
Replace all zero values with nan, then drop all rows with nan in:&lt;br&gt;
&lt;code&gt;df.column.replace(0, np.nan, inplace=True)&lt;br&gt;
df.dropna()&lt;/code&gt;&lt;br&gt;
Scale data down to be between a smaller range of numbers&lt;br&gt;
&lt;code&gt;from sklearn.preprocessing import Scale&lt;br&gt;
X_scaled = scale(X)&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;That's the end of the DataCamp course on scikit-learn (well this introduction anyway).&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--3CpoWHQg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thumbs.gfycat.com/TerribleUnfinishedAfghanhound.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--3CpoWHQg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thumbs.gfycat.com/TerribleUnfinishedAfghanhound.webp" alt="Kid walking down the hall to applause but also looking scared, because that's how I feel"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Thoughts on the course
&lt;/h1&gt;

&lt;p&gt;Would I recommend the DataCamp course I did? That's actually a tough question. If you already pay for DataCamp or can get a free trial, I'd recommend doing this course. But I don't recommend paying for DataCamp specifically for this course. It's a good course to know the terminology to be able to do some of the basics of machine learning in Python (see previous days for specifics on what the whole course contained). I just feel like there are other free resources you could probably find to pick up the same knowledge.&lt;br&gt;
Anyway, now that I've finished the course I'm going to try and build my first machine learning model on Kaggle tomorrow.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--q4baEI1k--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thumbs.gfycat.com/GiantAdorableCommongonolek.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--q4baEI1k--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thumbs.gfycat.com/GiantAdorableCommongonolek.webp" alt="Me freaking out and being all scared because that's how my brain feels right now"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>machinelearning</category>
      <category>python</category>
      <category>100daysofcode</category>
      <category>datascience</category>
    </item>
    <item>
      <title>Day 4: Area under the ROC</title>
      <dc:creator>Jamie</dc:creator>
      <pubDate>Wed, 20 Jan 2021 19:42:53 +0000</pubDate>
      <link>https://dev.to/jamiedumayne/day-4-area-under-the-roc-7kh</link>
      <guid>https://dev.to/jamiedumayne/day-4-area-under-the-roc-7kh</guid>
      <description>&lt;p&gt;I actually did this yesterday, but I forgot to post.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--xs20-6Ow--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thumbs.gfycat.com/CrispFirstAurochs.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--xs20-6Ow--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thumbs.gfycat.com/CrispFirstAurochs.webp" alt="House saying oops"&gt;&lt;/a&gt;&lt;br&gt;
Anyway, building on day 3's work on ROC today was all about how to quantify how good a model is. That's where the area under the curve (or AUC) comes in. This will then give you a value. The bigger the value is the better your model.&lt;/p&gt;

&lt;h1&gt;
  
  
  The code
&lt;/h1&gt;

&lt;p&gt;Once you've got your model (any model), split it into your train and test, then have it making predictions. Then you need to import the AUC and you can run it.&lt;br&gt;
&lt;code&gt;from sklearn.metrics import roc_auc_score&lt;br&gt;
roc_auc_score(y_test, y_pred_prob)&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--IZvrWNYV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thumbs.gfycat.com/FreeCrispAmericanratsnake.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--IZvrWNYV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thumbs.gfycat.com/FreeCrispAmericanratsnake.webp" alt="Super easy thing to do"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>machinelearning</category>
      <category>python</category>
      <category>datascience</category>
      <category>100daysofcode</category>
    </item>
    <item>
      <title>Day 3: ROC curves</title>
      <dc:creator>Jamie</dc:creator>
      <pubDate>Tue, 19 Jan 2021 00:19:41 +0000</pubDate>
      <link>https://dev.to/jamiedumayne/day-3-roc-curves-31no</link>
      <guid>https://dev.to/jamiedumayne/day-3-roc-curves-31no</guid>
      <description>&lt;p&gt;Happy Monday! Today is all about ROCs&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ubLYz6SN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thumbs.gfycat.com/BriskThriftyCockerspaniel.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ubLYz6SN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thumbs.gfycat.com/BriskThriftyCockerspaniel.webp" alt="spinning rock"&gt;&lt;/a&gt;&lt;br&gt;
Okay not that kind of rock. Instead, as I found out, it's a way to evaluate how well logistic regression works (and maybe other types of models, I'm not 100%).&lt;br&gt;
So first you start by making a confusion matrix. This takes all of the true positives, false positives, true negatives and false negative and gives you their values. Sounds confusing I know so I guess they got the right name for the matrix.&lt;br&gt;
The next step is to take these four new things and calculate other factors such as precision and accuracy. These give you an idea of how many true positives and false negatives you're getting, respectively. The confusion matrix also produced a value called F score, this is something I've come across before but not really understood so I'll try and brush up on that in the future.&lt;br&gt;
Anyway, from these we can produce a receiver operating characteristic (ROC) curve which allows us to see these things more quickly in a graph. Here's an example of a ROC curve I found on Google:&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--UVGUqvRh--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://3qeqpr26caki16dnhd19sv6by6v-wpengine.netdna-ssl.com/wp-content/uploads/2018/08/ROC-Curve-Plot-for-a-No-Skill-Classifier-and-a-Logistic-Regression-Model.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--UVGUqvRh--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://3qeqpr26caki16dnhd19sv6by6v-wpengine.netdna-ssl.com/wp-content/uploads/2018/08/ROC-Curve-Plot-for-a-No-Skill-Classifier-and-a-Logistic-Regression-Model.png" alt="A ROC curve, it's kind of hard to explain in words"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So the diagonal line is how good your model would be if it just classified between two things at random, it would be right about half the time. The orange curve shows how good your model is. Basically, the closer it is to the top left the better your model is. With a graph like this, you can plot a ROC curve for multiple models and compare how they do. So if you're say comparing KNN and logistical regression you can visually see how well they perform in a specific task and choose the one that's right for you. Neat huh?&lt;/p&gt;

&lt;p&gt;I'm trying a new thing today where I post some of the code I learnt so you can try and learn these new things with me. What do you think? Would you like to see more of this or would you prefer I keep it more of a diary?&lt;/p&gt;

&lt;h1&gt;
  
  
  The Code
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--2Ti7abXd--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thumbs.gfycat.com/SoggyFearfulCoelacanth.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--2Ti7abXd--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thumbs.gfycat.com/SoggyFearfulCoelacanth.webp" alt="Spinning earth in code form, like literally ones and zeroes changing to make it look like that. It's a good metaphor for code right?"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;How to make a confusion matrix:&lt;br&gt;
&lt;code&gt;From sklearn.metrics import confusion_matrix&lt;br&gt;
Print(confusion_matrix(y_test, y_pred))&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;How to make and plot a ROC curve:&lt;br&gt;
&lt;code&gt;From sklearn.metrics import roc_curve&lt;br&gt;
Y_pred_prob = logreg.predict_proba(X_test)[:,1]&lt;br&gt;
Fpr, tpr, thresholds = roc_curve(y_test, y_pred_prob)&lt;br&gt;
Plt.plot([0,1], [0,1], ‘k—‘)&lt;br&gt;
Plt.plot(fpr, tpr, label=’Logistic Regression’)&lt;br&gt;
Plt.xlabel(‘False Positive Rate’)&lt;br&gt;
Plt.ylabel(‘True Positive Rate’)&lt;br&gt;
Plt.title(‘Logistic Regression ROC Curve’)&lt;br&gt;
Plt.show()&lt;/code&gt;&lt;/p&gt;

</description>
      <category>machinelearning</category>
      <category>python</category>
      <category>100daysofcode</category>
      <category>roc</category>
    </item>
    <item>
      <title>Day 2: learning linear regression</title>
      <dc:creator>Jamie</dc:creator>
      <pubDate>Sat, 16 Jan 2021 00:19:55 +0000</pubDate>
      <link>https://dev.to/jamiedumayne/day-2-learning-linear-regression-2173</link>
      <guid>https://dev.to/jamiedumayne/day-2-learning-linear-regression-2173</guid>
      <description>&lt;p&gt;Well I'm back again (that's a good start to my 100 days of learning machine learning).&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--egTCq4Ut--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thumbs.gfycat.com/FlatComposedHornbill.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--egTCq4Ut--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thumbs.gfycat.com/FlatComposedHornbill.webp" alt="Confetti raining down on a corgi, because I'm a good puppy"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Day 2
&lt;/h1&gt;

&lt;p&gt;I moved onto the next chapter of the scikit-learn data camp course. Today was all about linear regression. I can really see what people mean that it only takes a few lines of code to do machine learning. Both KNN (see yesterday's post) and linear regression use like 10 lines top. So that's nice.&lt;/p&gt;

&lt;p&gt;Anyway, today I managed to get a linear regression model working which I'm pretty happy about. I also now know what ridge regression and lasso regression is. They were always just mystery words that people would throw out sometimes. Like if you order a a plain black coffee and then they say do you want sugar or milk with that. I'd just look at them in confusion and be like "I just wanted coffee??". But now I understand that lasso and ridge regression are just ways to supplement linear regression if you need them. Just like milk and sugar with coffee (I think, I don't actually drink coffee) &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--plCgP6aI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thumbs.gfycat.com/WarmheartedForthrightGuernseycow.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--plCgP6aI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thumbs.gfycat.com/WarmheartedForthrightGuernseycow.webp" alt="Alex from modern family spitting out a drink, basically my reaction to drinking coffee"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I'm unsure what my next step should be. I could carry on with the course and learn a bit more about hyper parameters or I could jump over to kaggle and try building my first model. I want to do both so it's just a question of which one I do first. What do you think I should do?&lt;/p&gt;

&lt;p&gt;Be back on Monday for day 3, have a good weekend!&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--FIBd1Ggw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thumbs.gfycat.com/SomeJoyousDove.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--FIBd1Ggw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thumbs.gfycat.com/SomeJoyousDove.webp" alt="Jake the dog sleeping in a drawer, I accidentally carried on the puppy theme"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>machinelearning</category>
      <category>python</category>
      <category>100daysofcode</category>
    </item>
    <item>
      <title>100 days of learning machine learning: day 1</title>
      <dc:creator>Jamie</dc:creator>
      <pubDate>Thu, 14 Jan 2021 22:43:16 +0000</pubDate>
      <link>https://dev.to/jamiedumayne/100-days-of-learning-machine-learning-day-1-3544</link>
      <guid>https://dev.to/jamiedumayne/100-days-of-learning-machine-learning-day-1-3544</guid>
      <description>&lt;p&gt;So I'm trying something new. I'm going to try and spend 100 days learning machine learning. I've been using Python for about a year and also have some theoretical knowledge of machine learning after completing &lt;a href="https://www.coursera.org/learn/machine-learning"&gt;this course&lt;/a&gt;. I now need to learn how to actually &lt;em&gt;do&lt;/em&gt; machine learning.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why am I doing this?&lt;/strong&gt; What else is there to do right now? I'm bored, stuck in the house. The main reason though is being able to do machine learning would help with my PhD research immensely!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why are you telling me all this?&lt;/strong&gt; I'm hoping by posting on DEV it'll help me to stay motivated and keep practising. I'm also hoping that maybe I can find other people who want to learn machine learning (or are super bored) and we could figure some of this stuff out together.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://i.giphy.com/media/13YZ9H9oyZOjhm/giphy.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://i.giphy.com/media/13YZ9H9oyZOjhm/giphy.gif" alt="Get on with it, from Monty Python and the Holy Grail"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Anyway...&lt;/p&gt;

&lt;h2&gt;
  
  
  Day 1
&lt;/h2&gt;

&lt;p&gt;So today is the first day. I'm starting using data camp to learn scikit-learn. I'm hoping if I can pick up some of the coding knowledge here. Then once I understand it a bit, move over to Kaggle and try it out on some real datasets. Today I spent about an hour working on a K-nearest neighbor model. I was hoping to start with linear regression, but this was actually quite simple to pick up (always nice). The examples showed how to use it with the iris dataset and then I got to work with a dataset from american politics.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;My favourite thing I learnt today&lt;/strong&gt; is how to use a for loop to change the number of neighbors to be used, and evaluate the score of the KNN each time. This is so simple but blew my mind at the same time. It's such a clever way to work out the best number of neighbors each time.&lt;/p&gt;

</description>
      <category>machinelearning</category>
      <category>python</category>
      <category>100daysofcode</category>
    </item>
  </channel>
</rss>
