f2caf089885a591c79ee531cc1f13b7995ba7607,tests/test_utilities.py,,check_print_model_weights,#Any#,284
Before Change
// now call print_model_weights on this model and capture the output
print_model_weights_cmd = ["print_model_weights", model_file]
p = subprocess.Popen(print_model_weights_cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
out , err = p.communicate()
print(err)
// now parse the output of the print_model_weight command
// and get the intercept and the feature values
if task == "classification":
After Change
// now call print_model_weights main() and capture the output
print_model_weights_cmd = [model_file]
try:
old_stderr = sys.stderr
old_stdout = sys.stdout
sys.stderr = mystderr = StringIO()
sys.stdout = mystdout = StringIO()
pmw.main(print_model_weights_cmd)
out = mystdout.getvalue()
err = mystderr.getvalue()
print(err)
finally:
sys.stderr = old_stderr
sys.stdout = old_stdout
// now parse the output of the print_model_weight command
// and get the intercept and the feature values
if task == "classification":
lines_to_parse = [l for l in out.split("\n")[1:] if l]
intercept = safe_float(lines_to_parse[0].split("\t")[0])
feature_values = []
In pattern: SUPERPATTERN
Frequency: 4
Non-data size: 15
Instances Project Name: EducationalTestingService/skll
Commit Name: f2caf089885a591c79ee531cc1f13b7995ba7607
Time: 2014-11-01
Author: nmadnani@ets.org
File Name: tests/test_utilities.py
Class Name:
Method Name: check_print_model_weights
Project Name: EducationalTestingService/skll
Commit Name: f2caf089885a591c79ee531cc1f13b7995ba7607
Time: 2014-11-01
Author: nmadnani@ets.org
File Name: tests/test_utilities.py
Class Name:
Method Name: check_generate_predictions_console
Project Name: EducationalTestingService/skll
Commit Name: f2caf089885a591c79ee531cc1f13b7995ba7607
Time: 2014-11-01
Author: nmadnani@ets.org
File Name: tests/test_utilities.py
Class Name:
Method Name: check_print_model_weights
Project Name: EducationalTestingService/skll
Commit Name: f2caf089885a591c79ee531cc1f13b7995ba7607
Time: 2014-11-01
Author: nmadnani@ets.org
File Name: tests/test_utilities.py
Class Name:
Method Name: check_skll_convert
Project Name: EducationalTestingService/skll
Commit Name: f2caf089885a591c79ee531cc1f13b7995ba7607
Time: 2014-11-01
Author: nmadnani@ets.org
File Name: tests/test_utilities.py
Class Name:
Method Name: test_skll_convert_libsvm_map