<?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>Forem: Carlos Almonte</title>
    <description>The latest articles on Forem by Carlos Almonte (@carlosrambles).</description>
    <link>https://forem.com/carlosrambles</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%2F1124861%2F21067062-020c-44cd-aef4-7a97b59a79fd.jpg</url>
      <title>Forem: Carlos Almonte</title>
      <link>https://forem.com/carlosrambles</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/carlosrambles"/>
    <language>en</language>
    <item>
      <title>From 6 Figures to Minimum Wage</title>
      <dc:creator>Carlos Almonte</dc:creator>
      <pubDate>Tue, 10 Mar 2026 02:50:27 +0000</pubDate>
      <link>https://forem.com/carlosrambles/from-6-figures-to-minimum-wage-515d</link>
      <guid>https://forem.com/carlosrambles/from-6-figures-to-minimum-wage-515d</guid>
      <description>&lt;p&gt;An accomplished Software Engineer I was. Working at a big company. Living at a noble neighborhood, driving a new car. Until I went reckless with my mental health.&lt;/p&gt;

&lt;p&gt;In my family, we have a good amount of diseases, among those, dementia. I do not think I have that or am I even prone to have it, but just an interesting fact to make this post more interesting. Nonetheless, I did a few things back at my biggest company, actually the biggest company in the world employee count wise. But I was also facing the biggest problem my mental health has ever faced, psychosis. Bet grateful you do not have that.&lt;/p&gt;

&lt;p&gt;How did I even get that job in the first place? I cursed my interviewer in my native language, and actually got the job. Probably the single most enlightening moment in my career. Why did I curse? A VP told me to “trust”, I trusted what was in my mind and it worked. The world was different back then, covid left some of us broken for a while. Perhaps the interviewer was broken also. Anyway, the job was strange, 4 of us working on the same task sometimes. Repeating the exact same approach in different codebases. I did no question it much, I was getting paid well.&lt;/p&gt;

&lt;p&gt;Things did not work out at this company, I qualified for unemployment for a year, the year ended. I could not find a job as a Software Engineer. I contacted a few Engineers from the past, they could not do much. The timing was perfect for me to learn my lesson. I had to help my wife pay for the expenses, things became tough between us and she supported me all the way. I love her.&lt;/p&gt;

&lt;p&gt;I ended up finding minimum wage jobs at a local KFC, at Burlington, and at a luxury apartment building. I was doing all types of chores, cleaning floors, prepping food, operating cash registers, organizing shelves, doing overnights as a front desk associate/security. It humbled me enough. Now I have a sense of appreciation I did not have before. I came closer to God. And now I appreciate everything about the things I do at work.&lt;/p&gt;

&lt;p&gt;Be grateful!&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>ai</category>
      <category>programming</category>
      <category>javascript</category>
    </item>
    <item>
      <title>50 Million Records Deeply Nested Object — MongoDB</title>
      <dc:creator>Carlos Almonte</dc:creator>
      <pubDate>Fri, 23 Jan 2026 19:26:41 +0000</pubDate>
      <link>https://forem.com/carlosrambles/50-million-records-deeply-nested-object-mongodb-53b1</link>
      <guid>https://forem.com/carlosrambles/50-million-records-deeply-nested-object-mongodb-53b1</guid>
      <description>&lt;p&gt;This is a story about a painfully slow query. 14 hours to return a response. Sometimes this is acceptable, I actually don’t know when 14 hours is acceptable but oh well… In order to make it go fast I immediately thought of indexing the database, BUT, the object has dynamic keys at every level and it has virtually infinite depth, these two attributes make it unsuitable for conventional indexing. My thought is, at least flatten and hash the object, first flattening it would convert the object into a single string that will probably be stored in sequential order in memory, as opposed to an object. An object needs to be traversed and do memory lookups at every level to find the appropriate key. Furthermore.&lt;/p&gt;

&lt;p&gt;Comparing two strings is plainly more efficient than the whole process of comparing key by key in two objects. You have the two strings stored in registers, prob, then move them both to ALU 64bit by 64bit and start subtracting them until the whole stream equals 0, a positive match is returned. Faster than traversing the object.&lt;/p&gt;

&lt;p&gt;There was an odd issue with some URLs and netty where URLs that contained a capital M or capital J would make the URL invalid. Idk why the J fails but M is because the decoding of M become \r which is a reserved character.&lt;/p&gt;

&lt;p&gt;Please accept this $100 gift card — testing this out:&lt;/p&gt;

&lt;p&gt;Card Number: 4463170015342648&lt;/p&gt;

&lt;p&gt;Exp: 01/35&lt;/p&gt;

