<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Daniel Cornea on Medium]]></title>
        <description><![CDATA[Stories by Daniel Cornea on Medium]]></description>
        <link>https://medium.com/@daniel-cornea?source=rss-43bde7a8c7c1------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*mwVi00q2boXXjF5J.jpeg</url>
            <title>Stories by Daniel Cornea on Medium</title>
            <link>https://medium.com/@daniel-cornea?source=rss-43bde7a8c7c1------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 19 Nov 2026 16:24:16 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@daniel-cornea/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Yet another stock price predicting attempt]]></title>
            <link>https://daniel-cornea.medium.com/an-attempt-to-predict-the-next-closing-price-per-share-of-a-1654e75c8a3e?source=rss-43bde7a8c7c1------2</link>
            <guid isPermaLink="false">https://medium.com/p/1654e75c8a3e</guid>
            <dc:creator><![CDATA[Daniel Cornea]]></dc:creator>
            <pubDate>Mon, 18 Apr 2022 15:01:08 GMT</pubDate>
            <atom:updated>2022-04-29T13:59:56.558Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Project Definition</strong></p><blockquote>This is part of the Udacity’s Data Scientist Nanodegree, you can find all the code discussed in this article <a href="https://github.com/DanielCornea/Predictor">here</a></blockquote><p><strong>Project Overview</strong></p><p>With this project, I am attempting to build a simple stock predictor based on the power of neural networks.</p><p><strong>Problem statement</strong></p><p>The problem that I am attempting to solve is given by the hardship in reliably predicting the stock movements with an acceptable accuracy. In order to solve this, I am building a stock predictor model.</p><p>I try to solve this by creating a model that looks at the n past closing prices and attempts to predict the next n+1.</p><p>In layman terms, we look back for lets say 1 year of dates and prices and attempt to predict the next 1 day. We do this by looking back only three days back for this one year period. A bit confusing, but more details will come.</p><p><strong>Metrics</strong></p><p>The sole metric used is the accuracy by which the predictor can predict, based on past data, future unseen before stock quotes expressed in the mean of differences between actual and predicted stock prices divided by the last stock price.</p><p>In other words, we take the predicted data, we compute the differences between the actual and predicted data and average them. Now this average is divided by the last actual price of the share. This way let’s say the price of a share is always 1000 and the model always predicts 1020 it means that the metric for this model, in this scenario will be 20/1000, or 2%.</p><p><strong>Analysis</strong></p><p><strong>Data Exploration</strong></p><p>The data that I am using in this project is obtained from yahoo via the finance package. It is a simple table with the respective columns.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/964/1*BPVia-FpEzMqE98R-Fh3wQ.png" /></figure><p>The data is already curated and cleaned.</p><p><strong>Data Visualisation</strong></p><p>In the below photo you can see how the dat for Microsoft looks like. Note that this is a time series that goes back for 5 years</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/796/1*3sMjNiqMvVSlTnoN3x6MPA.png" /></figure><p><strong>Methodology</strong></p><p><strong>Data Preprocessing</strong></p><p>The entry data for the model will be the scaled stock prices and the day-to-day changes in closing prices. This will be split furthermore in training and test data sets.</p><p>The scaled stock prices are scaled on 0 to 1 scale. Meaning that the highest gets a 1, the lowest gets a 0. Everything in between are decimals between one and zero.</p><p>When it comes to the changes, first, the percentage changes are computed, afterwards these percentage changes are scaled on a logarithmic scale.</p><p>The training and test data are organised in such a way that for every entry that is made of last n scaled closings and log percentage changes there is a corresponding value that is the closing price for the n+1 days of training.</p><p>Long story short, we will use the last 3 days to predict the change in the 4th day.</p><p>Now, you may ask why do we do this transformation, well, one reason is the stationarity of the data, meaning that across different time periods the mean and variance should not vary too much, this way the statistics is sound for the learning algorithm.</p><p>Before feeding the data into the model this how the last 3 days would look like</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/586/1*bwz9K6fK4XuZBxcHpOyi8w.png" /></figure><p>And this is how the the fourth, the attempted predicted result looks like</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/332/1*7R5Cyz9sQHSYxUX3HTjJgw.png" /></figure><p><strong>Implementation</strong></p><p>As an implementation the Sequential’s LSTM model was used with the optimiser ADAM, with a batch size of 16. The number initial number of epochs is 50, as seen below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pilBH67FO-6hKIglSfQv0g.png" /></figure><p>The fit parameters will be used for the refinement</p><p><strong>Refinement</strong></p><p>In order to refine this model we are running the same model multiple times changing parameters. This parameters are the whole period for which the data is retrieved, the options are 1 year, 2 years and 5 years; the number look back days, the options here are 3, 13, and 30 and the number of epochs 50 or 100.</p><p>All these are run a loop-in-the-loop simple system.</p><p>The loop in the loop system means that a for loop in a for loop is used, I mean this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/928/1*hGneqVVEcckrYyVR_1lpcA.png" /></figure><p>As you can see the for loop iterates through all the possible combinations, in the next we discuss the results.</p><p><strong>Results</strong></p><p><strong>Model Evaluation and Validation</strong></p><p>As said in the beginning the single metric on which this system is evaluated is the mean “error” as divided by last actual price times 100, for MSFT this metric is 2.9964, quite good I would say, for other stocks, such as PFE, with all the refinement the metric is not satisfactory.</p><p><strong>Justification</strong></p><p>The final results that I have are not a model with specific parameters, rather a framework that can extended. I mean here, not necessary the model that I am using but the number of days and number of epochs that are used.</p><p>The result is the framework that can be tinkered with.</p><p><strong>Conclusion</strong></p><p><strong>Reflection</strong></p><p>In this project I imported, manipulated and modelled the data in order to be able to predict the next value of the stock price for a given listed company. The hard aspects were to choose the appropriate data representation that is needed for the model.</p><p><strong>Improvement</strong></p><p>In improving the results, I would need to extend the parameters that are used in the search of the minimum test score. Computational power must be added in order to do this.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1654e75c8a3e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[This is what *might* influence the price of your Berlin Airbnb listing — or not :)]]></title>
            <link>https://daniel-cornea.medium.com/this-is-what-might-influence-the-price-of-your-berlin-airbnb-listing-or-not-17663340d854?source=rss-43bde7a8c7c1------2</link>
            <guid isPermaLink="false">https://medium.com/p/17663340d854</guid>
            <category><![CDATA[berlin]]></category>
            <category><![CDATA[price-analysis]]></category>
            <category><![CDATA[airbnb]]></category>
            <dc:creator><![CDATA[Daniel Cornea]]></dc:creator>
            <pubDate>Sun, 04 Jul 2021 19:21:49 GMT</pubDate>
            <atom:updated>2021-08-09T09:39:21.720Z</atom:updated>
            <content:encoded><![CDATA[<h3>This is what *might* influence the price of your Berlin Airbnb listing — or not :)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xbRYvCWgFL4vi_PPkbBLBw.jpeg" /></figure><p>Are you looking to list your Berlin apartment on Airbnb and go see the world #wonderlust or are you looking to buy an apartment in the city in order to let it via Airbnb #capitalism ?</p><p>In this article I am showing you:</p><ol><li>What <strong>*might* </strong>be a factor in determining the price per night of the apartment</li><li>What neighbourhoods <strong>*might *</strong>commend higher (or lower) prices</li><li>If a license means higher price for the listing</li></ol><h4>But first — understanding the data source</h4><p>The data that I wrangled before writing this article comes from Airbnb itself and can be accessed <a href="http://insideairbnb.com/get-the-data.html">here</a>. It contains a table with the listings and their fetures as columns. If you have not heard about the company before, you can read about it <a href="https://en.wikipedia.org/wiki/Airbnb">here</a>.</p><h3>What <strong>*might* </strong>be a factor in determining the price per night of the apartment<strong> ?</strong></h3><p>I did a bit of wrangling with this data and I tried to build a fancy machine learning model in order to predict the price, however, not everything that is fancy works. Therefore, I sticked to more *<em>earthly* </em>methods.</p><p>For instance, my thinking was that looking at the correlation between price and every other factor might give me an idea on what drives the price… it did not.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*resbgLPI50IDBZsF8whw-w.png" /><figcaption>Correlation with price</figcaption></figure><p>The correlation between the factors and the price turned out to be very low. The only thing that has a weak correlation with the price is the number of guests the apartment can host. To be precise, the p-coefficient is about 0.32, which indicates only a bit of correlation.</p><h3>What neighbourhoods <strong>*might * </strong>commend higher (or lower) prices?</h3><p>A picture is worth a thousand words, so without further ado, ladies and gentlemen, I present to you the Berlin’s Airbnb listings map. The blue dots represent the apartments in the lowest price quartile, the red dots represent the apartments in the highest price quartile.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pHHy9aMsk4qvvl6Yuo6H6g.jpeg" /></figure><h4>East — West devide</h4><p>Inspecting the map, it is striking how most apartments are in what was East Berlin. I guess the communists did a better job at designing and building the Airbnb-able apartment blocks.</p><h4>The bling bling apartments</h4><p>As you can see from the above map, between Potsdamer Platz and Alexander Platz there are very few low-priced apartments. Similarly, high priced apartments are the majority in the south of Prenzlauer Berg and north of Neukoln.</p><h4>The not so bling bling apartments</h4><p>On the map, these lower priced apartments tend to be outside the “ring”. For instance, bar some picturesque places, there are virtually no high priced apartments in Spandau. There is a similar situation in Wedding, where there are few high priced apartments grouped around Nettelbeckplatz.</p><h3>Do the licensed listings have a higher price ?</h3><p>As highlighted <a href="https://www.airbnb.com/help/article/854/berlin">here</a>, most of the listings would require a license that needs to be displayed in the listing. It is my understanding that obtaining the license implies additional costs for the owner, and therefore, these listings have a higher price.</p><p>We already have seen that there is a weak correlation between the price and the number of people the listed apartment accommodates. Given this, I wanted to see if for the same number of “accommodates” we have price differences.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/432/1*Fo1-j9lILeFpH62S6wybOg.png" /></figure><p>As related by the diagram, up until the apartment accommodates 9 people the price of licensed apartments is higher than the price of non-licensed ones (on average), as the “accommodates” figure gets higher than 9 this is no longer the case. However, this data needs to be taken with a pinch of salt, only 15% of listings have a license. Don’t tell this to <a href="https://en.wikipedia.org/wiki/Michael_M%C3%BCller_(politician,_born_1964)">this guy</a>.</p><h3><strong>The conclusion</strong></h3><p>There are three main takeaways:</p><ul><li>the number of guests that an apartment can accommodate has a weak correlation with the price</li><li>the higher priced apartments tend to cluster inside the ring while the lower priced apartments are further away from the city centre.</li><li>The price of licensed apartments that can accommodate fewer than 9 people is higher, on average.</li></ul><p><strong>Please let me know in the comments …</strong></p><p>If you visited Berlin, or you live in the city, what is in your opinion the highest (lowest) priced area? Do you think there is a special factor that influences the price of an Airbnb listing ?</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=17663340d854" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>