<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>emre şahin's digital garden 🍃 - random</title>
    <link>https://emresahin.net/tags/random/</link>
    <description>Posts in the random tag</description>
    <language>en</language>
    <managingEditor>contact@emresahin.net (Emre Şahin)</managingEditor>
    <lastBuildDate>Tue, 15 Sep 2026 19:46:32 +0000</lastBuildDate>
    <atom:link href="https://emresahin.net/tags/random/rss.xml" rel="self" type="application/rss+xml"/>
    <item>
      <title>bits 12</title>
      <published>2024-08-12T09:50:51+00:00</published>
      <updated>2024-08-12T09:50:51+00:00</updated>
      <author>Emre Şahin</author>
      <pubDate>Mon, 12 Aug 2024 09:50:51 +0000</pubDate>
      <link>https://emresahin.net/bits-12/</link>
      <guid isPermaLink="true">https://emresahin.net/bits-12/</guid>
      <description>I decided I needed a random colorscheme selector for those moments when you want to change things up but don’t want to make a specific choice. LazyVim already has &lt;leader&gt;uC for selecting a colorscheme, but it can be too mentally taxing as it requires you to manually select one. This script simpl...</description>
      <category>neovim</category>
      <category>productivity</category>
      <category>colorscheme</category>
      <category>random</category>
      <category>neovim</category>
      <category>lua</category>
      <category>vim</category>
      <content:encoded><![CDATA[<p>I decided I needed a random colorscheme selector for those moments when you want to change things up but don’t want to make a specific choice. LazyVim already has <code>&lt;leader&gt;uC</code> for selecting a colorscheme, but it can be too <em>mentally taxing</em> as it requires you to manually <em>select</em> one. This script simply switches to a random one.</p>
<p><code>RandomColorScheme</code> returns the name of a random colorscheme after searching through all available paths. <code>SetRandomColorScheme</code> sets the colorscheme to that choice. The keybinding is mapped to <code>&lt;leader&gt;uR</code>.</p>
<pre><code class="language-lua">function RandomColorScheme()
  local color_schemes = vim.fn.globpath(vim.o.rtp, "colors/*.vim", false, true)
  for i, fullpath in ipairs(color_schemes) do
    color_schemes[i] = fullpath:match(".*/(.*).vim$")
  end

  -- Generate a random index
  local index = math.random(#color_schemes)

  local random_color_scheme = color_schemes[index]

  vim.notify("Random Color Scheme: " .. random_color_scheme)
  -- Select a random color scheme
  return random_color_scheme
end

function SetRandomColorScheme()
  vim.cmd("colorscheme " .. RandomColorScheme())
end

vim.api.nvim_set_keymap("n", "&lt;leader&gt;uR", ":lua SetRandomColorScheme()&lt;CR&gt;", { noremap = true, silent = true })
</code></pre>]]></content:encoded>
    </item>
    <item>
      <title>Missing Variables</title>
      <published>2021-01-10T18:46:13+00:00</published>
      <updated>2021-01-10T18:46:13+00:00</updated>
      <author>Emre Şahin</author>
      <pubDate>Sun, 10 Jan 2021 18:46:13 +0000</pubDate>
      <link>https://emresahin.net/missing-variables/</link>
      <guid isPermaLink="true">https://emresahin.net/missing-variables/</guid>
      <description>Using missing as a categorical variable It’s possible to use “missing” as a label for categorical variables when their frequency is high or relevant. Otherwise, it may be seen as adding another rare categorical variable to the dataset. Using random values for missing data Random sample imputation...</description>
      <category>ML</category>
      <category>Data Science</category>
      <category>Statistics</category>
      <category>Imputation</category>
      <category>Variables</category>
      <category>Random</category>
      <category>Missing Data</category>
      <category>Rare Variable</category>
      <category>Machine Learning</category>
      <category>Data Preprocessing</category>
      <content:encoded><![CDATA[<h2 id="using-missing-as-a-categorical-variable">Using <em>missing</em> as a categorical variable</h2>
<p>It’s possible to use “missing” as a label for categorical variables when their frequency is high or relevant. Otherwise, it may be seen as adding another rare categorical variable to the dataset.</p>
<h2 id="using-random-values-for-missing-data">Using random values for missing data</h2>
<p>Random sample imputation can be used to fill missing entries by selecting random values from those already present in the dataset.</p>
<p>Using this approach feels a bit unusual to me. However, when you are looking for a prediction and not all values are present in your sample, you can estimate a value based only on the supplied data.</p>
<p>For random variables, we need to generate values by seeding the random number generator with the given values. This ensures we obtain the same values for random variables whenever the same inputs are supplied, providing a degree of consistency.</p>]]></content:encoded>
    </item>
  </channel>
</rss>