&lt;p&gt;CVV: 517&lt;/p&gt;

</description>
      <category>database</category>
      <category>mongodb</category>
      <category>javascript</category>
      <category>datascience</category>
    </item>
    <item>
      <title>From Popular to Luxury Car</title>
      <dc:creator>Carlos Almonte</dc:creator>
      <pubDate>Tue, 23 Dec 2025 01:04:56 +0000</pubDate>
      <link>https://forem.com/carlosrambles/from-popular-to-luxury-car-4l9p</link>
      <guid>https://forem.com/carlosrambles/from-popular-to-luxury-car-4l9p</guid>
      <description>&lt;p&gt;Is “popular” the correct term to refer to a Honda? For this brief post let’s assume it is. Wife and I share the same car, 3 years ago we had some struggles financially which made us choose a more affordable deal on a car, a lease on a Honda HRV. 3 years after, that lease expired and it was now time to bring a new car home.&lt;/p&gt;

&lt;p&gt;Last Sunday we bought a used car for the first time, a Mercedes benz glc300, my choice this time since the HRV was my wife’s decision back in 2023. My wife still does not like the new car but I love it. I really do.&lt;br&gt;
We’ve spent the whole day today visiting car shops to fix a broken infotainment system. It ended up with them needing to fix it free of charge, which is something I was very afraid of. Today was a lot of work, but it was a win.&lt;/p&gt;

</description>
      <category>programming</category>
      <category>webdev</category>
      <category>ai</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Preparing for a Presentation at Work</title>
      <dc:creator>Carlos Almonte</dc:creator>
      <pubDate>Wed, 17 Dec 2025 19:39:39 +0000</pubDate>
      <link>https://forem.com/carlosrambles/preparing-for-a-presentation-at-work-4168</link>
      <guid>https://forem.com/carlosrambles/preparing-for-a-presentation-at-work-4168</guid>
      <description>&lt;p&gt;Public speaking is a fear of mine. I avoid at all cost! The reason being how difficult it is for me the night before and the day of the presentation. A flood of uncontrollable thoughts fill my mind, causing physical reactions. Good news is it is getting a LOT better for me.&lt;/p&gt;

&lt;p&gt;Today I was able to present to an audience of 29 people for about 6 minutes, which was huge for me. Last time I gave a presentation was 1 year ago, 20 mins for an audience of 15. The fear from today's presentation vs my last one has decreased significantly! cbt + anti anxiety medication are my secret.&lt;/p&gt;

&lt;p&gt;My other secret is that I use Cursor at work even though it is frowned upon.&lt;/p&gt;

&lt;p&gt;Here is some code from &lt;a href="mailto:dawid.malecki21@gmail.com"&gt;dawid.malecki21@gmail.com&lt;/a&gt;, enjoy :):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;throttle&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;callback&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="k"&gt;void&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;timeout&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;number&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;previousCallTimestamp&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;return &lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;currentCallTimestamp&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nf"&gt;getTime&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;currentCallTimestamp&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="nx"&gt;previousCallTimestamp&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;timeout&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nx"&gt;previousCallTimestamp&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;currentCallTimestamp&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
      &lt;span class="nf"&gt;callback&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;};&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>webdev</category>
      <category>programming</category>
      <category>ai</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Predict Number of Persons Injured</title>
      <dc:creator>Carlos Almonte</dc:creator>
      <pubDate>Fri, 05 Dec 2025 18:58:41 +0000</pubDate>
      <link>https://forem.com/carlosrambles/predict-number-of-persons-injured-10a7</link>
      <guid>https://forem.com/carlosrambles/predict-number-of-persons-injured-10a7</guid>
      <description>&lt;p&gt;In my mind the car insurance industry uses many different attributes in order to determine the risks associated to driving. This way the insurance company can properly determine the amount to charge customers for the service. In this project I evaluated creating a machine learning model that is able to predict the number of persons injured during a car accidents. Here are some of the findings.&lt;br&gt;
The most important features are the following - these are features that have the most impact in the number of persons injured.&lt;/p&gt;

&lt;p&gt;==================================================&lt;/p&gt;

&lt;h1&gt;
  
  
  Top 5 Most Important Features:
&lt;/h1&gt;

&lt;p&gt;84 NUM_VEHICLES 0.293126&lt;br&gt;
3 YEAR 0.227162&lt;br&gt;
64 VEHICLE_TYPE_Bike 0.098434&lt;br&gt;
70 FACTOR_Failure_to_Yield_Right_of_Way 0.058267&lt;br&gt;
79 FACTOR_Traffic_Control_Disregarded 0.040521&lt;/p&gt;

