Package weka.filters.unsupervised.attribute

Examples of weka.filters.unsupervised.attribute.PropositionalToMultiInstance


      m_Filter = null;


    Instances transformedInsts;
    Filter convertToProp = new MultiInstanceToPropositional();
    Filter convertToMI = new PropositionalToMultiInstance();

    //transform the data into single-instance format
    if (m_minimax){
      /* using SimpleMI class minimax transform method.
         this method transforms the multi-instance dataset into minmax feature space (single-instance) */
      SimpleMI transMinimax = new SimpleMI();
      transMinimax.setTransformMethod(
          new SelectedTag(
            SimpleMI.TRANSFORMMETHOD_MINIMAX, SimpleMI.TAGS_TRANSFORMMETHOD));
      transformedInsts = transMinimax.transform(insts);
    }
    else {
      convertToProp.setInputFormat(insts);
      transformedInsts=Filter.useFilter(insts, convertToProp);
    }

    if (m_Missing != null) {
      m_Missing.setInputFormat(transformedInsts);
      transformedInsts = Filter.useFilter(transformedInsts, m_Missing);
    }

    if (m_NominalToBinary != null) {
      m_NominalToBinary.setInputFormat(transformedInsts);
      transformedInsts = Filter.useFilter(transformedInsts, m_NominalToBinary);
    }

    if (m_Filter != null) {
      m_Filter.setInputFormat(transformedInsts);
      transformedInsts = Filter.useFilter(transformedInsts, m_Filter);
    }

    // convert the single-instance format to multi-instance format
    convertToMI.setInputFormat(transformedInsts);
    insts = Filter.useFilter( transformedInsts, convertToMI);

    m_classIndex = insts.classIndex();
    m_classAttribute = insts.classAttribute();

View Full Code Here


    Instances insts = new Instances(inst.dataset(), 0);
    insts.add(inst);

    //transform the data into single-instance format
    Filter convertToProp = new MultiInstanceToPropositional();
    Filter convertToMI = new PropositionalToMultiInstance();

    if (m_minimax){ // using minimax feature space
      SimpleMI transMinimax = new SimpleMI();
      transMinimax.setTransformMethod(
          new SelectedTag(
            SimpleMI.TRANSFORMMETHOD_MINIMAX, SimpleMI.TAGS_TRANSFORMMETHOD));
      insts = transMinimax.transform (insts);
    }
    else{
      convertToProp.setInputFormat(insts);
      insts=Filter.useFilter( insts, convertToProp);
    }

    // Filter instances
    if (m_Missing!=null)
      insts = Filter.useFilter(insts, m_Missing);
   
    if (m_NominalToBinary != null) {
      insts = Filter.useFilter(insts, m_NominalToBinary);
    }

    if (m_Filter!=null)
      insts = Filter.useFilter(insts, m_Filter);    

    // convert the single-instance format to multi-instance format
    convertToMI.setInputFormat(insts);
    insts=Filter.useFilter( insts, convertToMI);

    inst = insts.instance(0)

    if (!m_fitLogisticModels) {
View Full Code Here

      m_Filter = null;


    Instances transformedInsts;
    Filter convertToProp = new MultiInstanceToPropositional();
    Filter convertToMI = new PropositionalToMultiInstance();

    //transform the data into single-instance format
    if (m_minimax){
      /* using SimpleMI class minimax transform method.
         this method transforms the multi-instance dataset into minmax feature space (single-instance) */
      SimpleMI transMinimax = new SimpleMI();
      transMinimax.setTransformMethod(
          new SelectedTag(
            SimpleMI.TRANSFORMMETHOD_MINIMAX, SimpleMI.TAGS_TRANSFORMMETHOD));
      transformedInsts = transMinimax.transform(insts);
    }
    else {
      convertToProp.setInputFormat(insts);
      transformedInsts=Filter.useFilter(insts, convertToProp);
    }

    if (m_Missing != null) {
      m_Missing.setInputFormat(transformedInsts);
      transformedInsts = Filter.useFilter(transformedInsts, m_Missing);
    }

    if (m_NominalToBinary != null) {
      m_NominalToBinary.setInputFormat(transformedInsts);
      transformedInsts = Filter.useFilter(transformedInsts, m_NominalToBinary);
    }

    if (m_Filter != null) {
      m_Filter.setInputFormat(transformedInsts);
      transformedInsts = Filter.useFilter(transformedInsts, m_Filter);
    }

    // convert the single-instance format to multi-instance format
    convertToMI.setInputFormat(transformedInsts);
    insts = Filter.useFilter( transformedInsts, convertToMI);

    m_classIndex = insts.classIndex();
    m_classAttribute = insts.classAttribute();

View Full Code Here

    Instances insts = new Instances(inst.dataset(), 0);
    insts.add(inst);

    //transform the data into single-instance format
    Filter convertToProp = new MultiInstanceToPropositional();
    Filter convertToMI = new PropositionalToMultiInstance();

    if (m_minimax){ // using minimax feature space
      SimpleMI transMinimax = new SimpleMI();
      transMinimax.setTransformMethod(
          new SelectedTag(
            SimpleMI.TRANSFORMMETHOD_MINIMAX, SimpleMI.TAGS_TRANSFORMMETHOD));
      insts = transMinimax.transform (insts);
    }
    else{
      convertToProp.setInputFormat(insts);
      insts=Filter.useFilter( insts, convertToProp);
    }

    // Filter instances
    if (m_Missing!=null)
      insts = Filter.useFilter(insts, m_Missing);

    if (m_Filter!=null)
      insts = Filter.useFilter(insts, m_Filter);    

    // convert the single-instance format to multi-instance format
    convertToMI.setInputFormat(insts);
    insts=Filter.useFilter( insts, convertToMI);

    inst = insts.instance(0)

    if (!m_fitLogisticModels) {
View Full Code Here

TOP

Related Classes of weka.filters.unsupervised.attribute.PropositionalToMultiInstance

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.