Skip to contents

This function takes a matrix or dataframe of features, removes columns that are entirely NA, and then applies three logistic transformations to each column. Each transformed set of features is appended with suffixes "_early", "_linear", or "_late" to differentiate between them. The resulting matrix combines all transformed features.

Usage

create_logist_features(features)

Arguments

features

A matrix or dataframe where each column is a feature to be transformed.

Value

A matrix containing the transformed features with columns named according to the transformation applied (i.e., "_early", "_linear", or "_late").

See also

logist for the logistic transformation function.

Examples

sample_features <- matrix(rnorm(100), ncol = 5)
create_logist_features(sample_features)
#>       V1_high-energy V1_higher-energy V1_low-energy   V1_sigmoid V2_high-energy
#>  [1,]    0.015194518     1.172040e-04   0.063742721 0.0086228195    0.016027914
#>  [2,]    0.003976017     7.935848e-06  -0.543645366 0.0005885478    0.006994522
#>  [3,]    0.013348714     9.029132e-05  -0.001392821 0.0066559143    0.019299783
#>  [4,]    0.018220130     1.690384e-04   0.154149501 0.0123893993    0.034055131
#>  [5,]    0.023646487     2.862674e-04   0.279466150 0.0208039625    0.012753208
#>  [6,]    0.005404801     1.468509e-05  -0.426372203 0.0010885521    0.008404503
#>  [7,]    0.011837865     7.090188e-05  -0.061752650 0.0052340335    0.013280079
#>  [8,]    0.011856270     7.112384e-05  -0.060974168 0.0052503330    0.008873430
#>  [9,]    0.011631501     6.843730e-05  -0.070558917 0.0050530095    0.006306271
#> [10,]    0.010165069     5.219216e-05  -0.137547431 0.0038581596    0.021282514
#> [11,]    0.018287317     1.702988e-04   0.155962176 0.0124806338    0.014611577
#> [12,]    0.037139117     7.157455e-04   0.474805392 0.0504514533    0.015107072
#> [13,]    0.005944291     1.777263e-05  -0.386558308 0.0013171205    0.029892801
#> [14,]    0.017260972     1.515641e-04   0.127410507 0.0111228006    0.014151500
#> [15,]    0.005294909     1.409245e-05  -0.434761338 0.0010446674    0.012523695
#> [16,]    0.010326563     5.387240e-05  -0.129767272 0.0039818755    0.005172051
#> [17,]    0.013040500     8.614335e-05  -0.013149719 0.0063520719    0.011651571
#> [18,]    0.017524498     1.562685e-04   0.134921334 0.0114641101    0.011455105
#> [19,]    0.008496106     3.639985e-05  -0.224622267 0.0026938811    0.022717435
#> [20,]    0.016886267     1.450009e-04   0.116507117 0.0106462358    0.013859432
#>       V2_higher-energy V2_low-energy   V2_sigmoid V3_high-energy
#>  [1,]     1.305223e-04   0.090489606 0.0095933189    0.009742111
#>  [2,]     2.463337e-05  -0.315044437 0.0018246450    0.013057593
#>  [3,]     1.898699e-04   0.182380583 0.0138951384    0.011813424
#>  [4,]     5.999598e-04   0.439915669 0.0426355770    0.016691842
#>  [5,]     8.236589e-05  -0.024356458 0.0060752093    0.052051866
#>  [6,]     3.561591e-05  -0.229784402 0.0026360153    0.013698622
#>  [7,]     8.935907e-05  -0.003987557 0.0065876424    0.017828579
#>  [8,]     3.971977e-05  -0.203803061 0.0029388641    0.014194821
#>  [9,]     2.001032e-05  -0.361056214 0.0014827105    0.005167841
#> [10,]     2.313439e-04   0.229669749 0.0168794173    0.020524726
#> [11,]     1.083203e-04   0.044093543 0.0079744088    0.011861946
#> [12,]     1.158487e-04   0.060846110 0.0085239535    0.012082994
#> [13,]     4.603451e-04   0.384974996 0.0330395867    0.013513801
#> [14,]     1.015595e-04   0.028002198 0.0074803894    0.013583663
#> [15,]     7.940974e-05  -0.033486728 0.0058584356    0.017583930
#> [16,]     1.344441e-05  -0.444256763 0.0009966762    0.004313226
#> [17,]     6.867506e-05  -0.069696130 0.0050704758    0.050236505
#> [18,]     6.636558e-05  -0.078201494 0.0049007902    0.011186224
#> [19,]     2.639695e-04   0.260669863 0.0192144332    0.014881396
#> [20,]     9.738224e-05   0.017506924 0.0071749039    0.022796605
#>       V3_higher-energy V3_low-energy   V3_sigmoid V4_high-energy
#>  [1,]     4.791892e-05  -0.158434844 0.0035433843    0.009617056
#>  [2,]     8.637080e-05  -0.012490575 0.0063687376    0.023247253
#>  [3,]     7.060768e-05  -0.062788154 0.0052124280    0.011846275
#>  [4,]     1.416535e-04   0.110743198 0.0104030070    0.007451298
#>  [5,]     1.427046e-03   0.597245539 0.0958177994    0.008238755
#>  [6,]     9.512022e-05   0.011632320 0.0070094033    0.022692176
#>  [7,]     1.617879e-04   0.143431362 0.0118642439    0.014290101
#>  [8,]     1.021867e-04   0.029540122 0.0075262390    0.017058541
#>  [9,]     1.342247e-05  -0.444584384 0.0009950515    0.005744832
#> [10,]     2.149997e-04   0.212245514 0.0157055101    0.006438592
#> [11,]     7.119235e-05  -0.060734343 0.0052553643    0.015413458
#> [12,]     7.388676e-05  -0.051476259 0.0054531857    0.025958483
#> [13,]     9.255370e-05   0.004794361 0.0068215583    0.015054768
#> [14,]     9.351966e-05   0.007390054 0.0068922659    0.025715858
#> [15,]     1.573396e-04   0.136597657 0.0115417848    0.017359497
#> [16,]     9.342167e-06  -0.514277940 0.0006927732    0.018086971
#> [17,]     1.326834e-03   0.585400254 0.0896886205    0.012674312
#> [18,]     6.326959e-05  -0.090060631 0.0046732270    0.014580375
#> [19,]     1.123880e-04   0.053288411 0.0082714119    0.012798386
#> [20,]     2.658336e-04   0.262309054 0.0193475159    0.034660202
#>       V4_higher-energy V4_low-energy  V4_sigmoid V5_high-energy
#>  [1,]     4.669075e-05   -0.16475654 0.003452878     0.02546449
#>  [2,]     2.765722e-04    0.27150521 0.020113459     0.01940534
#>  [3,]     7.100326e-05   -0.06139678 0.005241478     0.01763976
#>  [4,]     2.796854e-05   -0.28617110 0.002071180     0.01019263
#>  [5,]     3.421931e-05   -0.23923513 0.002532909     0.02320802
#>  [6,]     2.633762e-04    0.26014538 0.019172067     0.00364338
#>  [7,]     1.035730e-04    0.03290577 0.007627568     0.01238940
#>  [8,]     1.480000e-04    0.12155318 0.010864065     0.01660181
#>  [9,]     1.659662e-05   -0.40101902 0.001230073     0.01107152
#> [10,]     2.086162e-05   -0.35196434 0.001545693     0.01652213
#> [11,]     1.206324e-04    0.07091833 0.008872825     0.02267025
#> [12,]     3.457809e-04    0.32240618 0.025021509     0.02250956
#> [13,]     1.150419e-04    0.05910510 0.008465088     0.01313476
#> [14,]     3.392650e-04    0.31813736 0.024561508     0.01703758
#> [15,]     1.533144e-04    0.13023357 0.011249813     0.03062790
#> [16,]     1.665545e-04    0.15053423 0.012209552     0.01122444
#> [17,]     8.134354e-05   -0.02747700 0.006000251     0.02139847
#> [18,]     1.078548e-04    0.04301886 0.007940410     0.02569724
#> [19,]     8.295423e-05   -0.02257798 0.006118340     0.01155121
#> [20,]     6.218445e-04    0.44711280 0.044122637     0.01104258
#>       V5_higher-energy V5_low-energy   V5_sigmoid
#>  [1,]     3.325813e-04   0.313658692 0.0240892080
#>  [2,]     1.919727e-04   0.185041380 0.0140468768
#>  [3,]     1.583492e-04   0.138166671 0.0116149915
#>  [4,]     5.247696e-05  -0.136212392 0.0038791317
#>  [5,]     2.756287e-04   0.270713626 0.0200462140
#>  [6,]     6.661336e-06  -0.573742155 0.0004940724
#>  [7,]     7.770543e-05  -0.038903799 0.0057334164
#>  [8,]     1.401170e-04   0.108049002 0.0102913160
#>  [9,]     6.197156e-05  -0.095198616 0.0045777878
#> [10,]     1.387642e-04   0.105651141 0.0101929631
#> [11,]     2.628618e-04   0.259689570 0.0191353324
#> [12,]     2.591069e-04   0.256331703 0.0188671163
#> [13,]     8.740139e-05  -0.009525436 0.0064442437
#> [14,]     1.476335e-04   0.120942324 0.0108374486
#> [15,]     4.836195e-04   0.395430370 0.0346525294
#> [16,]     6.370511e-05  -0.088359257 0.0047052446
#> [17,]     2.338988e-04   0.232269421 0.0170626736
#> [18,]     3.387677e-04   0.317807682 0.0245263848
#> [19,]     6.749031e-05  -0.074024352 0.0049834347
#> [20,]     6.164631e-05  -0.096502145 0.0045538701