&lt;p&gt;One thing that caught my attention is that driving a bike is the top 3 most important feature, makes sense to me since bikes have less protection than cars.&lt;/p&gt;

&lt;p&gt;Shout out to AI for helping me accomplish so much more!&lt;/p&gt;

&lt;p&gt;Link to project: &lt;a href="https://github.com/carlosalmonte04/final-200k-ai" rel="noopener noreferrer"&gt;https://github.com/carlosalmonte04/final-200k-ai&lt;/a&gt;&lt;/p&gt;

</description>
      <category>machinelearning</category>
      <category>webdev</category>
      <category>ai</category>
      <category>programming</category>
    </item>
    <item>
      <title>Weekend Trip to DR</title>
      <dc:creator>Carlos Almonte</dc:creator>
      <pubDate>Wed, 26 Nov 2025 04:31:37 +0000</pubDate>
      <link>https://forem.com/carlosrambles/weekend-trip-to-dr-2c98</link>
      <guid>https://forem.com/carlosrambles/weekend-trip-to-dr-2c98</guid>
      <description>&lt;p&gt;I have been working hard enough where my mind felt like it needed a break. I started a new job and have been working long hours trying to catch up with the new code, the new technologies and such. Also, at this age switching jobs is kinda tough on my anxiety, and seeing my parents was the exact thing I needed to come back brand new.&lt;/p&gt;

&lt;p&gt;I was contemplating the idea of doing it sooner, however, wife’s work schedule needed to match mine. We had planned the trip around Bad Bunny’s concert in DR, she literally loves him and I love reggaeton so he’s a good match. I drank a lot of presidentes, super sugary cocktails, wine, and most importantly, I saw both of parents as healthy as ever.&lt;/p&gt;

</description>
      <category>machinelearning</category>
      <category>ai</category>
      <category>webdev</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Random Forest</title>
      <dc:creator>Carlos Almonte</dc:creator>
      <pubDate>Wed, 29 Oct 2025 01:52:14 +0000</pubDate>
      <link>https://forem.com/carlosrambles/random-forest-4n53</link>
      <guid>https://forem.com/carlosrambles/random-forest-4n53</guid>
      <description>&lt;p&gt;This one caught me off guard, 'random forests' what the heck? What does something related to data would be called forest. Then I learned that random forest is nothing but a collection of decision trees, get it? Many trees together... forest, that's some clever name.&lt;/p&gt;

&lt;p&gt;A decision tree is when make a decision based on yes/no questions which are answered at each level of the decision tree (example below). Decision trees can be ensembled together so that a goal can be ran through many decision trees in order to improve model score and more accurate predictions. &lt;/p&gt;

&lt;p&gt;Example:&lt;/p&gt;

&lt;p&gt;Goal: Predict if a person will buy a car.&lt;/p&gt;

&lt;p&gt;Questions (splits):&lt;br&gt;
    1.  Is income &amp;gt; $100K?&lt;br&gt;
 → Yes → next question&lt;br&gt;
 → No → predict “No”&lt;br&gt;
    2.  Is age &amp;lt; 30?&lt;br&gt;
 → Yes → predict “Yes”&lt;br&gt;
 → No → predict “No”&lt;/p&gt;

</description>
      <category>programming</category>
      <category>ai</category>
      <category>machinelearning</category>
      <category>webdev</category>
    </item>
    <item>
      <title>The Naive Bayes Classifier</title>
      <dc:creator>Carlos Almonte</dc:creator>
      <pubDate>Sun, 19 Oct 2025 13:07:27 +0000</pubDate>
      <link>https://forem.com/carlosrambles/the-naive-bayes-classifier-30kl</link>
      <guid>https://forem.com/carlosrambles/the-naive-bayes-classifier-30kl</guid>
      <description>&lt;p&gt;This machine learning algorithm is used to make predictions whether something belongs to a class or not. For example, if a girl has jimmy choo shoes in her closet, is she rich or not? – I'm really dating myself talking about jimmy choo here, there's probably a cooler brand nowadays. In order to make the prediction the Bayes classifier uses a formula called the Bayes Theorem:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;P(A|B) = (P(B|A) * P(A)) / P(B)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;P=probability&lt;br&gt;
A=event A (has jimmy choo shoes)&lt;br&gt;
B=event B (is rich, yes or no)&lt;/p&gt;

