datafarming 1.1.0 → 1.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +5 -1
- data/datafarming.gemspec +2 -2
- data/exe/scaled_rf_cubed.rb +10 -64
- data/lib/datafarming/factorial_generator.rb +55 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1b7990952b921edf51b1e85246ee4069994acc3a7bb2dcf53f2b8cc523dcd24d
|
4
|
+
data.tar.gz: ce46677ee89cb2c30b0455704eb87691cb44aafb87e0f24ec92c01cb9956e74e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6f120f08238de3b7e950805c922cda8bb7a4385dc8220d22fcca7c2d7f4a5b32f3c39d640c429cc99e7bb96b63faa53a035f2ea63fdfb88026bf1becba131185
|
7
|
+
data.tar.gz: 461730ca7faf44c747c83684da6ca7c60b41c26c6cd26c749ef7ef04b9c6d2b6ce994afb95d767a544971e628f0ba1835ed8b1ead11be4167871d0bf3007b029
|
data/README.md
CHANGED
@@ -37,8 +37,12 @@ run a model interactively with replication
|
|
37
37
|
run control to replicate a designed experiment with a model
|
38
38
|
- `pool_files.rb` —
|
39
39
|
pool columns from separate files into a new file, useful for combining design file & output files or multiple output files
|
40
|
+
- `scaled_fde.rb` —
|
41
|
+
generate fully orthogonal quadratic designs based on discrete Fourier frequencies, with factor scaling
|
42
|
+
- `scaled_rf_cubed.rb` —
|
43
|
+
generate 2-level Resolution V fractional factorial designs and Central Composite Designs (CCDs), with factor scaling
|
40
44
|
- `stack_nolhs.rb` —
|
41
|
-
generate designs by reassigning columns from built-in NOLHs
|
45
|
+
generate designs by reassigning columns from built-in NOLHs, with factor scaling
|
42
46
|
- `stripheaders.rb`, `stripheaderdups.rb` —
|
43
47
|
used to remove headers from a file, or duplicate headers within a file, respectively
|
44
48
|
- `augment_design.rb` —
|
data/datafarming.gemspec
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
# -*- ruby -*-
|
2
|
-
_VERSION = "1.1.
|
2
|
+
_VERSION = "1.1.2"
|
3
3
|
|
4
4
|
Gem::Specification.new do |s|
|
5
5
|
s.name = "datafarming"
|
6
6
|
s.version = _VERSION
|
7
|
-
s.date = "2018-07-
|
7
|
+
s.date = "2018-07-16"
|
8
8
|
s.summary = "Useful scripts for data farming."
|
9
9
|
s.homepage = "https://gitlab.nps.edu/pjsanche/datafarmingrubyscripts.git"
|
10
10
|
s.email = "pjs@alum.mit.edu"
|
data/exe/scaled_rf_cubed.rb
CHANGED
@@ -4,61 +4,7 @@ require 'colorize'
|
|
4
4
|
String.disable_colorization false
|
5
5
|
|
6
6
|
require 'datafarming/error_handling'
|
7
|
-
require '
|
8
|
-
|
9
|
-
# Generate a Resolution V Fractional Factorial design for the specified
|
10
|
-
# number of factors. The design is guaranteed to yield unconfounded
|
11
|
-
# interactions for all pairs of factors. The design uses standardized
|
12
|
-
# notation, i.e., -1 represents a low setting and 1 represents a high
|
13
|
-
# setting for each factor.
|
14
|
-
#
|
15
|
-
# *Arguments*::
|
16
|
-
# - +number_of_factors+ -> the number of factors in your design. Limit is 120.
|
17
|
-
# *Returns*::
|
18
|
-
# - a two-dimensional array specifying the design, where each column
|
19
|
-
# corresponds to a factor and each row is a design point.
|
20
|
-
#
|
21
|
-
# Author:: Paul J Sanchez (mailto:pjs@alum.mit.edu)
|
22
|
-
# Copyright:: Copyright (c) Paul J Sanchez
|
23
|
-
# License:: LGPL
|
24
|
-
#
|
25
|
-
def make_design(number_of_factors)
|
26
|
-
index = [1, 2, 4, 8, 15, 16, 32, 51, 64, 85, 106, 128, 150, 171,
|
27
|
-
219, 237, 247, 256, 279, 297, 455, 512, 537, 557, 594, 643, 803,
|
28
|
-
863, 998, 1024, 1051, 1070, 1112, 1169, 1333, 1345, 1620, 1866,
|
29
|
-
2048, 2076, 2085, 2185, 2372, 2456, 2618, 2800, 2873, 3127, 3284,
|
30
|
-
3483, 3557, 3763, 4096, 4125, 4135, 4174, 4435, 4459, 4469, 4497,
|
31
|
-
4752, 5255, 5732, 5804, 5915, 6100, 6369, 6907, 7069, 8192, 8263,
|
32
|
-
8351, 8422, 8458, 8571, 8750, 8858, 9124, 9314, 9500, 10_026,
|
33
|
-
10_455, 10_556, 11_778, 11_885, 11_984, 13_548, 14_007, 14_514,
|
34
|
-
14_965, 15_125, 15_554, 16_384, 16_457, 16_517, 16_609, 16_771,
|
35
|
-
16_853, 17_022, 17_453, 17_891, 18_073, 18_562, 18_980, 19_030,
|
36
|
-
19_932, 20_075, 20_745, 21_544, 22_633, 23_200, 24_167, 25_700,
|
37
|
-
26_360, 26_591, 26_776, 28_443, 28_905, 29_577, 32_705
|
38
|
-
]
|
39
|
-
power = [1, 2, 4, 8, 16, 16, 32, 64, 64, 128, 128, 128, 256, 256,
|
40
|
-
256, 256, 256, 256, 512, 512, 512, 512, 1024, 1024, 1024, 1024,
|
41
|
-
1024, 1024, 1024, 1024, 2048, 2048, 2048, 2048, 2048, 2048, 2048,
|
42
|
-
2048, 2048, 4096, 4096, 4096, 4096, 4096, 4096, 4096, 4096, 4096,
|
43
|
-
4096, 4096, 4096, 4096, 4096, 8192, 8192, 8192, 8192, 8192, 8192,
|
44
|
-
8192, 8192, 8192, 8192, 8192, 8192, 8192, 8192, 8192, 8192, 8192,
|
45
|
-
16_384, 16_384, 16_384, 16_384, 16_384, 16_384, 16_384, 16_384,
|
46
|
-
16_384, 16_384, 16_384, 16_384, 16_384, 16_384, 16_384, 16_384,
|
47
|
-
16_384, 16_384, 16_384, 16_384, 16_384, 16_384, 16_384, 32_768,
|
48
|
-
32_768, 32_768, 32_768, 32_768, 32_768, 32_768, 32_768, 32_768,
|
49
|
-
32_768, 32_768, 32_768, 32_768, 32_768, 32_768, 32_768, 32_768,
|
50
|
-
32_768, 32_768, 32_768, 32_768, 32_768, 32_768, 32_768, 32_768,
|
51
|
-
32_768, 32_768, 32_768
|
52
|
-
]
|
53
|
-
|
54
|
-
design = Array.new(number_of_factors)
|
55
|
-
design.each_index do |i|
|
56
|
-
design[i] = Array.new(power[number_of_factors], 0)
|
57
|
-
design[i][index[i]] = 1
|
58
|
-
design[i].hadamard
|
59
|
-
end
|
60
|
-
design.transpose
|
61
|
-
end
|
7
|
+
require 'datafarming/factorial_generator'
|
62
8
|
|
63
9
|
def print_descriptor
|
64
10
|
description = [
|
@@ -76,28 +22,28 @@ def print_directions # :nodoc:
|
|
76
22
|
'', 'Syntax:', '',
|
77
23
|
" ruby #{prog} [Options] #factors | low/high-settings".yellow, '',
|
78
24
|
"The vertical bar '|' indicates valid alternatives.", '',
|
79
|
-
|
25
|
+
'Command-line args must specify either:',
|
80
26
|
' - the number of factors for the design; or',
|
81
27
|
' - low and hi values for all factors.', '',
|
82
28
|
"\nOptions:",
|
83
29
|
' --help | -h | -? | ?'.green,
|
84
30
|
"\tProduce this help message.",
|
85
|
-
|
31
|
+
' --design-only | -d'.green,
|
86
32
|
"\tprint the design without labeling",
|
87
|
-
|
33
|
+
' --csv | -c'.green,
|
88
34
|
"\tprint the design as comma separated",
|
89
|
-
|
35
|
+
' --center | -a'.green,
|
90
36
|
"\tadd global center pt to check linearity",
|
91
|
-
|
37
|
+
' --star | -s'.green,
|
92
38
|
"\taugment with Central Composite Design pts (includes --center)",
|
93
|
-
|
39
|
+
' --rotatable | -r'.green,
|
94
40
|
"\tscale a CCD design to be rotatable (includes --star)",
|
95
41
|
''
|
96
42
|
]
|
97
43
|
STDERR.puts help_msg
|
98
44
|
end
|
99
45
|
|
100
|
-
print_descriptor && print_directions &&
|
46
|
+
(print_descriptor && print_directions && exit) if ARGV.empty?
|
101
47
|
begin
|
102
48
|
labels = true
|
103
49
|
csv = false
|
@@ -129,13 +75,13 @@ begin
|
|
129
75
|
when '-h', '--help', '-?', '?'
|
130
76
|
print_descriptor
|
131
77
|
print_directions
|
132
|
-
|
78
|
+
exit
|
133
79
|
else
|
134
80
|
raise "Unknown option #{arg}"
|
135
81
|
end
|
136
82
|
end
|
137
83
|
|
138
|
-
if ARGV.
|
84
|
+
if ARGV.empty?
|
139
85
|
raise 'Must specify a design size'
|
140
86
|
elsif ARGV.length == 1
|
141
87
|
n = ARGV.shift.to_i
|
@@ -0,0 +1,55 @@
|
|
1
|
+
require 'fwt'
|
2
|
+
|
3
|
+
# Generate a Resolution V Fractional Factorial design for the specified
|
4
|
+
# number of factors. The design is guaranteed to yield unconfounded
|
5
|
+
# interactions for all pairs of factors. The design uses standardized
|
6
|
+
# notation, i.e., -1 represents a low setting and 1 represents a high
|
7
|
+
# setting for each factor.
|
8
|
+
#
|
9
|
+
# *Arguments*::
|
10
|
+
# - +number_of_factors+ -> the number of factors in your design. Limit is 120.
|
11
|
+
# *Returns*::
|
12
|
+
# - a two-dimensional array specifying the design, where each column
|
13
|
+
# corresponds to a factor and each row is a design point.
|
14
|
+
#
|
15
|
+
# Author:: Paul J Sanchez (mailto:pjs@alum.mit.edu)
|
16
|
+
# Copyright:: Copyright (c) Paul J Sanchez
|
17
|
+
# License:: LGPL
|
18
|
+
#
|
19
|
+
def make_design(number_of_factors)
|
20
|
+
index = [1, 2, 4, 8, 15, 16, 32, 51, 64, 85, 106, 128, 150, 171,
|
21
|
+
219, 237, 247, 256, 279, 297, 455, 512, 537, 557, 594, 643, 803,
|
22
|
+
863, 998, 1024, 1051, 1070, 1112, 1169, 1333, 1345, 1620, 1866,
|
23
|
+
2048, 2076, 2085, 2185, 2372, 2456, 2618, 2800, 2873, 3127, 3284,
|
24
|
+
3483, 3557, 3763, 4096, 4125, 4135, 4174, 4435, 4459, 4469, 4497,
|
25
|
+
4752, 5255, 5732, 5804, 5915, 6100, 6369, 6907, 7069, 8192, 8263,
|
26
|
+
8351, 8422, 8458, 8571, 8750, 8858, 9124, 9314, 9500, 10_026,
|
27
|
+
10_455, 10_556, 11_778, 11_885, 11_984, 13_548, 14_007, 14_514,
|
28
|
+
14_965, 15_125, 15_554, 16_384, 16_457, 16_517, 16_609, 16_771,
|
29
|
+
16_853, 17_022, 17_453, 17_891, 18_073, 18_562, 18_980, 19_030,
|
30
|
+
19_932, 20_075, 20_745, 21_544, 22_633, 23_200, 24_167, 25_700,
|
31
|
+
26_360, 26_591, 26_776, 28_443, 28_905, 29_577, 32_705
|
32
|
+
]
|
33
|
+
power = [1, 2, 4, 8, 16, 16, 32, 64, 64, 128, 128, 128, 256, 256,
|
34
|
+
256, 256, 256, 256, 512, 512, 512, 512, 1024, 1024, 1024, 1024,
|
35
|
+
1024, 1024, 1024, 1024, 2048, 2048, 2048, 2048, 2048, 2048, 2048,
|
36
|
+
2048, 2048, 4096, 4096, 4096, 4096, 4096, 4096, 4096, 4096, 4096,
|
37
|
+
4096, 4096, 4096, 4096, 4096, 8192, 8192, 8192, 8192, 8192, 8192,
|
38
|
+
8192, 8192, 8192, 8192, 8192, 8192, 8192, 8192, 8192, 8192, 8192,
|
39
|
+
16_384, 16_384, 16_384, 16_384, 16_384, 16_384, 16_384, 16_384,
|
40
|
+
16_384, 16_384, 16_384, 16_384, 16_384, 16_384, 16_384, 16_384,
|
41
|
+
16_384, 16_384, 16_384, 16_384, 16_384, 16_384, 16_384, 32_768,
|
42
|
+
32_768, 32_768, 32_768, 32_768, 32_768, 32_768, 32_768, 32_768,
|
43
|
+
32_768, 32_768, 32_768, 32_768, 32_768, 32_768, 32_768, 32_768,
|
44
|
+
32_768, 32_768, 32_768, 32_768, 32_768, 32_768, 32_768, 32_768,
|
45
|
+
32_768, 32_768, 32_768
|
46
|
+
]
|
47
|
+
|
48
|
+
design = Array.new(number_of_factors)
|
49
|
+
design.each_index do |i|
|
50
|
+
design[i] = Array.new(power[number_of_factors], 0)
|
51
|
+
design[i][index[i]] = 1
|
52
|
+
design[i].hadamard
|
53
|
+
end
|
54
|
+
design.transpose
|
55
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: datafarming
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Paul J Sanchez
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-07-
|
11
|
+
date: 2018-07-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fwt
|
@@ -94,6 +94,7 @@ files:
|
|
94
94
|
- exe/stripheaders.rb
|
95
95
|
- lib/datafarming/cross.rb
|
96
96
|
- lib/datafarming/error_handling.rb
|
97
|
+
- lib/datafarming/factorial_generator.rb
|
97
98
|
- lib/datafarming/freq_sets.rb
|
98
99
|
- lib/datafarming/nolh_designs.rb
|
99
100
|
homepage: https://gitlab.nps.edu/pjsanche/datafarmingrubyscripts.git
|