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 (default1) π₯-dβ which column to remove, counting from1(defaultnone) π-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 π
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 ππ«Ά
π¦ where this page comes from
- debian bookworm: gbutils 6.3-1 Β· GPL-2.0-or-later
- debian trixie: gbutils 6.3-1+b1 Β· GPL-2.0-or-later
- ubuntu jammy: gbutils 6.0-1build2 Β· GPL-2.0-or-later
- ubuntu noble: gbutils 6.3-1 Β· GPL-2.0-or-later
- ubuntu questing: gbutils 6.3-1build1
- ubuntu resolute: gbutils 6.3-1build2 Β· GPL-2.0-or-later
- ubuntu stonking: gbutils 6.3-1build2 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms