Options

Hola ¿alguien sabe cómo aplicar el meotod de validación externa a un clúster realizado con kmeans?.

AdlopezAdlopez Member Posts: 1 Newbie
<?xml version="1.0" encoding="UTF-8"?><process version="9.2.000">
  <context>
    <input/>
    <output/>
    <macros/>
  </context>
  <operator activated="true" class="process" compatibility="9.2.000" expanded="true" name="Root" origin="GENERATED_SAMPLE">
    <parameter key="logverbosity" value="init"/>
    <parameter key="random_seed" value="1977"/>
    <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="retrieve" compatibility="9.2.000" expanded="true" height="68" name="Retrieve Estudent Alcohol Consumption" width="90" x="45" y="85">
        <parameter key="repository_entry" value="//MachineLearningUniandes/Taller 3/Ejercicio1/Estudent Alcohol Consumption"/>
        <description align="center" color="yellow" colored="true" width="126">Importamos la data Student Alcohol Consumption, la cual no presenta datos ausentes, corresponde a un total de 395 registros y 34 columnas.</description>
      </operator>
      <operator activated="true" class="remove_duplicates" compatibility="9.2.000" expanded="true" height="103" name="Remove Duplicates" width="90" x="246" y="289">
        <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="treat_missing_values_as_duplicates" value="false"/>
      </operator>
      <operator activated="true" breakpoints="after" class="nominal_to_numerical" compatibility="9.2.000" expanded="true" height="103" name="Nominal to Numerical" width="90" x="179" y="544">
        <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="nominal"/>
        <parameter key="use_value_type_exception" value="false"/>
        <parameter key="except_value_type" value="file_path"/>
        <parameter key="block_type" value="single_value"/>
        <parameter key="use_block_type_exception" value="false"/>
        <parameter key="except_block_type" value="single_value"/>
        <parameter key="invert_selection" value="false"/>
        <parameter key="include_special_attributes" value="false"/>
        <parameter key="coding_type" value="unique integers"/>
        <parameter key="use_comparison_groups" value="false"/>
        <list key="comparison_groups"/>
        <parameter key="unexpected_value_handling" value="all 0 and warning"/>
        <parameter key="use_underscore_in_name" value="false"/>
      </operator>
      <operator activated="true" class="normalize" compatibility="9.2.000" expanded="true" height="103" name="Normalize" width="90" x="581" y="544">
        <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="numeric"/>
        <parameter key="use_value_type_exception" value="false"/>
        <parameter key="except_value_type" value="real"/>
        <parameter key="block_type" value="value_series"/>
        <parameter key="use_block_type_exception" value="false"/>
        <parameter key="except_block_type" value="value_series_end"/>
        <parameter key="invert_selection" value="false"/>
        <parameter key="include_special_attributes" value="false"/>
        <parameter key="method" value="Z-transformation"/>
        <parameter key="min" value="0.0"/>
        <parameter key="max" value="1.0"/>
        <parameter key="allow_negative_values" value="false"/>
      </operator>
      <operator activated="true" class="select_attributes" compatibility="9.2.000" expanded="true" height="82" name="Select Attributes" width="90" x="983" y="544">
        <parameter key="attribute_filter_type" value="subset"/>
        <parameter key="attribute" value=""/>
        <parameter key="attributes" value="absences|activities = no|activities = yes|address = R|address = U|age|Alc|failures|famrel|famsize = GT3|famsize = LE3|famsup = no|famsup = yes|Fedu|Fjob = at_home|Fjob = health|Fjob = other|Fjob = services|Fjob = teacher|freetime|G1|G2|G3|goout|guardian = father|guardian = mother|guardian = other|health|higher = no|higher = yes|internet = no|internet = yes|Medu|Mjob = at_home|Mjob = health|Mjob = other|Mjob = services|Mjob = teacher|nursery = no|nursery = yes|paid = no|paid = yes|Pstatus = A|Pstatus = T|reason = course|reason = home|reason = other|reason = reputation|romantic = no|romantic = yes|school = GP|school = MS|schoolsup = no|schoolsup = yes|sex = F|sex = M|studytime|traveltime"/>
        <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" breakpoints="after" class="principal_component_analysis" compatibility="9.2.000" expanded="true" height="103" name="PCA" width="90" x="715" y="238">
        <parameter key="dimensionality_reduction" value="keep variance"/>
        <parameter key="variance_threshold" value="0.95"/>
        <parameter key="number_of_components" value="15"/>
      </operator>
      <operator activated="true" class="store" compatibility="9.2.000" expanded="true" height="68" name="Store" width="90" x="849" y="238">
        <parameter key="repository_entry" value="Datos normalizados"/>
      </operator>
      <operator activated="true" class="write_excel" compatibility="9.2.000" expanded="true" height="82" name="Write Excel" width="90" x="983" y="238">
        <parameter key="excel_file" value="C:\Users\LILIA\Documents\Diplomado Inteligencia de Negocios\Machine Learning\Talleres\Taller3\Punto1\Punto1 RapidMiner\Datos normalizados4.xlsx"/>
        <parameter key="file_format" value="xlsx"/>
        <parameter key="encoding" value="SYSTEM"/>
        <parameter key="sheet_name" value="RapidMiner Data"/>
        <parameter key="date_format" value="yyyy-MM-dd HH:mm:ss"/>
        <parameter key="number_format" value="#.0"/>
      </operator>
      <operator activated="true" class="concurrency:k_means" compatibility="9.2.000" expanded="true" height="82" name="Clustering" width="90" x="1117" y="34">
        <parameter key="add_cluster_attribute" value="true"/>
        <parameter key="add_as_label" value="false"/>
        <parameter key="remove_unlabeled" value="true"/>
        <parameter key="k" value="3"/>
        <parameter key="max_runs" value="10"/>
        <parameter key="determine_good_start_values" value="true"/>
        <parameter key="measure_types" value="NumericalMeasures"/>
        <parameter key="mixed_measure" value="MixedEuclideanDistance"/>
        <parameter key="nominal_measure" value="NominalDistance"/>
        <parameter key="numerical_measure" value="EuclideanDistance"/>
        <parameter key="divergence" value="SquaredEuclideanDistance"/>
        <parameter key="kernel_type" value="radial"/>
        <parameter key="kernel_gamma" value="1.0"/>
        <parameter key="kernel_sigma1" value="1.0"/>
        <parameter key="kernel_sigma2" value="0.0"/>
        <parameter key="kernel_sigma3" value="2.0"/>
        <parameter key="kernel_degree" value="3.0"/>
        <parameter key="kernel_shift" value="1.0"/>
        <parameter key="kernel_a" value="1.0"/>
        <parameter key="kernel_b" value="0.0"/>
        <parameter key="max_optimization_steps" value="100"/>
        <parameter key="use_local_random_seed" value="false"/>
        <parameter key="local_random_seed" value="1992"/>
      </operator>
      <operator activated="true" class="model_simulator:cluster_model_visualizer" compatibility="9.2.000" expanded="true" height="82" name="Cluster Model Visualizer (2)" width="90" x="1318" y="34"/>
      <connect from_op="Retrieve Estudent Alcohol Consumption" from_port="output" to_op="Remove Duplicates" to_port="example set input"/>
      <connect from_op="Remove Duplicates" from_port="example set output" to_op="Nominal to Numerical" to_port="example set input"/>
      <connect from_op="Nominal to Numerical" from_port="example set output" to_op="Normalize" to_port="example set input"/>
      <connect from_op="Normalize" 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="PCA" to_port="example set input"/>
      <connect from_op="PCA" from_port="original" to_op="Store" to_port="input"/>
      <connect from_op="Store" from_port="through" to_op="Write Excel" to_port="input"/>
      <connect from_op="Write Excel" from_port="through" to_op="Clustering" to_port="example set"/>
      <connect from_op="Clustering" from_port="cluster model" to_op="Cluster Model Visualizer (2)" to_port="model"/>
      <connect from_op="Clustering" from_port="clustered set" to_op="Cluster Model Visualizer (2)" to_port="clustered data"/>
      <connect from_op="Cluster Model Visualizer (2)" from_port="visualizer output" to_port="result 1"/>
      <connect from_op="Cluster Model Visualizer (2)" from_port="model output" to_port="result 2"/>
      <portSpacing port="source_input 1" spacing="0"/>
      <portSpacing port="sink_result 1" spacing="0"/>
      <portSpacing port="sink_result 2" spacing="0"/>
      <portSpacing port="sink_result 3" spacing="0"/>
      <description align="center" color="yellow" colored="true" height="179" resized="true" width="265" x="507" y="312">&lt;br&gt; &lt;br&gt; &lt;br/&gt;Con base en la informaci&amp;#243;n anterior procedemos a aplicar el algoritmo PCA al dataset, mediante el par&amp;#225;metro variance_threshold del 0.95 eliminando todos los componentes con varianza mayor a este rango.</description>
      <description align="center" color="yellow" colored="true" height="275" resized="true" width="349" x="70" y="581">&lt;br&gt; &lt;br&gt; &lt;br&gt; &lt;br&gt; &lt;br&gt; Dado que el modelo a aplicar se basa en distancias, se requiere que las variables sean n&amp;#250;mericas, por lo cual pasamos los datos de las variables nominales a numericas con el metodo unique integers teniendo en cuenta las car&amp;#225;cteristicas de los atributos. Variables binomiales: school; sex; address; famsize; Pstatus; schoolsup; famsup; paid; activities; nursery; higher; internet; y romantic&lt;br&gt;variables polinomiales: Mjob;Fjob;reason y guardian</description>
      <description align="center" color="yellow" colored="true" height="92" resized="true" width="160" x="318" y="376">&lt;br/&gt;&lt;br/&gt;Eliminamos los posibles registros duplicados</description>
      <description align="center" color="yellow" colored="false" height="270" resized="true" width="364" x="460" y="584">&lt;br&gt; &lt;br&gt; &lt;br/&gt;&lt;br/&gt;Normalizamos la data mediante el m&amp;#233;todo z-transformation, la cual resta la media de los datos de todos los valores y luego los divide por la desviaci&amp;#243;n est&amp;#225;ndar, con lo cual la distribuci&amp;#243;n de los datos tiene una media de cero y una varianza de uno conservando la distribuci&amp;#243;n original de los datos pero menos influenciada por los valores at&amp;#237;picos.</description>
      <description align="center" color="yellow" colored="true" height="275" resized="true" width="281" x="1038" y="583">&lt;br&gt; &lt;br&gt; &lt;br/&gt;Teniendo en cuenta la lectura en la cual nos informan que el atributo Alc se encuentra construido a partir de los atributos Dalc y Walc, procedemos a eliminar estas ultimas variables. En la lectura igualmente retiran las vriables G1, G2, y G3, sin embargo inicialmente se dejan ya que consideramos que el consumo de alcohol si puede afectar directamente las calificaciones del estudiante y validaremos con PCA si el algoritmo las retira.</description>
      <description align="center" color="yellow" colored="true" height="164" resized="true" width="327" x="1099" y="104">&lt;br&gt; &lt;br&gt; Generamos los cluster para la informaci&amp;#243;n anterior de acuerdo con los par&amp;#225;metros que nos gener&amp;#243; el resultado en determinacion del numero de cluster y aplicamos el operador cluster Model visualizaci&amp;#243;n para visualizar corretamente los resultados de los cluster.</description>
    </process>
  </operator>
</process>

Best Answers

  • Options
    SGolbertSGolbert RapidMiner Certified Analyst, Member Posts: 344 Unicorn
    Solution Accepted
    Hola,

    comparto el post de Rodrigo, pegar directamente el proceso sin ninguna explicación hace a un muy pobre post. Quería remarcar que la validación se hace cuando se tiene un label (aprendizaje supervisado). En ese caso conviene usar modelos de aprendizaje supervisados, que van a proveer mucho mejores resultados. Ejemplos típicos son random forest y gradient boosted trees.

    Salu2
    SebaG
Sign In or Register to comment.