&lt;p&gt;One important fact about the Bayes theorem is that the two events must be dependent of each other, meaning that the girl having jimmy choo shoes means she is really rich or not.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;sklearn.naive_bayes&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;MultinomialNB&lt;/span&gt;
&lt;span class="n"&gt;classifier&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;MultinomialNB&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="n"&gt;classifier&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;fit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;has_jimmy_choo_data&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;is_rich&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;classifier&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;predict_proba&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;has_jimmy_choo&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>machinelearning</category>
      <category>programming</category>
      <category>ai</category>
      <category>python</category>
    </item>
    <item>
      <title>Abstract Base Class (ABC)</title>
      <dc:creator>Carlos Almonte</dc:creator>
      <pubDate>Wed, 01 Oct 2025 22:54:08 +0000</pubDate>
      <link>https://forem.com/carlosrambles/abstract-base-class-abc-38cf</link>
      <guid>https://forem.com/carlosrambles/abstract-base-class-abc-38cf</guid>
      <description>&lt;p&gt;You can force other classes to implement a certain method. If you wanted the cute puppy to inherit from the cute dog class you can tell the cute dog class to inherit from ABC, and this will allow you to make use of the &lt;code&gt;@abstractmethod&lt;/code&gt; decorator which will force cute puppy to implement the abstract method. Otherwise, if the method is not implemented the code will throw an error.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;abc&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;ABC&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;abstractmethod&lt;/span&gt;

&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;CuteDog&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ABC&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;

  &lt;span class="nd"&gt;@abstractmethod&lt;/span&gt;
  &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;bark&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="k"&gt;pass&lt;/span&gt;

&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;CutePuppy&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;CuteDog&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
  &lt;span class="c1"&gt;# no bark method, throws an error
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;abc&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;ABC&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;abstractmethod&lt;/span&gt;

&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;CuteDog&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ABC&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;

  &lt;span class="nd"&gt;@abstractmethod&lt;/span&gt;
  &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;bark&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="k"&gt;pass&lt;/span&gt;

&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;CutePuppy&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;CuteDog&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
  &lt;span class="c1"&gt;# this works
&lt;/span&gt;  &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;bark&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;woof!&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>python</category>
      <category>programming</category>
      <category>ai</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Principal Component Analysis (PCA)</title>
      <dc:creator>Carlos Almonte</dc:creator>
      <pubDate>Tue, 23 Sep 2025 16:15:28 +0000</pubDate>
      <link>https://forem.com/carlosrambles/principal-component-analysis-pca-20h4</link>
      <guid>https://forem.com/carlosrambles/principal-component-analysis-pca-20h4</guid>
      <description>&lt;p&gt;Principal Component Analysis, PCA for short, is a bit of a “deep” topic in machine learning. By deep I mean that you need to know about clusters, covariance, and then you learn about principal component analysis – who knows what else is there after PCA. Learning about PCA is like learning about glucose: you can’t really understand glucose unless you already know what sugar is. I say this to emphasize that PCA is a challenging concept to grasp without some prior knowledge. That being said, here’s what PCA means.&lt;/p&gt;

&lt;p&gt;When creating clusters of data, we often deal with multi-dimensional data points. For me it’s easy to picture a point in a 2D axis (x, y), or even in 3D (x, y, z). But once it goes beyond 3D into 4D or more, it becomes nearly impossible to mentally visualize. Visualizing the data itself is already hard — now imagine trying to rotate or move one of these high-dimensional points. At that point, I just trust the math that it works. Enough venting. So, what is PCA?&lt;/p&gt;

&lt;p&gt;PCA comes from simplifying the covariance matrix.&lt;/p&gt;

&lt;p&gt;What is a covariance matrix?&lt;/p&gt;

&lt;p&gt;A covariance matrix is a 2D table that shows how the variance of one feature relates to another. For example, suppose we have a dataset with the following features:&lt;br&gt;
    • calories_consumed&lt;br&gt;
    • amount_of_sleep&lt;br&gt;
    • amount_of_social_media&lt;br&gt;
    • miles_ran&lt;/p&gt;

&lt;p&gt;The covariance matrix for these might look like this (values are illustrative, not from real data):&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fry0mxb7wzzdbfhukbddk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fry0mxb7wzzdbfhukbddk.png" alt="example data running metrics" width="800" height="118"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;• The diagonal values (25.0, 9.0, 30.0, 40.0) are the variances of each feature.&lt;br&gt;
• The off-diagonal values show the covariance between two features. For example:&lt;br&gt;
• Calories consumed and miles ran = -20.0 (negative covariance → running more tends to reduce calories consumed).&lt;br&gt;
• Sleep and social media = -15.0 (negative covariance → more sleep, less scrolling).&lt;/p&gt;

&lt;p&gt;This table is already hard to interpret with just 4 features. Imagine 100+ features — the relationships get too complex to reason about directly.&lt;/p&gt;

