Skip to content

Commit f6e44c3

Browse files
committed
feat(cli): show defaults for all numeric options in help
- Add defaults for --learning-rate (0.1), --regularization (0.01), --max-iterations (100) - Remove -f lsi.json from LSI examples for simpler copy-paste
1 parent 30625ce commit f6e44c3

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

lib/classifier/cli.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -100,15 +100,15 @@ def parse_options
100100
@options[:weighted] = true
101101
end
102102

103-
opts.on('--learning-rate N', Float, 'Learning rate for logistic regression') do |n|
103+
opts.on('--learning-rate N', Float, 'Learning rate for logistic regression (default: 0.1)') do |n|
104104
@options[:learning_rate] = n
105105
end
106106

107-
opts.on('--regularization N', Float, 'L2 regularization for logistic regression') do |n|
107+
opts.on('--regularization N', Float, 'L2 regularization for logistic regression (default: 0.01)') do |n|
108108
@options[:regularization] = n
109109
end
110110

111-
opts.on('--max-iterations N', Integer, 'Max iterations for logistic regression') do |n|
111+
opts.on('--max-iterations N', Integer, 'Max iterations for logistic regression (default: 100)') do |n|
112112
@options[:max_iterations] = n
113113
end
114114

@@ -547,9 +547,9 @@ def show_getting_started
547547
@output << ''
548548
@output << 'Use LSI for semantic search:'
549549
@output << ''
550-
@output << " echo 'ruby is a dynamic programming language' | classifier train docs -m lsi -f lsi.json"
551-
@output << " echo 'python is great for data science' | classifier train docs -m lsi -f lsi.json"
552-
@output << " classifier search 'programming' -f lsi.json"
550+
@output << " echo 'ruby is a dynamic programming language' | classifier train docs -m lsi"
551+
@output << " echo 'python is great for data science' | classifier train docs -m lsi"
552+
@output << " classifier search 'programming'"
553553
@output << ''
554554
@output << 'Options:'
555555
@output << ' -f FILE Model file (default: ./classifier.json)'

0 commit comments

Comments
 (0)