lschultebraucks.github.io | Homepage and Blog
//lasseschultebraucks.com/
Fri, 28 Dec 2018 17:30:21 +0000Fri, 28 Dec 2018 17:30:21 +0000Jekyll v3.7.4Why do we need Voice systems?<p>Voice Platforms like Alexa and Google Assistant became very popular in the last few years.
They are made possible through the huge progress in speech to text interpretation and natural language understanding in the last years.
Voice Systems enable users an alternative user interface and user experience.</p>
<p>In the following I want to talk about the benefits of voice systems and how they can support us in our day to day life.
I will probably be very enthusiastic and positive about this technology in this blog post.
Nevertheless there is also critics about voice systems. Therefore I will publish a counter part “Reasons against Voice Systems” in the next time.</p>
<p>But first let’s list up the benefits of voice systems.</p>
<h1 id="benefits-of-user-interaction-via-voice">Benefits of user interaction via Voice</h1>
<p>The interaction via voice provides many advantages.</p>
<h2 id="its-fast">It’s fast</h2>
<p>It is (in most cases) much faster than traditional text input.
Most people can talk much faster than they write and therefore speech
can offer more information than text in the same time to voice platforms.</p>
<p>Because we can query faster, we also get the result of our query faster and this saves us time.</p>
<h2 id="its-comfortable">It’s comfortable</h2>
<p>There are situations in our life where we can not (and where we should not, but I will mention this in the next paragraph)
use or hands to interact with out smartphone. Speech is one convenient way to transmit information even if we have to juggle torches.
There are probably not so many people who are juggling torches, but there are many situations where we can not access our smartphone
because we do other activities like showering or cooking.</p>
<h2 id="its-more-secure">It’s more secure</h2>
<p>Texting while driving is illegal and there are good reasons why:</p>
<p>The National Safety Council reports that cell phone use while driving leads to 1.6 million crashes each year. Nearly 390,000 injuries occur each year from accidents caused by texting while driving. 1 out of every 4 car accidents in the United States is caused by texting and driving. <em>General Cell Phone Statistics</em></p>
<p>By simply speaking our text messages instead of writing them we can avoid stress, save money and most important protect our health.</p>
<h2 id="its-fair">It’s fair</h2>
<p>Not every person can interact with the traditional interaction possibilities like smartphones or keyboards.</p>
<p>The estimated number of people visually impaired in the world is 285 million, 39 million blind and 246 million having low vision.
65 % of people visually impaired and 82% of all blind are 50 years and older. These are numbers of the Global Data On visual impairments
of the World Health organization in 2010.</p>
<p>Blindness is of course only one reason for people to use traditional interaction, but it is the biggest target group I can think of.</p>
<p>Because we live in the digital age content digital content is super important.
Therefore also people who are blind or have low vision should be do online whatever
everybody else does: Connect, Share, Discuss, Consume and Interact.</p>
<p>Unfortunately the content for people who are blind or have low vision is limited, even
through the use of screen readers.</p>
<p>Voice can help here to make the life for these people more fair. They can help by bringing the whole internet to these people.</p>
<p>Voice makes information overall more accessible and creates fairness in the digital age for people.</p>
<h2 id="its-simple">It’s simple</h2>
<p>Nowadays Voice Systems can (mostly) understand what we are saying through the use of natual language progressing (NLP).</p>
<p>We can simply speak to them and say them what they should do with natual language.</p>
<p>Therefore we can transmit information very simple and in a convenient way which also makes it easier for older and younger people to interact with digital systems.</p>
<h1 id="conclusion">Conclusion</h1>
<p>Voice Systems can support us in our day to day life because of various reasons. It also helps people who can not use
traditional user input interaction, to connect to the internet.</p>
<p><em>Thanks for reading! As said earlier, In the next days I will publish a counter part “Reasons against voice systems” on my blog.
Meanwhile you can follow me on <a href="https://www.twitter.com/LSchultebraucks">Twitter</a>.</em></p>
Thu, 27 Dec 2018 00:00:00 +0000
//lasseschultebraucks.com/voice%20apps/alexa/google%20assistant/2018/12/27/why-do-we-need-voice-systems.html
//lasseschultebraucks.com/voice%20apps/alexa/google%20assistant/2018/12/27/why-do-we-need-voice-systems.htmlVoice AppsAlexaGoogle AssistantHow I plan my days with Todoist and Google Calendar<p>Life can be very stressful, there are so many things to do. Therefore it is very helpful to always keep up with your tasks and organize them as best as possible.
I am currently studying Computer Science and working also next to university a couple of hours per week so
my time in the week and on weekends is very limited.
I have to optimize my whole work to get the most of it, so it is very important for me to get done what has to be done in the right time and also to not forget anything important.
But I also want to have free time in the evenings and on weekends to create time for things that are also important to me like family, friends,
sport but also to just relax.</p>
<p>Because I love technology and find it unhandy to write everything on paper so I use apps to manage what I want and have to do.</p>
<h2 id="todoist">Todoist</h2>
<p>Since over 2 years I use Todoist as a ToDo planner. I use the app to write down what I have to do and when I want to do it.
I also use it if I have to cancel subscriptions, then I create a ToDo which will remember me in X month to cancel the specific subscription.
I write ToDos when I want to work in the week, when I want to visit university, when I want to do my assignments and when I have to submit them.
With repeating tasks I can easily setup tasks that I have to do e.g. every week. I write in there just everything which is relevant for me.
Currently my state is, that if some task is not in Todoist it is not relevant to me because I won’t pay attention to the task.</p>
<p>In Todoist you can not only manage on which day you can do a certain task but you can also prioritize them and group
them by projects. I currently have over ten projects. Because there are not only apps for Android and iOS but also for Desktop
and browser the tasks are always available to me. Also it is very easy to create and reorganize tasks, e.g. by the use of natural language, which is also a huge advantage over the classical ToDo list on paper.</p>
<p>But after I use Todoist over a time I noticed that planning on which day I want to do something is not enough for me.</p>
<h2 id="google-calendar">Google Calendar</h2>
<p>Therefore I use Google Calendar to schedule exactly when to do something over the day.</p>
<p>Example: Instead of doing assignment X as a task I have working on assignment X over 3 days as a task and each task I have scheduled 1-2 hours at every day.</p>
<p>With this method I can plan exactly what I can do every day and what I can reach. Also I avoid overloading my day with tasks which can
be very demotivating. And on the opposite it is very satisfying if your ToDo list is at the end of the day is empty and
you can relax the end of the day and collect energy to be even more productive at the next day.</p>
<p>Todoist has the ability to synchronize with Google Calendar, so after I created tasks at Todoist I can switch over to Google Calendar
and set time boxes for the tasks. After I set time boxes for the tasks, I can schedule empty time boxes with tasks which I initially scheduled
on later days. Thereby I optimize my days but does not fall into temptation to overload my days.</p>
<h2 id="how-i-plan">How I Plan</h2>
<p>I plan for the whole week on the sunday and every evening I check the tasks for the next day and every couple of days
I readjust tasks if there a new urgent tasks that has to be done within the week.</p>
<p>On the Sunday I already have most of the time the tasks written down in Todoist which I have to do for the week. I check them
and add new tasks and delete task if required. After that I break tasks down if required over multiple days.
I also pick up the tasks which I haven’t worked on the last week in the planning of the new week.
Next I schedule for each day in Google Calendar the time boxes when I do what, from morning to evening.</p>
<p>On every evening I check if I have done everything I have planned. If something is left, I schedule it for the next days.
Also I readjust new tasks for the week if the task is urgent or for the weekend if the task is not urgent.</p>
<p>Every couple of days I do a little bit of optimizing which is required if many new urgent tasks has been created within the week.
This helps me to keep up my priorities and the most important and urgent things that has to be done in the week.</p>
<h2 id="i-plan-actual-work-not-only-appointments-and-events">I plan actual work, not only appointments and events</h2>
<p>Which is very important to me is that I plan next to things like deadlines I also plan time for actual for. So if I have to
submit an assignment for university I do not plan only the deadline but also I think how many hours I have to invest in it
and then I plan the actual working on the assignment at days where I have time left to do the assignment.</p>
<h2 id="its-totally-free">It’s totally free</h2>
<p>Google Calendar is free and even Google Calendar synchronisation is part of Todoist free starter plan. I currently have
as student Todoist buisness with a 70% discount whereby I just pay under 20 Euro per year. But the free starter plan should be
okay for most people out there.</p>
<p>Todoist also offers a free month of Premium to try it out. There are also sometimes coupons which
you can use to get a couple of months of Todoist premium for free. And if you reached a specific karma level you also unlock
free months of premium. You get karma if you complete tasks and it is basically a playful measurement to view how productive you are.</p>
<h2 id="conclusion">Conclusion</h2>
<p>The synergy between Todoist and Google Calendar works great for me. Both apps became part of my daily workflow over the last two years.
Over time I optimized the process, first I just used Todoist, later I added Google Calendar to it. Now I can schedule comfortable
and then work on one task concentrated without worrying about stress or that I have forgotten anything.</p>
Sun, 23 Dec 2018 00:00:00 +0000
//lasseschultebraucks.com/life/work/university/productivity/2018/12/23/how-i-plan-my-days-with-todoist-and-google-calendar.html
//lasseschultebraucks.com/life/work/university/productivity/2018/12/23/how-i-plan-my-days-with-todoist-and-google-calendar.htmlLifeWorkUniversityProductivityAbout books, e-Books and audio books<p>In the following post I want to discuss some aspects about books, e-books and audio books.</p>
<h2 id="why-i-like-the-type-book-as-a-medium">Why I like the type book as a medium</h2>
<p>I am generally a fan of any kind of books as a medium, because on the one hand it can tell interesting stories
and create beautiful places in your imagination which but on the other hand they can teach you about all kind of topics
you are interesting in.
Of course they cant teach you everything, you have to experience many things in your life on your own, but they can you give idea
and of course entertain you.</p>
<h2 id="what-kind-of-books-i-am-interesting-in">What kind of books I am interesting in</h2>
<p>I read different kind of books. Fiction and non fiction.</p>
<h3 id="fiction-books">Fiction books.</h3>
<p>On the fiction side I read many books which fall under the category
Science fiction and fantasy. I like stories which take place in a different world and tell a message which can be applied to our world.
The intention of reading fiction books is of course not only because they teach me something, rather because the entertain me and open my eyes.</p>
<h3 id="non-fiction-books">Non fiction books</h3>
<p>Next to fiction books I read also non fiction books. I read this books to learn about specific topics (like eg. Artificial Intelligence and what it means
to our society) and so called self development books, which tell you how to be successful in life, be more happier and more productive.
Many modern self development books are written interesting and cover current topics like how technology affect our day to day life and
therefore can give you directly tips how to create a more happier life. When reading books I often start to think about
activities I do at my day to day basis and how I can optimize them. I am a big fan of optimizing my life, because instead of money
my time is limited and therefore can be incredible valuable for myself.</p>
<h2 id="difference-about-books-e-books-and-audiobooks">Difference about books, e-books and audiobooks</h2>
<p>Because I want to optimize my life, I have considered of the last years what type of book medium - books, e-books or audio books -
can create the biggest value to me.</p>
<h3 id="books">Books</h3>
<p>Classical books have many advantages and disadvantages in my opinion. They are physical, which is great because you can put them on your book shelf
and present them and borrow then to friends or family, but on the other side it may be problematic if you want to carry on multiple books on your way to work or university with you because they take
a huge amount of place in your backpack. Nevertheless I think they can give you the best reading experience when you are at home.
Also many books like e.g. technical books or programming books are great as classic books, because you can page through the book very easily, which is a little
bit more difficult if you consider e-books.</p>
<h3 id="e-books">E-books</h3>
<p>E-Books are great if you travel a lot or just want to read while you are in the train or in the bus to work or university. You can fit a lot of books in a tiny device which can
be always with you in your backpack. Also many e-Books are a little bit cheaper next to classical books. However they are în my opinion not so elegant
like classic books, because they are not physical and you need an extra e-book reader if you want to have the full experience
of reading. You can read on your smartphone, but this would not be the experience of reading you would have on a separate device.</p>
<p>Disclaimer: I had an e-book reader for around one and a half years. A month ago or so the screen broke inside the device because of unknown reason.
Unfortunately the warranty does not include this kind of damage, so I currently does not have any functional e-book reader.</p>
<h3 id="audio-books">Audio Books</h3>
<p>If you are to lazy and sometimes to tired to read, you does not have to miss books. Fortunately there are audio books.
They are in my opinion the better version of e-books. If you have to switch bus when driving to work you don’t have to
interrupt your reading experience, which overall optimizes the amount of “pages” you will be able to experience. Also can
relax exciting stories and adventures even if you are tired and want to close your eyes. I currently try out audible,
so can get e-books digital relatively cheap.</p>
<h2 id="conclusion">Conclusion</h2>
<p>I experienced books, e-books and currently I hear a lot of audio books. E-books are currently my last choice, because
my last e-books reader just broke as mentioned earlier and audio books are in my opinion the better e-books. Nevertheless, I don’t
want to miss classical books, because for some use cases physical books are more helpful, e.g. if you dont want to read a book from the first page to last page,
rather you just want to have it as a reference, like e.g. programming books.</p>
Sat, 15 Dec 2018 00:00:00 +0000
//lasseschultebraucks.com/life/books/2018/12/15/about-books-ebooks-and-audio-books.html
//lasseschultebraucks.com/life/books/2018/12/15/about-books-ebooks-and-audio-books.htmlLifeBooksDon't Think Technology orientated - Think Solution orientated<p>A problem I always had and I think every developer has is that the amount of diverse and interesting technologies out there is huge.
It is BIG and you could literally jump from one to the other every day.</p>
<p>Yesterday I had a very interesting conversation with a senior developer. We talked about different things among others about technologies
and the rapid change of technologies. I told him that I always have problems to keep on one project and I just jump after a couple of weeks
after I have played and get started with a new technology like a framework or a new programming language and then jumped to another one.
He responded that this is probably the wrong way and I should act more solution orientated rather than technology orientated.</p>
<p>What did he mean by that? Is it wrong to learn different technologies and different programming languages?</p>
<p>Of course not. But it is probably wrong to live technology driven instead of solution driven. I mean it is super nice
to always keep up with technology and stay on the hype train, but once this is super hard and you will never become an expert in anything by that.
The senior developer I talked to called himself a Full Stack, but not because he always keep up with the latest and different JavaScript frameworks.
He applies new technologies to problems the want to solve and therefore builds real solutions instead of just playing with new technology.</p>
<p>Next he also suggested me to contribute on OpenSource project if I have no idea for a own project. There a multiple reasons why you should
contribute to OpenSource software as a developer and I don’t want to go into detail here rather I want to point out some points.
With your specific expertise you can make huge impacts, even it is a trivial and simple task for you. And you don’t also give your work to others
you will learn a lot by contributing to OpenSource.</p>
<p>All in all the conversation made two points clear for me: First think solution orientated rather than technology orientated.
It will bring your skill set further even if you want to be a Full Stack developer. Next contributing to OpenSource can be very important for you
as a Junior Developer. It is basically a win win win situation. You will learn something new, you will create real value and your will create
attention to potential employers.</p>
<p>This post should remind me about the points that got clear for me after the conversation. I hope this will help also other young developers who want to learn and grow.</p>
Tue, 04 Dec 2018 00:00:00 +0000
//lasseschultebraucks.com/life/work/2018/12/04/dont-think-technology-orientated-think-solution-orientated.html
//lasseschultebraucks.com/life/work/2018/12/04/dont-think-technology-orientated-think-solution-orientated.htmlLifeWorkI abstained from caffeine for six months<p>From mid march to mid september this year I abstained from caffeine. So a total period of 6 months or 26 weeks or 180 days of abstinence from all kind of Coffee, Black Tea, Cola or Energy Drinks.</p>
<p>Why did I did this? It was an experiment to see how my body react on this abstinence. How I feel and live without caffeine and 180 days without coffee in the morning.</p>
<p>For a further understanding of this experiment I have to tell a bit about my pre experiment caffeine habits.
In the past I normally drunk a big cup of coffee in the morning. I drink coffee black without milk or sugar.
I thought I need this how many people think they need a cup of coffee in the morning to get energized and motivated.
Further I drunk at least one but most of the times more than one cup of coffee over the day. I drink very less other caffeine drinks, my caffeine consume existed mostly out of coffee.</p>
<p>My reasons for the experiment was different.
I wanted to do the opposite of what people normally do.
I wanted to see how my body and mind react on the abstinence of caffeine.
I wanted to check if my body neutralize the caffeine level and can live without coffee after one or two months without caffeine.
I wanted to see when I have down phases over the day and how I can use the up phases for maximize productivity.</p>
<p>The first days and week was very hard. It was very uncommon to not drink coffee in the morning and over all not to drink coffee.
But instantly I noticed that the abstinence of coffee also gives you more time for other stuff in the morning. It maybe only saves you up 5 minutes, but 5 minutes in the morning is worth gold.</p>
<p>After a few weeks a new routine without caffeine caught me and over the night it seemed normal for me to abstain from coffee in the morning. I was very glad that it developed like this, but soon I observed that something is missing.</p>
<p>Around the noon hours I felt tired and especially after lunched it was very hard for me to go back to study or work. It overall improved over time, but I clearly noticed when my down phases were.</p>
<p>Often times I substituted the coffee with a lot of water. Sometimes I drunk tea, but that was more rare than regularly. I noticed that drinking water and staying hydrated can have an amazing effect and wake my body up and clear my mind. And not only in the morning, also in phases where I was normally down.</p>
<p>The months passed, a big study phase came and I was there without outlook on a cop of coffee. I somehow managed to survive. I did a lot of other things like a lot of sport.</p>
<p>In mid september I started again to drink coffee. But my behaviour changed. I now don’t drink coffee before 11 AM and not after 4 or 5 PM. I also do not drink coffee every day, I would say only around 4-5 days per week.</p>
<p>I have the feeling now that I can concentrate longer throughout the day without depending heavily on caffeine but also not without to miss it.</p>
<p>My experience showed me that caffeine in the right dose and at the right time can have a great effect and boost your energy and motivation level.</p>
<p>I am drinking coffee again sine 1 1/2 months and I feel great because I know how I can use it effectively now.</p>
<p>Just some words about my journey and my experience.</p>
Mon, 29 Oct 2018 00:00:00 +0000
//lasseschultebraucks.com/life/2018/10/29/i-abstained-from-caffeine-for-six-months.html
//lasseschultebraucks.com/life/2018/10/29/i-abstained-from-caffeine-for-six-months.htmlLifeTIL: Logistic Regression<p>In the last few days I learned about Logistic Regression as one method to solve classification problems.</p>
<p>Classification problems are similar to <a href="https://lasseschultebraucks.com/machine/learning/2018/04/30/til-cost-functions-for-linear-regression.html">regression problems</a>, except that the values which will be predicted by our hypothesis will be discrete numbers.
E.g. a binary classification problem only predicts values in which y can take <script type="math/tex">0</script> or <script type="math/tex">1</script>. So there are just two classes to predict.
An example for binary classification would be predicting if an incoming email is spam or not spam. There would be two classes: One class of emails
which are spam (<script type="math/tex">y = 0</script>) and one class of emails which are not spam (<script type="math/tex">y = 1</script>). Another example for binary classification would be credit card fraud detection. There would also be two classes:
One class of transactions which are fraud (<script type="math/tex">y = 0</script>) and one class of transactions which are not fraud (<script type="math/tex">y = 1</script>).</p>
<p>Of course classification problems can also have more classes than two. One classification problem with three classes is the famous <a href="https://en.wikipedia.org/wiki/Iris_flower_data_set">iris data set</a>. The data set
consists of 150 samples of three different flowers. Every flower in the data set is described by four features (sepals and petals length and width).</p>
<p>One form of the hypothesis function <script type="math/tex">h_{\theta} (x)</script> for a binary classification problems would be as following:</p>
<p><script type="math/tex">h_{\theta} (x) = g ({\theta}^T x)</script> where <script type="math/tex">z = \theta ^T x</script> and <script type="math/tex">g(z) = \frac{1}{1+ \epsilon^{-z}}</script></p>
<p>This form of hypothesis for classification uses the sigmoid function <script type="math/tex">g(z) = \frac{1}{1+ \epsilon^{-z}}</script>. It can there either be called sigmoid function or
logistic function. In the following I will use logistic function and logistic regression model to describe the hypothesis.</p>
<p>The Logistic function <script type="math/tex">g(z)</script> looks as following:</p>
<p><img src="https://upload.wikimedia.org/wikipedia/commons/8/88/Logistic-curve.svg" alt="" /></p>
<p>Because the function maps any real number to <script type="math/tex">(0,1)</script> it is very useful for defining a hypothesis for a binary classification problem.</p>
<p>Every <script type="math/tex">h_{\theta} (x) \geq 0.5</script> will be classified as <script type="math/tex">y = 1</script> and every <script type="math/tex">% <![CDATA[
h_{\theta} (x) < 0.5 %]]></script> will be interpreted as <script type="math/tex">y = 0</script>.</p>
<p>In the logistic function every inputs which is greater or equal to zero will be greater than or equals than 0.5 as output (like you can see above in the graph).</p>
<p>Therefore we can say that every <script type="math/tex">\theta^T x \geq 0</script> will be classified as <script type="math/tex">y = 1</script> and every <script type="math/tex">% <![CDATA[
\theta^T x < 0 %]]></script> will be classified as <script type="math/tex">y = 0</script>.</p>
<p>A decision boundary is called the line which separates the are <script type="math/tex">y = 0</script> and <script type="math/tex">y = 1</script>. The line will be directly created by the hypothesis function.</p>
<p>E.g. if <script type="math/tex">\theta = \begin{pmatrix} 3 \\ -1 \\ 0 \\ \end{pmatrix}</script> then <script type="math/tex">y = 1</script> if
<script type="math/tex">3 + (-1)x_1 + 0x_2 \geq 0</script> which results to <script type="math/tex">% <![CDATA[
x_1 < 3 %]]></script> . So the decision boundary will be a straight vertical line one the graph where <script type="math/tex">x_1 = 3</script>.
Everything on the left excluding the points on <script type="math/tex">x_1 = 3</script> will be in the class <script type="math/tex">y = 1</script> and everything on the right including the points on <script type="math/tex">x_1 = 3</script> will be in the class of <script type="math/tex">y = 0</script>.</p>
<p>Logistic Regression does also work for non linear models through changing the shape of <script type="math/tex">\theta</script>, e.g. through feature engineering.</p>
Wed, 16 May 2018 00:00:00 +0000
//lasseschultebraucks.com/machine/learning/2018/05/16/til-logistic-regression.html
//lasseschultebraucks.com/machine/learning/2018/05/16/til-logistic-regression.htmlMachineLearningTIL: Multivariate Linear Regression, Polynomial Regression and more about Gradient Descent<p>Today I learned about Multivariate Linear Regression, Polynomial Regression and more about Gradient Descent.</p>
<p>I also created a Python script which let me create the layout for posts, especially TIL posts much faster.</p>
<p>As I mentioned in a post a couple of days ago I learned more about multivariate Linear Regression. So Linear Regression
with multiple features. The hypothesis function with multiple features looks as following:</p>
<script type="math/tex; mode=display">h_{\theta_0} (x)= \theta_0 + \theta_1x_1 + + \theta_2x_2 + ... + \theta_nx_n</script>
<p>By using the definitions of matrix multiplication, the multivariate hypothesis function can als be written as following:</p>
<script type="math/tex; mode=display">% <![CDATA[
h_ {\theta_0} (x) = \begin{pmatrix}\theta_0 && \theta_1 && \dots && \theta_n \end{pmatrix} \begin{pmatrix}x_0 \\\ x_1 \\\ \vdots \\\ x_n\end{pmatrix} = \theta^T x %]]></script>
<p>where $ x_0^{(i)} $ is defined as $ 1 $ ($ \theta_0 $ works just as a constant).</p>
<p>The form of gradient descent for multivariate linear regression looks as following:</p>
<script type="math/tex; mode=display">\text{repeat until convergence: \{} \\ \theta_j := \theta_j - \alpha \frac{1}{m}\sum_{i=1}^m(h_{\theta}(x^{(i)})-y^{(i)})*x_j^{(i)} \\ \text{\}}</script>
<p>$ x_0^{(i)} $ is again defined as $ 1 $. The rest basically works much <a href="https://lasseschultebraucks.com/machine/learning/2018/04/30/til-cost-functions-for-linear-regression.html">like with one variable</a>.</p>
<p>Some words about Feature Scaling and Learning Rate. Feature scaling is important, because it speeds up the gradient descent.
$ \theta $ basically descend quicker on smaller ranges than on larger rangers. Ideally all variables look like $ -1 <= x_{(i)} <= 1 $.</p>
<p>A feature can be scaled with following formula:</p>
<script type="math/tex; mode=display">x_i := \frac{x_i - \mu_i}{s_i}</script>
<p>where $ \mu_i $ is the average of all the value for feature $ i $ and $ s_i $ is the range of values $ (max-min) $. Example: If $ x_i $ is a feature with range of values from 10 to 100 and a mean of 55, then</p>
<script type="math/tex; mode=display">x_i := \frac{feature - 55}{90}</script>
<p>Again some words to the Learning Rate $ \alpha $. It is important that $ \alpha $ is not to large, else $ J(\theta) $ may not decrease and not converge. On the other side, if $ \alpha $ is too small, $ J(\theta) $ will converge very slowly.</p>
<p>Last but not least some more words to Polynomial Regression: The hypothesis does not be a linear function, it can be also a polynomial function, e.g. a quadratic function:
$ h_{\theta_0} (x) = \theta_0 + \theta_1 x_1 + \theta_2 x_2^2 $. I will probably write more about Polynomial Regression in the next days. Just wanted to note them here.</p>
Sun, 06 May 2018 00:00:00 +0000
//lasseschultebraucks.com/machine/learning/2018/05/06/til-multivariate-linear-regression-polynomial-regression-and-more-about-gradient-descent.html
//lasseschultebraucks.com/machine/learning/2018/05/06/til-multivariate-linear-regression-polynomial-regression-and-more-about-gradient-descent.htmlMachineLearningTIL: Interfaces in TypeScript, Multivariate Regression and DFAs.<p>Today I learned (and yesterday) about Interfaces in TypeScript and how you can use them correctly to use them as your DTO in you application,
multivariate regression and a bunch of other topics from my university courses. A lot about DFA, e.g. how to minimize them and how to build the product out of two DFAs.</p>
<p>There was a lot of troubleshooting in the last two days because of my internet connection. Now I have to switch the router and hope that then my internet connection will come back.
Until then I will just have a connection through a hotspot which is hosted on my mobile phone…</p>
<p>Back to the topic: In the past I have used normal classes in TypeScript for dealing with objects, especially DTOs. Yesterday I learned that Interfaces are a much better solution for dealing
with DTOs in Typescript. You just declare the attributes in the Interface and create an object of the type from the interface with following notation:</p>
<script src="https://gist.github.com/LSchultebraucks/73511fd1411ad220f7b060ac5591dcc5.js"></script>
<p>Next topic: Multivariate regression, which is basically the same as <a href="https://lasseschultebraucks.com/machine/learning/2018/04/30/til-cost-functions-for-linear-regression.html">linear regression with one variable</a>,
but except with multiple variables. I will probably write more about them in the next days.</p>
<p>Last but not least I learned a lot in university too, mainly more advanced topics about DFAs like minimizing or creating the product out of two DFAs.</p>
Thu, 03 May 2018 00:00:00 +0000
//lasseschultebraucks.com/til/2018/05/03/til-interfaces-in-typescript-multivariate-regression-and-a-lot-of-other-stuff.html
//lasseschultebraucks.com/til/2018/05/03/til-interfaces-in-typescript-multivariate-regression-and-a-lot-of-other-stuff.htmlTILTIL: Minimizing cost functions with gradient descent<p>Today I learned about gradient descent and how you can minimize cost function for liner regression problems with gradient descent.</p>
<p>In <a href="https://lasseschultebraucks.com/machine/learning/2018/04/30/til-cost-functions-for-linear-regression.html">yesterdays TIL</a>
I wrote about linear regression and cost functions (also known as MSE) for measuring the accuracy of a hypothesis in linear regression problems.</p>
<p>So what is a gradient descent? With gradient descent you can minimize a cost function by finding the local minimum.
Essentially gradient descent figures out which <img src="https://latex.codecogs.com/gif.latex?%5Ctheta" alt="" />s we have to choose for optimizing our hypothesis.
The gradient descent algorithms is as following:</p>
<p><em>repeat until convergence:</em></p>
<p><img src="https://latex.codecogs.com/gif.latex?%5Ctheta_j%20%3A%3D%20%5Ctheta_j%20-%20%5Calpha%20%5Cfrac%7B%5Cdelta%7D%7B%5Cdelta%20%5Ctheta_j%7D%20J%28%5Ctheta_0%2C%5Ctheta_1%29" alt="" /></p>
<p><em>J = 0,1</em> representing the feature index numbers. For each iteration every <img src="https://latex.codecogs.com/gif.latex?%5Ctheta" alt="" /> should update simultaneously.</p>
<p><img src="https://latex.codecogs.com/gif.latex?%5Calpha" alt="" /> represents the learning rate. If the learning rate is to large, gradient descent can overshoot the minimum and might not able to find it.
If the learning rate is to small, gradient descent can be slow.</p>
<p><img src="https://latex.codecogs.com/gif.latex?%5Cfrac%7B%5Cdelta%7D%7B%5Cdelta%20%5Ctheta_j%7D%20J%28%5Ctheta_0%2C%5Ctheta_1%29" alt="" /> is our <a href="https://en.wikipedia.org/wiki/Derivative">derivative</a>.</p>
<p>The following figure shows an example of gradient descent. The <em>x</em> and <em>z</em> axis are <img src="https://latex.codecogs.com/gif.latex?%5Ctheta" alt="" />s and the <em>y</em> axis is the value of our cost function <em>J</em> of our hypothesis <em>h</em>.
With each iteration our hypothesis changes and we approximate at the local minimum.</p>
<p><img src="//lasseschultebraucks.com/assets/gradient_descent_method.png" alt="" /></p>
Tue, 01 May 2018 00:00:00 +0000
//lasseschultebraucks.com/machine/learning/2018/05/01/til-minimizing-cost-functions-with-gradient-descent.html
//lasseschultebraucks.com/machine/learning/2018/05/01/til-minimizing-cost-functions-with-gradient-descent.htmlMachineLearningTIL: Cost functions for linear regression<p>Today I learned about cost functions, which are also known as mean square error (MSE), for linear regression problems.</p>
<p>I just started the <a href="https://www.coursera.org/learn/machine-learning/home/welcome">Machine Learning Course</a> on Coursera by Andrew Ng to
get a better understanding of how Machine Learning works and extends my knowledge in the field.</p>
<p>To recap: Linear regression is a way to model a relationship between <em>X</em> and <em>y</em>.
There is also multivariate linear regression where there are multiple <em>X</em>s to predict a <em>y</em>. Linear regression with one variable can be described as following:</p>
<p><img src="https://latex.codecogs.com/gif.latex?h_%5Ctheta%28x%29%20%3D%20%5Ctheta_0%20+%20%5Ctheta_i%20x" alt="" /></p>
<p>To measure the accuracy of the hypothesis above, there can be use a cost function, which takes the average difference of all the hypothesis results and where <em>m</em> is the number of training examples.</p>
<p><img src="https://latex.codecogs.com/gif.latex?J%28%5Ctheta_0%2C%20%5Ctheta_1%29%20%3D%20%5Cfrac%7B1%7D%7B2m%7D%5Csum_%7Bi%3D1%7D%5E%7Bm%7D%28h_%5Ctheta%28x_%7Bi%7D%29-y_%7Bi%7D%29%29%5E2" alt="" /></p>
<p>In other words: It is the mean of the difference between the predicted value and the actual value of the hypothesis. Another name for the cost function is also
mean squared error (MSE).</p>
<p>For the hypothesis we have to chose <img src="https://latex.codecogs.com/gif.latex?%5Ctheta_0" alt="" /> and <img src="https://latex.codecogs.com/gif.latex?%5Ctheta_1" alt="" />. Then we can check the hypothesis with the cost function above.
The result of the function is always non-negative and values which are closes to zero are better, because it supports the hypothesis. The goal is to minimize <img src="https://latex.codecogs.com/gif.latex?J%28%5Ctheta_0%2C%20%5Ctheta_%29" alt="" />
to build an optimal hypothesis.</p>
<p>An example to make things clear: There is an existing training set with the values <em>(1/1)</em>, <em>(2/3)</em> and <em>(3/5)</em>. We choose -1 for <img src="https://latex.codecogs.com/gif.latex?%5Ctheta_0" alt="" /> and 2 for <img src="https://latex.codecogs.com/gif.latex?%5Ctheta_1" alt="" />.
Maybe you already can imagine this graph, and the linear function and therefore you know that the values for <img src="https://latex.codecogs.com/gif.latex?%5Ctheta_0" alt="" /> and <img src="https://latex.codecogs.com/gif.latex?%5Ctheta_1" alt="" />
are pretty accurate.</p>
<p><img src="https://latex.codecogs.com/gif.latex?%5Cfrac%7B1%7D%7B2*3%7D%5Csum_%7Bi%3D1%7D%5E%7B3%7D%28-3+3x_i-y_i%29%20%3D%20%5Cfrac%7B1%7D%7B2*3%7D*%28%28-1+2+1-2%29%5E2+%28-1+2*2-3%29%5E2+%28-1+2*3-5%29%5E2%29%20%3D%20%5Cfrac%7B1%7D%7B2*3%7D*%280%5E2+0%5E2+0%5E2%29%20%3D%20%5Cfrac%7B1%7D%7B2*3%7D*0%20%3D%200" alt="" /></p>
<p>Perfect! For the 3 values above <img src="https://latex.codecogs.com/gif.latex?%5Ctheta_0" alt="" /> and <img src="https://latex.codecogs.com/gif.latex?%5Ctheta_1" alt="" /> are optimal.</p>
Mon, 30 Apr 2018 00:00:00 +0000
//lasseschultebraucks.com/machine/learning/2018/04/30/til-cost-functions-for-linear-regression.html
//lasseschultebraucks.com/machine/learning/2018/04/30/til-cost-functions-for-linear-regression.htmlMachineLearning