<?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[Backtick Technologies - Medium]]></title>
        <description><![CDATA[News and blog posts relating to Backtick Technologies, an energetic, modern consultancy company specializing in data science and AI infrastructure. - Medium]]></description>
        <link>https://medium.com/backtick?source=rss----43a695cc683a---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Backtick Technologies - Medium</title>
            <link>https://medium.com/backtick?source=rss----43a695cc683a---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 28 May 2026 08:44:33 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/backtick" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com" rel="hub"/>
        <item>
            <title><![CDATA[LightGBM: Predicting Titanic survivors with Gradient Boosting]]></title>
            <link>https://medium.com/backtick/lightgbm-predicting-titanic-survivors-with-gradient-boosting-ad45a8c29381?source=rss----43a695cc683a---4</link>
            <guid isPermaLink="false">https://medium.com/p/ad45a8c29381</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[titanic-dataset]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[backtick]]></category>
            <category><![CDATA[lightgbm]]></category>
            <dc:creator><![CDATA[Fredrik Olsson]]></dc:creator>
            <pubDate>Thu, 12 Sep 2019 09:11:49 GMT</pubDate>
            <atom:updated>2019-09-12T09:13:55.241Z</atom:updated>
            <content:encoded><![CDATA[<p>2019–08–02</p><p>Fredrik Olsson</p><p>One of the most powerful techniques for building predictive Machine Learning models is the Gradient Boosting Machine. Gradient boosting is widely used in both industry and by Machine Learning competition winners, and the method can be used for a lot of different problems like regression, binary classification and multi-class classification. In this post, we will turn our focus to gradient boosting and try to get an understanding of what this algorithm does and how it works, as well as applying gradient boosting to the Titanic disaster dataset, using the gradient boosting framework LightGBM.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qWe0fqSdbHl9auz2zRfQjg.png" /></figure><h3>Titanic disaster dataset</h3><p>The Titanic disaster dataset contain information about the passengers on board the Titanic and whether they survived or not. More precisely, the dataset contain the following information for every passenger:</p><ul><li><strong>Survived</strong>: Whether the passenger survived or not</li><li><strong>Sex</strong>: The sex of the passenger</li><li><strong>Age</strong>: The age of the passenger</li><li><strong>Fare</strong>: How much the passenger payed for the ticket</li><li><strong>Ticket class</strong>: Whether the ticket was a 1st, 2nd or 3rd class ticket</li><li><strong>Family size</strong>: How many family members the passenger had on board the ship</li><li><strong>Title</strong>: Whether the title of the passenger was Mr, Mrs, Master or Miss (indicating if the passenger was married or not)</li><li><strong>Embarked</strong>: Which of the three places the passenger embarked on the ship</li></ul><p>Age, Fare and Family size are numerical features, while Survived and Sex are binary features (False/True, 0/1). Ticket class, Title and Embarked are all categorical features, i.e. they can take a fixed number of values (larger than two). To represent these categorical features, we use one-hot encoding. This means that each categorical feature are split in one binary feature for every category. For example, if a passenger bought a 2nd class ticket, this will be represented in the following way:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/284/1*Xu0aYMT5525o8zO8bXETUA@2x.png" /></figure><p>In total, this dataset contain 892 data points (892 passengers), and the dataset has been split in a training set of size 792 that will be used to train the model and a test set of size 100 that we will use to test the performance of the model.</p><p>Our target is the Survival variable. Since this is a binary variable, the problem we have here is a binary classification problem — we want to predict if a passenger survived the Titanic disaster or not.</p><h3>Baseline model</h3><p>To have something to compare our gradient boosting model’s performance with, we start by performing a standard method for binary classification, namely logistic regression. As an evaluation metric, we will use weighted F1-score. The F1-score is based on precision and recall, and can for each class be computed as:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/332/1*Py08pWlgsif9U7u-TS11NQ@2x.png" /></figure><p>The weighted F1-score is a weighted sum of the F1-scores for each class:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/521/1*h5VwSWHpCud6e9_C1d-Mig@2x.png" /></figure><p>where <em>W₀</em> and <em>W</em>₁<em> </em>are the proportion of data points belonging to class 0 and class 1 respectively, in the test set.</p><p>Training a logistic regression model on the training set, and then evaluating the model on the test set gives us the following result:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/397/1*iZGticVwOzyLJG_u1ZQjjQ@2x.png" /></figure><p>We get the following metrics:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/422/1*y_Z16MyrvAiEB0K_VYEt1A@2x.png" /></figure><p>and since there are 64 data points in class 0 and 36 data points in class 1, in the test set, we get the following weighted F1-score for the logistic regression model:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/519/1*MB0zcJ1TsiE0RsspRWZ3EQ@2x.png" /></figure><p>This result is already really good, but hopefully we will be able to beat it with our gradient boosting model.</p><h3>Gradient boosting</h3><p>Before we move on to implementing a gradient boosting model on the Titanic disaster dataset, we start by explaining what gradient boosting does and how it works.</p><p>Gradient boosting uses an ensemble of decision tree learners. Now, if you have heard of the Random Forest algorithm, the concept of using an ensemble of decision tree learners may sound familiar, since random forests uses this as well. There is however, a big difference compared to gradient boosting in how these tree learners are constructed. In a random forest, each tree is created independently of the others and the models weigh their respective result together equally. In gradient boosting, we let each new tree be based on the prediction of the previous trees, so that they can learn from the mistakes the previous trees made. This is the fundamental idea in boosting: converting weak learners into strong learners.</p><p>By a weak learner we mean a model whose performance is at least slightly better than random chance. In a random forest each tree is created independently, so these trees are all strong learners by themselves, but in gradient boosting we want room for improvement so they can learn from each other. To make sure that a decision tree is indeed a weak learner, we can limit its depth, number of leaves and set a minimal number of data points that need to be in a leaf.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vYfjWfRbE7XcxK7LyyMc9w@2x.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Kwj2uk7mCr9pQPRsIWVmIw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RQ7qpBZVFuQcw7UZnGKZzw.png" /></figure><h3>LightGBM model</h3><p>Hopefully, we have now got a pretty good understanding of what the gradient boosting method does. Now it is time to implement a gradient boosting model on the Titanic disaster dataset. There are several frameworks one can use, and we will use LightGBM, which is a gradient boosting method developed by Microsoft, that is implemented with several adjustments to improve things like time and memory efficiency, accuracy and parallel learning.</p><p>For many machine learning algorithms, there are only a few parameters and the default settings often works the best, or at least very well. This makes these algorithms easy to implement. For example, this is the case for our logistic regression model. In gradient boosting however, we have a lot of different parameters that we can specify and the default settings are almost never the best solution. To do the parameter tuning, one often does a cross-validation analysis using e.g. grid search, that is we train the model on a lot of combinations of different parameter values, and see which performs best on a cross-validation set according to some evaluation metric.</p><p>After plenty of parameter tuning, we got the following result by applying our LightGBM model on the Titanic disaster dataset:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/287/1*hub09SU5lDaR2nxVJHMdew@2x.png" /></figure><p>and calculating precision, recall and F1-score for each class in the same way as we did for the logistic regression model, we get the following weighted F1-score:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/506/1*gkIwpe_qsf7TAV_Y1WBQ1A@2x.png" /></figure><p>which is slightly better than the weighted F1-score of 0.88 we got with logistic regression.</p><h4>Custom loss function</h4><p>So, we were able to improve the results compared to the baseline model. Per- haps we can do even better. Looking at the predictions from the LightGBM model, we see that there are rather many false negatives compared to false positives. Maybe we can improve the results with a loss function that punishes false negatives more than false positives. As you might have noticed, the gradient boosting algorithm is not expressed in a specific loss function, but just as a general loss function <em>L</em>. This makes it possible for gradient boosting to tackle several different problems like regression, binary classification and multi-class classification, but also enables us to chose our own loss function. Since we need the gradient of the loss function, we just need to make sure that our loss function is differentiable.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/777/1*_3SkEa8GGnhaF6AGqV5scA@2x.png" /></figure><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/969d84b1f28802925d8dddebd7e213f6/href">https://medium.com/media/969d84b1f28802925d8dddebd7e213f6/href</a></iframe><p>Now we can try out our custom loss function in the LightGBM model, for different values of <em>β</em>. With <em>β</em> = 2.5, we get the same number of false negatives and false positives, but the overall performance has decreased (F1-score= 0.86), so this is not a better solution. However, with <em>β</em> = 1.5, we are actually able to increase the performance from the previous model (but still having a certain imbalance between false negatives and false positives). We get the following results:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/322/1*CzP77gZzJK6hkF8xg5MJ7A@2x.png" /></figure><p>yielding the weighted F1-score below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/515/1*daKqwgjYhBTyRSugUaN9Sg@2x.png" /></figure><p>which is a slight improvement on our first LightGBM model.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ad45a8c29381" width="1" height="1" alt=""><hr><p><a href="https://medium.com/backtick/lightgbm-predicting-titanic-survivors-with-gradient-boosting-ad45a8c29381">LightGBM: Predicting Titanic survivors with Gradient Boosting</a> was originally published in <a href="https://medium.com/backtick">Backtick Technologies</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Formalizing Backtick Technologies AB]]></title>
            <link>https://medium.com/backtick/formalizing-backtick-technologies-ab-761241b61949?source=rss----43a695cc683a---4</link>
            <guid isPermaLink="false">https://medium.com/p/761241b61949</guid>
            <category><![CDATA[backtick]]></category>
            <category><![CDATA[sweden]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Oskar Handmark]]></dc:creator>
            <pubDate>Wed, 21 Nov 2018 08:59:55 GMT</pubDate>
            <atom:updated>2018-11-21T14:17:02.448Z</atom:updated>
            <content:encoded><![CDATA[<p>Formalizing Backtick Technologies AB</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6uRClCCJyvoSh5zGONx6hQ.jpeg" /></figure><p>We have some very exciting news to share!</p><p>Late september, the formalization of Backtick Technologies as a company completed. Backtick Technologies will focus on creating exciting, impactful software in areas related to data engineering, machine learning, artificial intelligence and full stack development.</p><p><a href="https://backtick.se/news/formalizing-backtick-technologies-ab">https://backtick.se/news/formalizing-backtick-technologies-ab</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=761241b61949" width="1" height="1" alt=""><hr><p><a href="https://medium.com/backtick/formalizing-backtick-technologies-ab-761241b61949">Formalizing Backtick Technologies AB</a> was originally published in <a href="https://medium.com/backtick">Backtick Technologies</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>