<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Blog on Christian Hotz-Behofsits</title><link>https://hotzbehofsits.com/post/</link><description>Recent content in Blog on Christian Hotz-Behofsits</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Tue, 28 Jul 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://hotzbehofsits.com/post/index.xml" rel="self" type="application/rss+xml"/><item><title>Running a Zero-Shot Classifier on Your Own GPU</title><link>https://hotzbehofsits.com/post/local_llm_inference/</link><pubDate>Tue, 28 Jul 2026 00:00:00 +0000</pubDate><guid>https://hotzbehofsits.com/post/local_llm_inference/</guid><description>&lt;p&gt;In a recent project I had 1,500 tweets and a codebook with 16 categories. There were three ways to get labels: code them by hand, send them to a commercial API, or run an open-weight model on our own GPU. I went with the third one, and this post is what I wish someone had told me before I started.&lt;/p&gt;
&lt;p&gt;The reasons for staying local are not ideological. First, the data never leaves the machine. Second, I have already the hardware and there is no per-token cost, so you can iterate on the prompt fifty times instead of five, and prompt iteration is where the accuracy comes from. Third, a pinned model version at &lt;code&gt;temperature=0&lt;/code&gt; is reproducible, which turns the classification step into something you can ship in a replication package rather than a black box you apologize for in a footnote.&lt;/p&gt;</description></item><item><title>DiD &amp; friends: An overview of tools and papers</title><link>https://hotzbehofsits.com/post/did_overview/</link><pubDate>Thu, 29 Jun 2023 00:00:00 +0000</pubDate><guid>https://hotzbehofsits.com/post/did_overview/</guid><description>&lt;p&gt;&lt;em&gt;Last updated: July 2026.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;This post provides an up-to-date overview of &lt;a href="https://en.wikipedia.org/wiki/Difference_in_differences"&gt;Difference-In-Difference&lt;/a&gt; tools, papers, and other links. What is important here is not the timeliness but the relevance. While there are new methods daily, only a few are used in practice (or demanded by reviewers). The idea is that not only the advantages of each method are given here, but also the disadvantages. Unfortunately, disadvantages of individual methods (e.g. scalability to larger data sets) are rarely communicated.&lt;/p&gt;</description></item><item><title>Applying Cosine Similarity on a Large Scale</title><link>https://hotzbehofsits.com/post/ch_cos_similarity/</link><pubDate>Fri, 30 Sep 2022 00:00:00 +0000</pubDate><guid>https://hotzbehofsits.com/post/ch_cos_similarity/</guid><description>&lt;p&gt;I wrote my &lt;a href="https://hotzbehofsits.com/post/bigquery_vectors/"&gt;first blog post&lt;/a&gt; about cosine similarity back in 2019 when the pandemic was out of sight, and most marketing people were unaware of “representational learning.” However, times have changed, and nowadays, many quantitative marketing papers apply &lt;em&gt;word2vec&lt;/em&gt;, &lt;em&gt;prod2vec&lt;/em&gt;, or similar approaches.&lt;/p&gt;
&lt;p&gt;Thanks to &lt;a href="https://radimrehurek.com/gensim/"&gt;gensim&lt;/a&gt;, training such a model is straightforward. For example, one can learn the representations of tracks within a few lines of python code:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-py" data-lang="py"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#f92672"&gt;from&lt;/span&gt; gensim.models &lt;span style="color:#f92672"&gt;import&lt;/span&gt; Word2Vec
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#f92672"&gt;from&lt;/span&gt; gensim.models.word2vec &lt;span style="color:#f92672"&gt;import&lt;/span&gt; LineSentence
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;model &lt;span style="color:#f92672"&gt;=&lt;/span&gt; Word2Vec(
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; sentences&lt;span style="color:#f92672"&gt;=&lt;/span&gt;LineSentence(&lt;span style="color:#e6db74"&gt;&amp;#39;./data/tmp_isrc_training.txt&amp;#39;&lt;/span&gt;), 
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; vector_size&lt;span style="color:#f92672"&gt;=&lt;/span&gt;&lt;span style="color:#ae81ff"&gt;50&lt;/span&gt;, window&lt;span style="color:#f92672"&gt;=&lt;/span&gt;&lt;span style="color:#ae81ff"&gt;99&lt;/span&gt;, epochs&lt;span style="color:#f92672"&gt;=&lt;/span&gt;&lt;span style="color:#ae81ff"&gt;5&lt;/span&gt;, min_count&lt;span style="color:#f92672"&gt;=&lt;/span&gt;&lt;span style="color:#ae81ff"&gt;1&lt;/span&gt;, workers&lt;span style="color:#f92672"&gt;=&lt;/span&gt;&lt;span style="color:#ae81ff"&gt;8&lt;/span&gt;,
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; sg&lt;span style="color:#f92672"&gt;=&lt;/span&gt;&lt;span style="color:#ae81ff"&gt;1&lt;/span&gt;, negative&lt;span style="color:#f92672"&gt;=&lt;/span&gt;&lt;span style="color:#ae81ff"&gt;10&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;)
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;style type="text/css"&gt;.notice{--root-color:#444;--root-background:#eff;--title-color:#fff;--title-background:#7bd;--warning-title:#c33;--warning-content:#fee;--info-title:#fb7;--info-content:#fec;--note-title:#6be;--note-content:#e7f2fa;--tip-title:#5a5;--tip-content:#efe}@media (prefers-color-scheme:dark){.notice{--root-color:#ddd;--root-background:#eff;--title-color:#fff;--title-background:#7bd;--warning-title:#800;--warning-content:#400;--info-title:#a50;--info-content:#420;--note-title:#069;--note-content:#023;--tip-title:#363;--tip-content:#121}}body.dark .notice{--root-color:#ddd;--root-background:#eff;--title-color:#fff;--title-background:#7bd;--warning-title:#800;--warning-content:#400;--info-title:#a50;--info-content:#420;--note-title:#069;--note-content:#023;--tip-title:#363;--tip-content:#121}.notice{padding:18px;line-height:24px;margin-bottom:24px;border-radius:4px;color:var(--root-color);background:var(--root-background)}.notice p:last-child{margin-bottom:0}.notice-title{margin:-18px -18px 12px;padding:4px 18px;border-radius:4px 4px 0 0;font-weight:700;color:var(--title-color);background:var(--title-background)}.notice.warning .notice-title{background:var(--warning-title)}.notice.warning{background:var(--warning-content)}.notice.info .notice-title{background:var(--info-title)}.notice.info{background:var(--info-content)}.notice.note .notice-title{background:var(--note-title)}.notice.note{background:var(--note-content)}.notice.tip .notice-title{background:var(--tip-title)}.notice.tip{background:var(--tip-content)}.icon-notice{display:inline-flex;align-self:center;margin-right:8px}.icon-notice img,.icon-notice svg{height:1em;width:1em;fill:currentColor}.icon-notice img,.icon-notice.baseline svg{top:.125em;position:relative}&lt;/style&gt;
&lt;div&gt;&lt;svg width="0" height="0" display="none" xmlns="http://www.w3.org/2000/svg"&gt;&lt;symbol id="tip-notice" viewBox="0 0 512 512" preserveAspectRatio="xMidYMid meet"&gt;&lt;path d="M504 256c0 136.967-111.033 248-248 248S8 392.967 8 256 119.033 8 256 8s248 111.033 248 248zM227.314 387.314l184-184c6.248-6.248 6.248-16.379 0-22.627l-22.627-22.627c-6.248-6.249-16.379-6.249-22.628 0L216 308.118l-70.059-70.059c-6.248-6.248-16.379-6.248-22.628 0l-22.627 22.627c-6.248 6.248-6.248 16.379 0 22.627l104 104c6.249 6.249 16.379 6.249 22.628.001z"/&gt;&lt;/symbol&gt;&lt;symbol id="note-notice" viewBox="0 0 512 512" preserveAspectRatio="xMidYMid meet"&gt;&lt;path d="M504 256c0 136.997-111.043 248-248 248S8 392.997 8 256C8 119.083 119.043 8 256 8s248 111.083 248 248zm-248 50c-25.405 0-46 20.595-46 46s20.595 46 46 46 46-20.595 46-46-20.595-46-46-46zm-43.673-165.346l7.418 136c.347 6.364 5.609 11.346 11.982 11.346h48.546c6.373 0 11.635-4.982 11.982-11.346l7.418-136c.375-6.874-5.098-12.654-11.982-12.654h-63.383c-6.884 0-12.356 5.78-11.981 12.654z"/&gt;&lt;/symbol&gt;&lt;symbol id="warning-notice" viewBox="0 0 576 512" preserveAspectRatio="xMidYMid meet"&gt;&lt;path d="M569.517 440.013C587.975 472.007 564.806 512 527.94 512H48.054c-36.937 0-59.999-40.055-41.577-71.987L246.423 23.985c18.467-32.009 64.72-31.951 83.154 0l239.94 416.028zM288 354c-25.405 0-46 20.595-46 46s20.595 46 46 46 46-20.595 46-46-20.595-46-46-46zm-43.673-165.346l7.418 136c.347 6.364 5.609 11.346 11.982 11.346h48.546c6.373 0 11.635-4.982 11.982-11.346l7.418-136c.375-6.874-5.098-12.654-11.982-12.654h-63.383c-6.884 0-12.356 5.78-11.981 12.654z"/&gt;&lt;/symbol&gt;&lt;symbol id="info-notice" viewBox="0 0 512 512" preserveAspectRatio="xMidYMid meet"&gt;&lt;path d="M256 8C119.043 8 8 119.083 8 256c0 136.997 111.043 248 248 248s248-111.003 248-248C504 119.083 392.957 8 256 8zm0 110c23.196 0 42 18.804 42 42s-18.804 42-42 42-42-18.804-42-42 18.804-42 42-42zm56 254c0 6.627-5.373 12-12 12h-88c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h12v-64h-12c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h64c6.627 0 12 5.373 12 12v100h12c6.627 0 12 5.373 12 12v24z"/&gt;&lt;/symbol&gt;&lt;/svg&gt;&lt;/div&gt;&lt;div class="notice note" &gt;
&lt;p class="first notice-title"&gt;&lt;span class="icon-notice baseline"&gt;&lt;svg&gt;&lt;use href="#note-notice"&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/p&gt;</description></item><item><title>Multi-hot encoding in JAX</title><link>https://hotzbehofsits.com/post/jax_multi_hot/</link><pubDate>Fri, 19 Aug 2022 00:00:00 +0000</pubDate><guid>https://hotzbehofsits.com/post/jax_multi_hot/</guid><description>&lt;p&gt;JAX offers a range of practical functions, also for data preparation. One of these is &lt;a href="https://jax.readthedocs.io/en/latest/_autosummary/jax.nn.one_hot.html"&gt;jax.nn.one_hot&lt;/a&gt;, which performs a classic &lt;a href="https://en.wikipedia.org/wiki/One-hot"&gt;one-hot encoding&lt;/a&gt;. Unfortunately, I was not able to find a suitable multi-hot equivalent for multi-label applications. However, it is also quite easy to implement the functionality directly in JAX:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#f92672"&gt;import&lt;/span&gt; jax
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#f92672"&gt;import&lt;/span&gt; jax.numpy &lt;span style="color:#66d9ef"&gt;as&lt;/span&gt; jnp
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#f92672"&gt;from&lt;/span&gt; functools &lt;span style="color:#f92672"&gt;import&lt;/span&gt; partial
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#a6e22e"&gt;@partial&lt;/span&gt;(jax&lt;span style="color:#f92672"&gt;.&lt;/span&gt;jit, static_argnames&lt;span style="color:#f92672"&gt;=&lt;/span&gt;(&lt;span style="color:#e6db74"&gt;&amp;#34;num_classes&amp;#34;&lt;/span&gt;))
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#66d9ef"&gt;def&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;multi_hot&lt;/span&gt;(labels, num_classes: int):
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#66d9ef"&gt;return&lt;/span&gt; jnp&lt;span style="color:#f92672"&gt;.&lt;/span&gt;take(jnp&lt;span style="color:#f92672"&gt;.&lt;/span&gt;eye(num_classes), jnp&lt;span style="color:#f92672"&gt;.&lt;/span&gt;array(labels), axis&lt;span style="color:#f92672"&gt;=&lt;/span&gt;&lt;span style="color:#ae81ff"&gt;0&lt;/span&gt;)&lt;span style="color:#f92672"&gt;.&lt;/span&gt;sum(axis&lt;span style="color:#f92672"&gt;=&lt;/span&gt;&lt;span style="color:#ae81ff"&gt;0&lt;/span&gt;)
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</description></item><item><title>Multinomial Logistic Regression in JAX</title><link>https://hotzbehofsits.com/post/jax_first_steps/</link><pubDate>Fri, 29 Jul 2022 00:00:00 +0000</pubDate><guid>https://hotzbehofsits.com/post/jax_first_steps/</guid><description>&lt;p&gt;Classifications are a classic machine learning problem we can tackle using &lt;a href="https://en.wikipedia.org/wiki/Logistic_regression"&gt;logistic regression&lt;/a&gt;. If we distinguish between more than two classes, we call it a &lt;a href="https://en.wikipedia.org/wiki/Multinomial_logistic_regression"&gt;multinomial logistic regression&lt;/a&gt;. In this post, I will show how this can be done using &lt;a href="https://jax.readthedocs.io/en/latest/"&gt;JAX&lt;/a&gt; based on the well-known &lt;a href="https://en.wikipedia.org/wiki/Iris_flower_data_set"&gt;Fisher&amp;rsquo;s Iris dataset&lt;/a&gt; (every R user should be familiar with this one).&lt;/p&gt;
&lt;p&gt;First, we have to load the required libraries and load the data. Since this is a classification, we have a set of predictors (aka. features) and a label for each sample.&lt;/p&gt;</description></item><item><title>SQL Multi-Substring Search in Yandex Clickhouse</title><link>https://hotzbehofsits.com/post/clickhouse_multi_pattern_search/</link><pubDate>Sat, 16 Jan 2021 10:27:14 +0100</pubDate><guid>https://hotzbehofsits.com/post/clickhouse_multi_pattern_search/</guid><description>&lt;p&gt;Nowadays, also analytical databases are more frequently used to search for substrings or patterns in character strings. Thus, most databases provide a like operator or more sophisticated regex functions. However, especially long regex patterns or many of them can be challenging. In a recent project, I had to search for not one, but for 150 substrings at the same time. Thankfully, my database of choice (&lt;a href="https://clickhouse.tech"&gt;Yandex Clickhouse&lt;/a&gt;) offers several possibilities to handle this:&lt;/p&gt;</description></item><item><title>Bigquery: Least but not NULL</title><link>https://hotzbehofsits.com/post/bigquery_least_nulls/</link><pubDate>Thu, 14 Jan 2021 12:42:57 +0100</pubDate><guid>https://hotzbehofsits.com/post/bigquery_least_nulls/</guid><description>&lt;p&gt;Let&amp;rsquo;s start with a simple SQL statement that returns the smallest value from each of several columns (similar to &lt;code&gt;min&lt;/code&gt; only not across observations, but columns):&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-sql" data-lang="sql"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#66d9ef"&gt;SELECT&lt;/span&gt; LEAST(date1, date2, date3) &lt;span style="color:#66d9ef"&gt;as&lt;/span&gt; min_date &lt;span style="color:#66d9ef"&gt;FROM&lt;/span&gt; tbl
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;In BigQuery it works nicely &lt;a href="https://cloud.google.com/bigquery/docs/reference/standard-sql/mathematical_functions?hl=de#least"&gt;till you encounter NULL values&lt;/a&gt;, then it will always pick the NULL. Unfortunately it does not provide a IGNORE NULLS option such as ARRAY_AGG or others do. However, similar behaviour can be achieved with the following UDF:&lt;/p&gt;</description></item><item><title>Merge large CSV files with headers</title><link>https://hotzbehofsits.com/post/merge_csv_with_header/</link><pubDate>Sat, 09 Jan 2021 13:54:18 +0100</pubDate><guid>https://hotzbehofsits.com/post/merge_csv_with_header/</guid><description>&lt;p&gt;If you have ever worked with classic data warehousing tools, you may already know the problem: &lt;em&gt;The CSV export splits the output into different files, often with one file containing no more than 1 million observations.&lt;/em&gt; However, for analysis purposes, this format is not always optimal and must be merged into a single file. In bash this is not a big problem with cat, but only if there is no header present. The BigQuery CSV table export, for example, adds a header to each CSV file and this must be taken into account when merging.&lt;/p&gt;</description></item><item><title>Parallel JSONLines in R</title><link>https://hotzbehofsits.com/post/r_parallel_jsonl/</link><pubDate>Wed, 06 Jan 2021 12:37:52 +0100</pubDate><guid>https://hotzbehofsits.com/post/r_parallel_jsonl/</guid><description>&lt;p&gt;JSON is becoming more and more widely used in data lakes, especially as a replacement for CSV. In particular, JSONLines where one JSON object is stored per line is to be mentioned here. Although the format has some disadvantages (i.e., overhead, supports only few data types), the advantages mostly outweigh them. For example, the individual lines are easier to read by humans and the format is much more standardized. In addition, each line has its own JSON object that can be processed independently. The overhead caused by the repeating field names can be well managed with compression (e.g., gzip, zstd, brotli).&lt;/p&gt;</description></item><item><title>Interpolate missing values in SQL</title><link>https://hotzbehofsits.com/post/interpolation_sql/</link><pubDate>Sun, 24 May 2020 12:37:24 +0200</pubDate><guid>https://hotzbehofsits.com/post/interpolation_sql/</guid><description>&lt;p&gt;In this post I demonstrate how missing values can be interpolated in SQL. The code is written for BigQuery and I provide a user defined function, however, similar solutions may exist for other databases. Although, SQL may not be the first choice to do such tasks, it is possible. Before one can replace missing values, you have to have missing values. At least in my applications, often the whole rows are missing and not just selective fields. In those cases, try to insert the rows before.&lt;/p&gt;</description></item><item><title>Learning Emoji Representations from Observed Usage</title><link>https://hotzbehofsits.com/post/emoji_embeddings/</link><pubDate>Tue, 05 Nov 2019 21:02:51 +0100</pubDate><guid>https://hotzbehofsits.com/post/emoji_embeddings/</guid><description>&lt;p&gt;Nowadays it is hard to imagine daily communication without emojis like &amp;#x1f604;, &amp;#x1f62c; or &amp;#x2764;&amp;#xfe0f;. These cute pictograms are not only ideal for expressing emotions, they are also standardized. This makes them ideal for analysis. However, before classical analyses such as clustering can be performed, a numerical representation is required. A simple method would be one-hot-encoding, which would be obvious considering the very limited vocabulary (there are only a few thousand emojis). However, embeddings can not only provide more memory friendly representations, but also those that capture a meaning.&lt;/p&gt;</description></item><item><title>Bigquery &amp; Embeddings</title><link>https://hotzbehofsits.com/post/bigquery_vectors/</link><pubDate>Sun, 27 Oct 2019 08:48:29 +0100</pubDate><guid>https://hotzbehofsits.com/post/bigquery_vectors/</guid><description>&lt;p&gt;math: true&lt;/p&gt;
&lt;p&gt;One can argue if it is wise to store embeddings directly in bigquery or calculate the similarities in SQL. For sure, in some cases a library (e.g. gensim) or approximations (e.g. Facebook faiss) are more appropriate. However, in our setting we wanted to use BigQuery. Therefore, arrays are used to store the word vectors and I created SQL functions to calculate pairwise cosine similarities.&lt;/p&gt;
&lt;div class="notice warning" &gt;
&lt;p class="first notice-title"&gt;&lt;span class="icon-notice baseline"&gt;&lt;svg&gt;&lt;use href="#warning-notice"&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;One downside of using BigQuery arrays to store vectors is that there is no guarantee that the ordering of the components is preserved. However, in most situations the order will not change.&lt;/p&gt;</description></item><item><title>Recommender Systems in R</title><link>https://hotzbehofsits.com/post/recommender-systems-r/</link><pubDate>Sat, 26 Oct 2019 20:59:29 +0200</pubDate><guid>https://hotzbehofsits.com/post/recommender-systems-r/</guid><description>&lt;p&gt;A former WU-member, Michael Hahsler, created a really nice package called recommenderlab, which allows you to build collaborative filtering systems. But before you can use it, you have to install all required packages:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;install.packages(c(&amp;#34;recommenderlab&amp;#34;, &amp;#34;dplyr&amp;#34;, &amp;#34;readr&amp;#34;))
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&amp;hellip; and load them:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-r" data-lang="r"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#a6e22e"&gt;library&lt;/span&gt;(recommenderlab)
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#a6e22e"&gt;library&lt;/span&gt;(tibble)
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#a6e22e"&gt;library&lt;/span&gt;(dplyr)
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#a6e22e"&gt;library&lt;/span&gt;(readr)
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;I asked my students to answer some questions. One question was about their favourite TV series, which is a good example for a recommender system &lt;em&gt;(Netflix for example does pretty much the same)&lt;/em&gt;. So they filled out this survey and I generated a table by adding a new row for each student and a new column for each TV show. I put a 1 in the cell if the user likes the show and nothing if not. You can import such a table &lt;em&gt;(CSV-format)&lt;/em&gt; using the following command &lt;em&gt;(all columns are by default parsed as integers except user, which is a string)&lt;/em&gt;. The file itself came from a course survey and is not published here, so you will have to substitute your own:&lt;/p&gt;</description></item><item><title>Using Embeddings in R</title><link>https://hotzbehofsits.com/post/embeddings_in_r/</link><pubDate>Thu, 08 Aug 2019 21:24:40 +0200</pubDate><guid>https://hotzbehofsits.com/post/embeddings_in_r/</guid><description>&lt;p&gt;There exist different file formats to store distributed vector or word representations also known as embeddings. However, one of the most convenient ways is to use the text format used by the original word2vec implementation. In this format, each row starts with a label (an item of the vocabulary) followed by the vector components. Furthermore, each field is separated by an ordinary space. The following function processes such *.vec-files and can be used to load them directly into R:&lt;/p&gt;</description></item><item><title>Big Data Analysis in Digital Marketing Research</title><link>https://hotzbehofsits.com/post/bigdata-in-digitalmarketing/</link><pubDate>Mon, 12 Jun 2017 11:00:53 +0100</pubDate><guid>https://hotzbehofsits.com/post/bigdata-in-digitalmarketing/</guid><description>&lt;p&gt;In the last decades, the increasing availability of broadband internet and the accompanying digitalisation has had a lasting effect on many industries. For example, television and radio are more and more replaced by music and video streaming services.&lt;/p&gt;
&lt;p&gt;Nowadays, it is even common to purchase accounting systems, databases or the whole IT-infrastructure as a service. Those trends are challenges for both managers and marketing departments and thus current topics for digital marketing researchers. At the same time, data storage got cheaper and cheaper and firms started to gather every piece of data they could catch in hopes of gilding them one day. Although, data was already available it took a decade till managers had recognised the real value of it and now there is a real demand for data driven decision support. Thus, big data is not an empty phrase anymore, data is available and its analysis is both feasible and reasonable. Nevertheless, mills are slowly working in research and it takes time for innovations in IT (i.e. big data analysis) to arrive at marketing research.&lt;/p&gt;</description></item></channel></rss>