目前正在进行一个教育数据挖掘项目。我在一些数据集中遇到了一个很常见的问题,但我无法在任何地方找到这个问题的解决方案。每当我运行我的流程时,总是显示
‘只有一个标签’,逻辑回归学习方案没有足够的能力来处理只有一个标签的示例集。如果只知道一个类别的示例,有现成的特殊建模操作符支持’单类标签’功能。
我有一些只有一个标签的数据集,运行得很好。我还尝试编辑标签,因为我使用了多标签。我无法理解这个问题。请帮帮我吧!下面是我的XML代码。
<?xml version="1.0" encoding="UTF-8"?> <process version="9.7.001"> <context> <input/> <output/> <macros/> </context> <operator activated="true" class="process" compatibility="9.7.001" expanded="true" name="Process"> <parameter key="logverbosity" value="init"/> <parameter key="random_seed" value="2001"/> <parameter key="send_mail" value="never"/> <parameter key="notification_email" value=""/> <parameter key="process_duration_for_mail" value="30"/> <parameter key="encoding" value="SYSTEM"/> <process expanded="true"> <operator activated="true" class="read_excel" compatibility="9.7.001" expanded="true" height="68" name="Read Excel" width="90" x="45" y="34"> <parameter key="excel_file" value="D:\MyDocuments\CMUFiles\RESEARCH AND EXTENSION\SHs Performance NAT in Bukidnon\ExcelSubjectTemplate\Language-and-communication\finaldataAnalysis\Humss-Language-and-Communication.xlsx"/> <parameter key="sheet_selection" value="sheet number"/> <parameter key="sheet_number" value="1"/> <parameter key="imported_cell_range" value="A1"/> <parameter key="encoding" value="SYSTEM"/> <parameter key="first_row_as_names" value="true"/> <list key="annotations"/> <parameter key="date_format" value=""/> <parameter key="time_zone" value="SYSTEM"/> <parameter key="locale" value="English (United States)"/> <parameter key="read_all_values_as_polynominal" value="false"/> <list key="data_set_meta_data_information"> <parameter key="0" value="Name.true.polynominal.attribute"/> <parameter key="1" value="OC-G11-Q1.true.integer.attribute"/> <parameter key="2" value="OC-G11-Q2.true.integer.attribute"/> <parameter key="3" value="F-G11-Q1.true.integer.attribute"/> <parameter key="4" value="F-G11-Q2.true.integer.attribute"/> <parameter key="5" value="RWS-G11-Q3.true.integer.attribute"/> <parameter key="6" value="RWS-G11-Q4.true.integer.attribute"/> <parameter key="7" value="F-G11-Q3.true.integer.attribute"/> <parameter key="8" value="F-G11-Q4.true.integer.attribute"/> <parameter key="9" value="CW-G12-Q1.true.integer.attribute"/> <parameter key="10" value="CW-G12-Q2.true.integer.attribute"/> <parameter key="11" value="LC-PS-NAT.true.real.attribute"/> <parameter key="12" value="LC-PS-NAT-Rem.true.polynominal.attribute"/> <parameter key="13" value="LC-IL-NAT.true.real.attribute"/> <parameter key="14" value="LC-IL-NAT-Rem.true.polynominal.attribute"/> <parameter key="15" value="LC-CT-NAT.true.real.attribute"/> <parameter key="16" value="LC-CT-NAT-Rem.true.polynominal.attribute"/> <parameter key="17" value="Total-MPS.true.real.attribute"/> <parameter key="18" value="overall-remarks.true.polynominal.attribute"/> <parameter key="19" value="T.true.polynominal.attribute"/> <parameter key="20" value="U.true.polynominal.attribute"/> <parameter key="21" value="V.true.polynominal.attribute"/> </list> <parameter key="read_not_matching_values_as_missings" value="false"/> <parameter key="datamanagement" value="double_array"/> <parameter key="data_management" value="auto"/> </operator> <operator activated="true" class="subprocess" compatibility="9.7.001" expanded="true" height="82" name="Subprocess" width="90" x="179" y="34"> <process expanded="true"> <operator activated="true" class="replace_missing_values" compatibility="9.7.001" expanded="true" height="103" name="Replace Missing Values" width="90" x="45" y="34"> <parameter key="return_preprocessing_model" value="false"/> <parameter key="create_view" value="false"/> <parameter key="attribute_filter_type" value="all"/> <parameter key="attribute" value=""/> <parameter key="attributes" value=""/> <parameter key="use_except_expression" value="false"/> <parameter key="value_type" value="attribute_value"/> <parameter key="use_value_type_exception" value="false"/> <parameter key="except_value_type" value="time"/> <parameter key="block_type" value="attribute_block"/> <parameter key="use_block_type_exception" value="false"/> <parameter key="except_block_type" value="value_matrix_row_start"/> <parameter key="invert_selection" value="false"/> <parameter key="include_special_attributes" value="false"/> <parameter key="default" value="average"/> <list key="columns"/> </operator> <operator activated="true" class="generate_id" compatibility="9.7.001" expanded="true" height="82" name="Generate ID" width="90" x="179" y="34"> <parameter key="create_nominal_ids" value="true"/> <parameter key="offset" value="0"/> </operator> <operator activated="true" class="select_attributes" compatibility="9.7.001" expanded="true" height="82" name="Select Attributes" width="90" x="313" y="34"> <parameter key="attribute_filter_type" value="subset"/> <parameter key="attribute" value=""/> <parameter key="attributes" value="CW-G12-Q1|CW-G12-Q2|F-G11-Q1|F-G11-Q2|F-G11-Q3|F-G11-Q4|OC-G11-Q1|OC-G11-Q2|overall-remarks|RWS-G11-Q3|RWS-G11-Q4"/> <parameter key="use_except_expression" value="false"/> <parameter key="value_type" value="attribute_value"/> <parameter key="use_value_type_exception" value="false"/> <parameter key="except_value_type" value="time"/> <parameter key="block_type" value="attribute_block"/> <parameter key="use_block_type_exception" value="false"/> <parameter key="except_block_type" value="value_matrix_row_start"/> <parameter key="invert_selection" value="false"/> <parameter key="include_special_attributes" value="false"/> </operator> <operator activated="true" class="remove_useless_attributes" compatibility="9.7.001" expanded="true" height="82" name="Remove Useless Attributes" width="90" x="514" y="34"> <parameter key="numerical_min_deviation" value="0.0"/> <parameter key="nominal_useless_above" value="1.0"/> <parameter key="nominal_remove_id_like" value="false"/> <parameter key="nominal_useless_below" value="0.0"/> </operator> <connect from_port="in 1" to_op="Replace Missing Values" to_port="example set input"/> <connect from_op="Replace Missing Values" from_port="example set output" to_op="Generate ID" to_port="example set input"/> <connect from_op="Generate ID" from_port="example set output" to_op="Select Attributes" to_port="example set input"/> <connect from_op="Select Attributes" from_port="example set output" to_op="Remove Useless Attributes" to_port="example set input"/> <connect from_op="Remove Useless Attributes" from_port="example set output" to_port="out 1"/> <portSpacing port="source_in 1" spacing="0"/> <portSpacing port="source_in 2" spacing="0"/> <portSpacing port="sink_out 1" spacing="0"/> <portSpacing port="sink_out 2" spacing="0"/> </process> </operator> <operator activated="true" class="set_role" compatibility="9.7.001" expanded="true" height="82" name="Set Role" width="90" x="313" y="34"> <parameter key="attribute_name" value="id"/> <parameter key="target_role" value="batch"/> <list key="set_additional_roles"> <parameter key="overall-remarks" value="label"/> </list> </operator> <operator activated="true" class="split_data" compatibility="9.7.001" expanded="true" height="103" name="Split Data" width="90" x="447" y="85"> <enumeration key="partitions"> <parameter key="ratio" value="0.7"/> <parameter key="ratio" value="0.3"/> </enumeration> <parameter key="sampling_type" value="automatic"/> <parameter key="use_local_random_seed" value="true"/> <parameter key="local_random_seed" value="1992"/> </operator> <operator activated="true" class="optimize_selection_evolutionary" compatibility="9.7.001" expanded="true" height="145" name="Optimize Selection (Evolutionary)" width="90" x="581" y="34"> <parameter key="use_exact_number_of_attributes" value="false"/> <parameter key="restrict_maximum" value="false"/> <parameter key="min_number_of_attributes" value="1"/> <parameter key="max_number_of_attributes" value="1"/> <parameter key="exact_number_of_attributes" value="1"/> <parameter key="initialize_with_input_weights" value="false"/> <parameter key="population_size" value="5"/> <parameter key="maximum_number_of_generations" value="30"/> <parameter key="use_early_stopping" value="false"/> <parameter key="generations_without_improval" value="2"/> <parameter key="normalize_weights" value="true"/> <parameter key="use_local_random_seed" value="false"/> <parameter key="local_random_seed" value="1992"/> <parameter key="user_result_individual_selection" value="false"/> <parameter key="show_population_plotter" value="false"/> <parameter key="plot_generations" value="10"/> <parameter key="constraint_draw_range" value="false"/> <parameter key="draw_dominated_points" value="true"/> <parameter key="maximal_fitness" value="Infinity"/> <parameter key="selection_scheme" value="tournament"/> <parameter key="tournament_size" value="0.25"/> <parameter key="start_temperature" value="1.0"/> <parameter key="dynamic_selection_pressure" value="true"/> <parameter key="keep_best_individual" value="false"/> <parameter key="save_intermediate_weights" value="false"/> <parameter key="intermediate_weights_generations" value="10"/> <parameter key="p_initialize" value="0.5"/> <parameter key="p_mutation" value="-1.0"/> <parameter key="p_crossover" value="0.5"/> <parameter key="crossover_type" value="uniform"/> <process expanded="true"> <operator activated="true" class="time_series:multi_label_model_learner" compatibility="9.7.000" expanded="true" height="103" name="Multi Label Modeling" width="90" x="112" y="34"> <parameter key="attribute_filter_type" value="subset"/> <parameter key="attribute" value=""/> <parameter key="attributes" value="overall-remarks"/> <parameter key="use_except_expression" value="false"/> <parameter key="value_type" value="attribute_value"/> <parameter key="use_value_type_exception" value="false"/> <parameter key="except_value_type" value="time"/> <parameter key="block_type" value="attribute_block"/> <parameter key="use_block_type_exception" value="false"/> <parameter key="except_block_type" value="value_matrix_row_start"/> <parameter key="invert_selection" value="false"/> <parameter key="include_special_attributes" value="true"/> <parameter key="add_macros" value="false"/> <parameter key="current_label_name_macro" value="current_label_attribute"/> <parameter key="current_label_type_macro" value="current_label_type"/> <parameter key="enable_parallel_execution" value="true"/> <process expanded="true"> <operator activated="true" class="set_role" compatibility="9.7.001" expanded="true" height="82" name="Set Role (2)" width="90" x="112" y="34"> <parameter key="attribute_name" value="overall-remarks"/> <parameter key="target_role" value="label"/> <list key="set_additional_roles"/> </operator> <operator activated="true" class="concurrency:cross_validation" compatibility="9.7.001" expanded="true" height="145" name="Cross Validation" width="90" x="313" y="34"> <parameter key="split_on_batch_attribute" value="false"/> <parameter key="leave_one_out" value="false"/> <parameter key="number_of_folds" value="10"/> <parameter key="sampling_type" value="automatic"/> <parameter key="use_local_random_seed" value="false"/> <parameter key="local_random_seed" value="1992"/> <parameter key="enable_parallel_execution" value="true"/> <process expanded="true"> <operator activated="true" class="polynomial_by_binomial_classification" compatibility="9.7.001" expanded="true" height="82" name="Polynominal by Binominal Classification" width="90" x="179" y="34"> <parameter key="classification_strategies" value="1 against all"/> <parameter key="random_code_multiplicator" value="2.0"/> <parameter key="use_local_random_seed" value="false"/> <parameter key="local_random_seed" value="1992"/> <process expanded="true"> <operator activated="true" class="h2o:logistic_regression" compatibility="9.7.001" expanded="true" height="124" name="Logistic Regression" width="90" x="45" y="136"> <parameter key="solver" value="AUTO"/> <parameter key="reproducible" value="false"/> <parameter key="maximum_number_of_threads" value="4"/> <parameter key="use_regularization" value="false"/> <parameter key="lambda_search" value="false"/> <parameter key="number_of_lambdas" value="0"/> <parameter key="lambda_min_ratio" value="0.0"/> <parameter key="early_stopping" value="true"/> <parameter key="stopping_rounds" value="3"/> <parameter key="stopping_tolerance" value="0.001"/> <parameter key="standardize" value="true"/> <parameter key="non-negative_coefficients" value="false"/> <parameter key="add_intercept" value="true"/> <parameter key="compute_p-values" value="true"/> <parameter key="remove_collinear_columns" value="true"/> <parameter key="missing_values_handling" value="MeanImputation"/> <parameter key="max_iterations" value="0"/> <parameter key="max_runtime_seconds" value="0"/> </operator> <connect from_port="training set" to_op="Logistic Regression" to_port="training set"/> <connect from_op="Logistic Regression" from_port="model" to_port="model"/> <portSpacing port="source_training set" spacing="0"/> <portSpacing port="sink_model" spacing="0"/> </process> </operator> <connect from_port="training set" to_op="Polynominal by Binominal Classification" to_port="training set"/> <connect from_op="Polynominal by Binominal Classification" from_port="model" to_port="model"/> <portSpacing port="source_training set" spacing="0"/> <portSpacing port="sink_model" spacing="0"/> <portSpacing port="sink_through 1" spacing="0"/> </process> <process expanded="true"> <operator activated="true" class="apply_model" compatibility="9.7.001" expanded="true" height="82" name="Apply Model" width="90" x="45" y="34"> <list key="application_parameters"/> <parameter key="create_view" value="false"/> </operator> <operator activated="true" class="performance_classification" compatibility="9.7.001" expanded="true" height="82" name="Performance" width="90" x="179" y="34"> <parameter key="main_criterion" value="first"/> <parameter key="accuracy" value="true"/> <parameter key="classification_error" value="false"/> <parameter key="kappa" value="false"/> <parameter key="weighted_mean_recall" value="false"/> <parameter key="weighted_mean_precision" value="false"/> <parameter key="spearman_rho" value="false"/> <parameter key="kendall_tau" value="false"/> <parameter key="absolute_error" value="false"/> <parameter key="relative_error" value="false"/> <parameter key="relative_error_lenient" value="false"/> <parameter key="relative_error_strict" value="false"/> <parameter key="normalized_absolute_error" value="false"/> <parameter key="root_mean_squared_error" value="false"/> <parameter key="root_relative_squared_error" value="false"/> <parameter key="squared_error" value="false"/> <parameter key="correlation" value="false"/> <parameter key="squared_correlation" value="false"/> <parameter key="cross-entropy" value="false"/> <parameter key="margin" value="false"/> <parameter key="soft_margin_loss" value="false"/> <parameter key="logistic_loss" value="false"/> <parameter key="skip_undefined_labels" value="true"/> <parameter key="use_example_weights" value="true"/> <list key="class_weights"/> </operator> <connect from_port="model" to_op="Apply Model" to_port="model"/> <connect from_port="test set" to_op="Apply Model" to_port="unlabelled data"/> <connect from_op="Apply Model" from_port="labelled data" to_op="Performance" to_port="labelled data"/> <connect from_op="Performance" from_port="performance" to_port="performance 1"/> <portSpacing port="source_model" spacing="0"/> <portSpacing port="source_test set" spacing="0"/> <portSpacing port="source_through 1" spacing="0"/> <portSpacing port="sink_test set results" spacing="0"/> <portSpacing port="sink_performance 1" spacing="0"/> <portSpacing port="sink_performance 2" spacing="0"/> </process> </operator> <operator activated="true" class="apply_model" compatibility="9.7.001" expanded="true" height="82" name="Apply Model (2)" width="90" x="514" y="187"> <list key="application_parameters"/> <parameter key="create_view" value="false"/> </operator> <connect from_port="training set" to_op="Set Role (2)" to_port="example set input"/> <connect from_port="input 1" to_op="Apply Model (2)" to_port="unlabelled data"/> <connect from_op="Set Role (2)" from_port="example set output" to_op="Cross Validation" to_port="example set"/> <connect from_op="Cross Validation" from_port="model" to_op="Apply Model (2)" to_port="model"/> <connect from_op="Apply Model (2)" from_port="model" to_port="model"/> <portSpacing port="source_training set" spacing="0"/> <portSpacing port="source_input 1" spacing="0"/> <portSpacing port="source_input 2" spacing="0"/> <portSpacing port="sink_model" spacing="0"/> <portSpacing port="sink_output 1" spacing="0"/> </process> </operator> <operator activated="true" class="apply_model" compatibility="9.7.001" expanded="true" height="82" name="Apply Model (3)" width="90" x="246" y="136"> <list key="application_parameters"/> <parameter key="create_view" value="false"/> </operator> <operator activated="true" class="set_role" compatibility="9.7.001" expanded="true" height="82" name="Set Role (3)" width="90" x="380" y="34"> <parameter key="attribute_name" value="overall-remarks"/> <parameter key="target_role" value="label"/> <list key="set_additional_roles"> <parameter key="prediction(overall-remarks)" value="prediction"/> </list> </operator> <operator activated="true" class="performance_classification" compatibility="9.7.001" expanded="true" height="82" name="Performance (2)" width="90" x="514" y="34"> <parameter key="main_criterion" value="first"/> <parameter key="accuracy" value="true"/> <parameter key="classification_error" value="false"/> <parameter key="kappa" value="false"/> <parameter key="weighted_mean_recall" value="false"/> <parameter key="weighted_mean_precision" value="false"/> <parameter key="spearman_rho" value="false"/> <parameter key="kendall_tau" value="false"/> <parameter key="absolute_error" value="false"/> <parameter key="relative_error" value="false"/> <parameter key="relative_error_lenient" value="false"/> <parameter key="relative_error_strict" value="false"/> <parameter key="normalized_absolute_error" value="false"/> <parameter key="root_mean_squared_error" value="false"/> <parameter key="root_relative_squared_error" value="false"/> <parameter key="squared_error" value="false"/> <parameter key="correlation" value="false"/> <parameter key="squared_correlation" value="false"/> <parameter key="cross-entropy" value="false"/> <parameter key="margin" value="false"/> <parameter key="soft_margin_loss" value="false"/> <parameter key="logistic_loss" value="false"/> <parameter key="skip_undefined_labels" value="true"/> <parameter key="use_example_weights" value="true"/> <list key="class_weights"/> </operator> <connect from_port="example set" to_op="Multi Label Modeling" to_port="input 1"/> <connect from_port="through 1" to_op="Multi Label Modeling" to_port="training set"/> <connect from_port="through 2" to_op="Apply Model (3)" to_port="unlabelled data"/> <connect from_op="Multi Label Modeling" from_port="model" to_op="Apply Model (3)" to_port="model"/> <connect from_op="Apply Model (3)" from_port="labelled data" to_op="Set Role (3)" to_port="example set input"/> <connect from_op="Set Role (3)" from_port="example set output" to_op="Performance (2)" to_port="labelled data"/> <connect from_op="Performance (2)" from_port="performance" to_port="performance"/> <portSpacing port="source_example set" spacing="0"/> <portSpacing port="source_through 1" spacing="0"/> <portSpacing port="source_through 2" spacing="0"/> <portSpacing port="source_through 3" spacing="0"/> <portSpacing port="sink_performance" spacing="0"/> </process> </operator> <connect from_op="Read Excel" from_port="output" to_op="Subprocess" to_port="in 1"/> <connect from_op="Subprocess" from_port="out 1" to_op="Set Role" to_port="example set input"/> <connect from_op="Set Role" from_port="example set output" to_op="Optimize Selection (Evolutionary)" to_port="example set in"/> <connect from_op="Set Role" from_port="original" to_op="Split Data" to_port="example set"/> <connect from_op="Split Data" from_port="partition 1" to_op="Optimize Selection (Evolutionary)" to_port="through 1"/> <connect from_op="Split Data" from_port="partition 2" to_op="Optimize Selection (Evolutionary)" to_port="through 2"/> <connect from_op="Optimize Selection (Evolutionary)" from_port="example set out" to_port="result 1"/> <portSpacing port="source_input 1" spacing="0"/> <portSpacing port="sink_result 1" spacing="0"/> <portSpacing port="sink_result 2" spacing="0"/> </process> </operator> </process>
回答:
从你的流程来看(没有访问数据的情况下),我猜测问题在于你尝试训练逻辑回归的数据集只有一个标签类(例如只有TRUE,没有FALSE)。如果你的示例集中示例很少,并且碰巧只有一个类别出现在训练折叠中,也会发生这种情况。
关于你展示的流程,我还想知道,为什么你在只有一个名为“overall-remarks”的标签列时使用多标签建模。在这种情况下,普通的分类策略应该也能很好地工作。
关于流程设计和RapidMiner的一般问题,我建议你重新在RapidMiner社区发布你的问题:https://community.rapidminer.com