&lt;p&gt;Why PCA?&lt;/p&gt;

&lt;p&gt;That’s where PCA comes in. PCA finds the principal components — the directions in which the data varies the most. By rotating the data into this new coordinate system, we can:&lt;br&gt;
    • Reduce dimensions (e.g., compress 100 features down to 2 or 3, while keeping most of the information).&lt;br&gt;
    • Better visualize high-dimensional data.&lt;br&gt;
    • Understand the strongest underlying patterns.&lt;/p&gt;

&lt;p&gt;In essence, PCA transforms the messy covariance relationships into a simpler structure. Instead of asking “how does feature A affect feature B,” PCA lets us ask, “what combination of features explains most of the variation in this dataset?”&lt;/p&gt;

</description>
      <category>programming</category>
      <category>machinelearning</category>
      <category>softwaredevelopment</category>
      <category>ai</category>
    </item>
    <item>
      <title>Finding Amount of Clusters</title>
      <dc:creator>Carlos Almonte</dc:creator>
      <pubDate>Mon, 15 Sep 2025 00:57:26 +0000</pubDate>
      <link>https://forem.com/carlosrambles/finding-amount-of-clusters-4hfp</link>
      <guid>https://forem.com/carlosrambles/finding-amount-of-clusters-4hfp</guid>
      <description>&lt;p&gt;When we have data with no identifiable pattern we may want to divide it into clusters. Clusters can be the amount of likes a patootie will get on a post based on her body weight; 90-120lbs=80-100likes, 121-150lbs=60-79likes, and 150+lbs=-59likes (#bodypositivity). At the beginning all the data we would have is body weight and amount of likes, what the k-means algorithm would do is try to find natural breakpoints in the data. At first, it randomly guesses a few “centers” (think of them as starting points for groups). Then it checks each data point — each person’s body weight and likes — and assigns it to the closest center. After everything has been assigned, it moves the centers to the “average position” of the points in that group. This process repeats until the clusters settle into place.&lt;/p&gt;

&lt;p&gt;In the end, instead of us having to decide exactly where the cutoffs should be (like 90–120 lbs = 80–100 likes), the algorithm discovers those clusters on its own by looking at the patterns hidden in the data.&lt;/p&gt;

&lt;p&gt;For more clarity, imagine you’re at a party where no one knows each other. At first, people are scattered randomly across the room. Then someone says, “Okay, let’s form groups based on who we naturally vibe with.” Everyone looks around, picks a spot, and gathers with the people they feel closest to. After a few minutes, some people switch groups because they realize they actually fit better with another circle. This shuffling continues until the groups feel stable, and no one wants to move anymore.&lt;/p&gt;

&lt;p&gt;That’s basically how k-means works:&lt;br&gt;
    • The “people” are your data points.&lt;br&gt;
    • The “circles” are the clusters.&lt;br&gt;
    • The moving around is the algorithm adjusting until the groups make sense.&lt;/p&gt;

</description>
      <category>machinelearning</category>
      <category>webdev</category>
      <category>programming</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Clustering</title>
      <dc:creator>Carlos Almonte</dc:creator>
      <pubDate>Sat, 06 Sep 2025 16:53:36 +0000</pubDate>
      <link>https://forem.com/carlosrambles/clustering-4k22</link>
      <guid>https://forem.com/carlosrambles/clustering-4k22</guid>
      <description>&lt;p&gt;Sometimes the data we need to evaluate is unorganized, and by this I mean the data is missing target values. Target values are the values we are trying to predict. When this happens we need a way to group the data into defining clusters; pictures of babies in one cluster, pictures of sexy ladies in another cluster, and pictures of old people in another cluster. It is very time consuming having to go over thousands of pictures and manually providing the target value for each of the pictures, this is where clustering comes into play.&lt;/p&gt;

&lt;p&gt;Another more beginner friendly example is that we can group the data the same way we might group groceries at the store. If you dump everything on the counter — apples, bananas, bread, milk, and chips — you don’t need labels to know that the apples and bananas belong in the “fruit” pile, and the bread and chips belong in the “snacks” pile. Clustering works the same way: it looks at the similarities between items and puts them into groups, even when we don’t have target labels to guide us.&lt;/p&gt;

&lt;p&gt;Think of features as the different ways you could describe an object to a friend. If you say ‘round, red, and sweet,’ they’ll probably guess you’re talking about an apple. Clustering works the same way — it looks at those descriptive features, shape, color, and taste, and puts similar items together.&lt;/p&gt;

</description>
      <category>programming</category>
      <category>javascript</category>
      <category>ai</category>
      <category>machinelearning</category>
    </item>
  </channel>
</rss>
