The Altair Community is migrating to a new platform to provide a better experience for you. In preparation for the migration, the Altair Community is on read-only mode from October 28 - November 6, 2024. Technical support via cases will continue to work as is. For any urgent requests from Students/Faculty members, please submit the form linked here
Logistic Regression on regression problem throws error
Hi there,
so I'm trying to fit the Logistic Regression operator (regular one, neither SVM or Evolutionary) on a regression problem (numerical label).
Therefore, I set the label attribute as label and convert it with Numerical2Binominal and throw it into a cross validation subprocess with the logistic regression in it.
Afterwards I would reconvert both label and prediction back to numerical and assess the regression performance.
Therefore, I set the label attribute as label and convert it with Numerical2Binominal and throw it into a cross validation subprocess with the logistic regression in it.
Afterwards I would reconvert both label and prediction back to numerical and assess the regression performance.
Now, when running the Logistic Regression operator in the training phase throws the following error:
'Model training error (H2O).
Error while training the H2O model: Illegal argument(s) for GLM model: ERRR on field: _response: Response cannot be constant.'
The issue is: I don't have any attribute called reponse or similar. Even outputting the data before the Log. Reg. operator does not show any sign of 'response'.
So, any idea how to fix or bypass this?
Any help is appreciated.
'Model training error (H2O).
Error while training the H2O model: Illegal argument(s) for GLM model: ERRR on field: _response: Response cannot be constant.'
The issue is: I don't have any attribute called reponse or similar. Even outputting the data before the Log. Reg. operator does not show any sign of 'response'.
So, any idea how to fix or bypass this?
Any help is appreciated.
Fabian
<?xml version="1.0" encoding="UTF-8"?><process version="9.3.001"><br> <context><br> <input/><br> <output/><br> <macros/><br> </context><br> <operator activated="true" class="process" compatibility="9.3.001" expanded="true" name="Process"><br> <parameter key="logverbosity" value="init"/><br> <parameter key="random_seed" value="2001"/><br> <parameter key="send_mail" value="never"/><br> <parameter key="notification_email" value=""/><br> <parameter key="process_duration_for_mail" value="30"/><br> <parameter key="encoding" value="SYSTEM"/><br> <process expanded="true"><br> <operator activated="true" class="read_excel" compatibility="9.3.001" expanded="true" height="68" name="Read Excel" width="90" x="112" y="34"><br> <parameter key="excel_file" value=""/><br> <parameter key="sheet_selection" value="sheet number"/><br> <parameter key="sheet_number" value="3"/><br> <parameter key="imported_cell_range" value="A1"/><br> <parameter key="encoding" value="SYSTEM"/><br> <parameter key="first_row_as_names" value="true"/><br> <list key="annotations"/><br> <parameter key="date_format" value=""/><br> <parameter key="time_zone" value="SYSTEM"/><br> <parameter key="locale" value="English (United States)"/><br> <parameter key="read_all_values_as_polynominal" value="false"/><br> <list key="data_set_meta_data_information"/><br> <parameter key="read_not_matching_values_as_missings" value="true"/><br> <parameter key="datamanagement" value="double_array"/><br> <parameter key="data_management" value="auto"/><br> </operator><br> <operator activated="true" class="set_role" compatibility="9.3.001" expanded="true" height="82" name="Set Role" width="90" x="313" y="34"><br> <parameter key="attribute_name" value="ActionType"/><br> <parameter key="target_role" value="label"/><br> <list key="set_additional_roles"/><br> </operator><br> <operator activated="true" class="numerical_to_binominal" compatibility="9.3.001" expanded="true" height="82" name="Numerical to Binominal" width="90" x="514" y="34"><br> <parameter key="attribute_filter_type" value="single"/><br> <parameter key="attribute" value="ActionType"/><br> <parameter key="attributes" value=""/><br> <parameter key="use_except_expression" value="false"/><br> <parameter key="value_type" value="numeric"/><br> <parameter key="use_value_type_exception" value="false"/><br> <parameter key="except_value_type" value="real"/><br> <parameter key="block_type" value="value_series"/><br> <parameter key="use_block_type_exception" value="false"/><br> <parameter key="except_block_type" value="value_series_end"/><br> <parameter key="invert_selection" value="false"/><br> <parameter key="include_special_attributes" value="true"/><br> <parameter key="min" value="0.0"/><br> <parameter key="max" value="0.0"/><br> </operator><br> <operator activated="true" class="concurrency:cross_validation" compatibility="9.3.001" expanded="true" height="145" name="Cross Validation" width="90" x="715" y="34"><br> <parameter key="split_on_batch_attribute" value="false"/><br> <parameter key="leave_one_out" value="false"/><br> <parameter key="number_of_folds" value="10"/><br> <parameter key="sampling_type" value="automatic"/><br> <parameter key="use_local_random_seed" value="false"/><br> <parameter key="local_random_seed" value="1992"/><br> <parameter key="enable_parallel_execution" value="true"/><br> <process expanded="true"><br> <operator activated="true" class="write_excel" compatibility="9.3.001" expanded="true" height="103" name="Write Excel" width="90" x="45" y="34"><br> <parameter key="excel_file" value="C:\Users\Fabian\Desktop\test.xlsx"/><br> <parameter key="file_format" value="xlsx"/><br> <enumeration key="sheet_names"/><br> <parameter key="sheet_name" value="RapidMiner Data"/><br> <parameter key="date_format" value="yyyy-MM-dd HH:mm:ss"/><br> <parameter key="number_format" value="#.0"/><br> <parameter key="encoding" value="SYSTEM"/><br> </operator><br> <operator activated="true" class="h2o:logistic_regression" compatibility="9.3.001" expanded="true" height="124" name="Logistic Regression" width="90" x="246" y="34"><br> <parameter key="solver" value="AUTO"/><br> <parameter key="reproducible" value="false"/><br> <parameter key="maximum_number_of_threads" value="4"/><br> <parameter key="use_regularization" value="false"/><br> <parameter key="lambda_search" value="false"/><br> <parameter key="number_of_lambdas" value="0"/><br> <parameter key="lambda_min_ratio" value="0.0"/><br> <parameter key="early_stopping" value="true"/><br> <parameter key="stopping_rounds" value="3"/><br> <parameter key="stopping_tolerance" value="0.001"/><br> <parameter key="standardize" value="false"/><br> <parameter key="non-negative_coefficients" value="false"/><br> <parameter key="add_intercept" value="false"/><br> <parameter key="compute_p-values" value="false"/><br> <parameter key="remove_collinear_columns" value="false"/><br> <parameter key="missing_values_handling" value="Skip"/><br> <parameter key="max_iterations" value="0"/><br> <parameter key="max_runtime_seconds" value="0"/><br> </operator><br> <connect from_port="training set" to_op="Write Excel" to_port="input"/><br> <connect from_op="Write Excel" from_port="through" to_op="Logistic Regression" to_port="training set"/><br> <connect from_op="Logistic Regression" from_port="model" to_port="model"/><br> <portSpacing port="source_training set" spacing="0"/><br> <portSpacing port="sink_model" spacing="0"/><br> <portSpacing port="sink_through 1" spacing="0"/><br> </process><br> <process expanded="true"><br> <operator activated="true" class="apply_model" compatibility="9.3.001" expanded="true" height="82" name="Apply Model" width="90" x="45" y="34"><br> <list key="application_parameters"/><br> <parameter key="create_view" value="false"/><br> </operator><br> <operator activated="true" class="nominal_to_numerical" compatibility="9.3.001" expanded="true" height="103" name="Nominal to Numerical" width="90" x="246" y="34"><br> <parameter key="return_preprocessing_model" value="false"/><br> <parameter key="create_view" value="false"/><br> <parameter key="attribute_filter_type" value="single"/><br> <parameter key="attribute" value="ActionType"/><br> <parameter key="attributes" value=""/><br> <parameter key="use_except_expression" value="false"/><br> <parameter key="value_type" value="nominal"/><br> <parameter key="use_value_type_exception" value="false"/><br> <parameter key="except_value_type" value="file_path"/><br> <parameter key="block_type" value="single_value"/><br> <parameter key="use_block_type_exception" value="false"/><br> <parameter key="except_block_type" value="single_value"/><br> <parameter key="invert_selection" value="false"/><br> <parameter key="include_special_attributes" value="true"/><br> <parameter key="coding_type" value="dummy coding"/><br> <parameter key="use_comparison_groups" value="false"/><br> <list key="comparison_groups"/><br> <parameter key="unexpected_value_handling" value="all 0 and warning"/><br> <parameter key="use_underscore_in_name" value="false"/><br> </operator><br> <operator activated="true" class="performance_regression" compatibility="9.3.001" expanded="true" height="82" name="Performance" width="90" x="447" y="34"><br> <parameter key="main_criterion" value="first"/><br> <parameter key="root_mean_squared_error" value="true"/><br> <parameter key="absolute_error" value="false"/><br> <parameter key="relative_error" value="false"/><br> <parameter key="relative_error_lenient" value="false"/><br> <parameter key="relative_error_strict" value="false"/><br> <parameter key="normalized_absolute_error" value="false"/><br> <parameter key="root_relative_squared_error" value="false"/><br> <parameter key="squared_error" value="false"/><br> <parameter key="correlation" value="false"/><br> <parameter key="squared_correlation" value="false"/><br> <parameter key="prediction_average" value="false"/><br> <parameter key="spearman_rho" value="false"/><br> <parameter key="kendall_tau" value="false"/><br> <parameter key="skip_undefined_labels" value="true"/><br> <parameter key="use_example_weights" value="true"/><br> </operator><br> <connect from_port="model" to_op="Apply Model" to_port="model"/><br> <connect from_port="test set" to_op="Apply Model" to_port="unlabelled data"/><br> <connect from_op="Apply Model" from_port="labelled data" to_op="Nominal to Numerical" to_port="example set input"/><br> <connect from_op="Nominal to Numerical" from_port="example set output" to_op="Performance" to_port="labelled data"/><br> <connect from_op="Performance" from_port="performance" to_port="performance 1"/><br> <portSpacing port="source_model" spacing="0"/><br> <portSpacing port="source_test set" spacing="0"/><br> <portSpacing port="source_through 1" spacing="0"/><br> <portSpacing port="sink_test set results" spacing="0"/><br> <portSpacing port="sink_performance 1" spacing="0"/><br> <portSpacing port="sink_performance 2" spacing="0"/><br> </process><br> </operator><br> <connect from_op="Read Excel" from_port="output" to_op="Set Role" to_port="example set input"/><br> <connect from_op="Set Role" from_port="example set output" to_op="Numerical to Binominal" to_port="example set input"/><br> <connect from_op="Numerical to Binominal" from_port="example set output" to_op="Cross Validation" to_port="example set"/><br> <connect from_op="Cross Validation" from_port="performance 1" to_port="result 1"/><br> <portSpacing port="source_input 1" spacing="0"/><br> <portSpacing port="sink_result 1" spacing="0"/><br> <portSpacing port="sink_result 2" spacing="0"/><br> </process><br> </operator><br></process><br><br>
Tagged:
0
Best Answer
-
hughesfleming68 Member Posts: 323 UnicornYour numerical to binomial needs to have two different values. Min-Max should be 0 and 1 and not 0 and 0 in your setup. As Varun mentioned, debugging is much easier with data.6
Answers
If possible can you provide some sample data here or in a private message, so that we will reproduce the error to check what is happening
Thanks
Varun
https://www.varunmandalapu.com/
Be Safe. Follow precautions and Maintain Social Distancing
Just to add to the above answers, the word 'response' in the error message means the label (a.k.a. the "response variable" in a common terminology), and it seems that your dataset has only "0" label for all examples, so cross-validation cannot be applied.
Vladimir
http://whatthefraud.wtf
@hughesfleming68 thanks so much. Kind of feeling stupid right now. Changed the max. parameter and it worked.
Now only have to play around with the labels for the performance operator
regards,
Alex