GBDUMMYFY(1)

πŸ’… GBDUMMYFY(1) β€” like, the manual page, but make it make sense

okay bestie, welcome to gbdummyfy(1), a User Command, and honestly? it's giving quiet luxury. let's get into it πŸŽ€


✨ NAME ✨

gbdummyfy β€” produce dummies from labels 🧚


✨ SYNOPSIS ✨

gbdummyfy [options]

🌸 DESCRIPTION 🌸

so the way this works: this command reads a text file from standard input, and that file has columns separated by spaces. the entries in one column β€” the first one by default β€” are treated as labels, and they get expanded into a matrix of dummies, aka a whole grid of 0 and 1 values. πŸ’–

the number of columns in that matrix is literally equal to the number of different labels. each row has a 1 sitting in the spot of the associated label in the sorted list of labels, and a 0 everywhere else. iconic behaviour, no notes.

and because (in general) you need one less dummy variable than the number of labels, you can yeet one column of dummies out using the -d option. slay. πŸ’…


πŸ‘‘ OPTIONS πŸ‘‘

  • -h β€” print this help. cute, helpful, does what it says 🫢
  • -c β€” set the column of labels (default 1) πŸ”₯
  • -d β€” which column to remove, counting from 1 (default none) πŸ’€
  • -v β€” print the labels and associated positions to standard error 🌈

⭐ EXAMPLES ⭐

echo "a 1\nb 2" | gbdummyfy

this one creates a 4x3 matrix with dummy values relative to the labels 'a' and 'b'. periodt. ✨

this program requires awk or gawk. and ngl, notice that it simply expands the data by adding new columns β€” it does not reorganise your life. so when you use the resulting matrix in other utilities, you the user should specify explicitly which dummies variable to use and how. iykyk. πŸ™ˆ

a simple linear dependency can be automatically generated for gblreg by inserting the following expression in the functional specification:

seq 3 12 | sed 's/\(.*\)/\+d\1\*x\1/' | tr -d '\n'

and

seq 3 12 | sed 's/\(.*\)/,\1=0/' | tr -d '\n'

among the initial conditions. in this case there are 10 different values for the dummy. they occupy column positions from 3 to 12 and their initial value is zero. math but make it fashion πŸ’…


πŸ¦‹ AUTHOR πŸ¦‹

Written by Giulio Bottazzi πŸ‘‘


😭 REPORTING BUGS 😭

found a bug? report it to <gbutils@googlegroups.com> πŸ“

package home page: <http://cafim.sssup.it/~giulio/software/gbutils/index.html>


Copyright Β© 2009-2015 Giulio Bottazzi

this program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License (version 2) as published by the Free Software Foundation. πŸŽ€

this program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. see the GNU General Public License for more details. bestie, that's a real legal caveat, not a vibe β€” it means no promises, fr fr πŸ’€


that's the whole page, you ate it up πŸ’–

gbdummyfy ver. 5.6 🌸 August 2017 🌸 and that's the sign-off, mwah 😘🫢