Package cascading.pattern

Examples of cascading.pattern.PatternException


      {
      return new FileInputStream( getPMMLFile() );
      }
    catch( FileNotFoundException exception )
      {
      throw new PatternException( "could not find pmml file: " + getPMMLFile(), exception );
      }
    }
View Full Code Here


      SAXSource transformedSource = ImportFilter.apply( source );
      return JAXBUtil.unmarshalPMML( transformedSource );
      }
    catch( Exception exception )
      {
      throw new PatternException( "could not read inputStream: " + inputStream, exception );
      }
    }
View Full Code Here

      else if( model instanceof GeneralRegressionModel )
        tail = handleGeneralRegressionModel( tail, (GeneralRegressionModel) model );
      else if( model instanceof TreeModel )
        tail = handleTreeModel( tail, (TreeModel) model );
      else
        throw new PatternException( "unsupported model type: " + model.getClass().getName() );
      }

    return tail;
    }
View Full Code Here

    ModelSchema modelSchema = createModelSchema( model );

    List<String> predictedCategories = new ArrayList<String>( modelSchema.getPredictedCategories( modelSchema.getPredictedFieldNames().get( 0 ) ) );

    if( predictedCategories.isEmpty() )
      throw new PatternException( "no categories specified" );

    GeneralRegressionSpec regressionSpec = new GeneralRegressionSpec( modelSchema );

    regressionSpec.setNormalization( RegressionUtil.getNormalizationMethod( model ) );
View Full Code Here

    List<TreeSpec> models = new LinkedList<TreeSpec>();

    for( Segment segment : model.getSegmentation().getSegments() )
      {
      if( !segment.getPredicate().getClass().equals( True.class ) )
        throw new PatternException( "segment predicates currently not supported, got: " + segment.getPredicate() );

      Model segmentModel = segment.getModel();

      if( segmentModel instanceof TreeModel )
        models.add( new TreeSpec( modelSchema, createTree( (TreeModel) segmentModel, modelSchema ) ) );
      else
        throw new PatternException( "ensemble model currently not supported, got: " + segmentModel );
      }

    EnsembleSpec<TreeSpec> miningSpec = new EnsembleSpec<TreeSpec>( modelSchema, models );

    LOG.debug( "creating: {}, input: {}, output: {}", new Object[]{miningSpec, modelSchema.getInputFields(),
View Full Code Here

      else if( miningField.getUsageType() == FieldUsageType.PREDICTED )
        modelSchema.setPredictedFields( createDataFields( dataField ) );
      }

    if( modelSchema.getPredictedFieldNames().isEmpty() && defaultPredictedField == null )
      throw new PatternException( "no predicted field name provided in PMML model, use setDefaultPredictedField() method" );

    if( modelSchema.getPredictedFieldNames().isEmpty() )
      modelSchema.setPredictedFields( new ContinuousDataField( defaultPredictedField ) );

    return modelSchema;
View Full Code Here

      return new CategoricalDataField( name, type, asStrings( dataField.getValues() ) );

    String message = String.format( "unsupported data type: %s", dataType );
    LOG.error( message );

    throw new PatternException( message );
    }
View Full Code Here

        break;
      case MODEL_CHAIN:
        break;
      }

    throw new PatternException( "only majority vote method supported, got: " + modelMethod );
    }
View Full Code Here

TOP

Related Classes of cascading.pattern.PatternException

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.