Java Code Examples for org.dmg.pmml.DataType#FLOAT

The following examples show how to use org.dmg.pmml.DataType#FLOAT . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TypeUtil.java    From jpmml-tensorflow with GNU Affero General Public License v3.0 6 votes vote down vote up
static
public DataType getDataType(Output output){
	org.tensorflow.DataType dataType = output.dataType();

	switch(dataType){
		case FLOAT:
			return DataType.FLOAT;
		case DOUBLE:
			return DataType.DOUBLE;
		case INT32:
		case INT64:
			return DataType.INTEGER;
		case STRING:
			return DataType.STRING;
		case BOOL:
			return DataType.BOOLEAN;
		default:
			throw new IllegalArgumentException();
	}
}
 
Example 2
Source File: FunctionTransformerTest.java    From jpmml-sklearn with GNU Affero General Public License v3.0 5 votes vote down vote up
static
private Object evaluate(String function, Object value){
	UFunc ufunc = new UFunc("numpy.core", "_ufunc_reconstruct");
	ufunc.__init__(new String[]{"numpy", function});

	FieldName name = FieldName.create("x");

	DataType dataType;

	if(value instanceof Integer){
		dataType = DataType.INTEGER;
	} else

	if(value instanceof Float){
		dataType = DataType.FLOAT;
	} else

	{
		dataType = DataType.DOUBLE;
	}

	EvaluationContext context = new VirtualEvaluationContext();
	context.declare(name, FieldValueUtil.create(dataType, OpType.CONTINUOUS, value));

	Expression expression = UFuncUtil.encodeUFunc(ufunc, Collections.singletonList(new FieldRef(name)));

	FieldValue result = ExpressionUtil.evaluate(expression, context);

	return FieldValueUtil.getValue(result);
}
 
Example 3
Source File: ContinuousValue.java    From jpmml-evaluator with GNU Affero General Public License v3.0 5 votes vote down vote up
ContinuousFloat(Object value){
	super(DataType.FLOAT, value);

	Float floatValue = (Float)getValue();
	if(floatValue.isNaN()){
		setValid(false);
	}
}
 
Example 4
Source File: ForestRegressor.java    From jpmml-sklearn with GNU Affero General Public License v3.0 4 votes vote down vote up
@Override
public DataType getDataType(){
	return DataType.FLOAT;
}
 
Example 5
Source File: ForestClassifier.java    From jpmml-sklearn with GNU Affero General Public License v3.0 4 votes vote down vote up
@Override
public DataType getDataType(){
	return DataType.FLOAT;
}
 
Example 6
Source File: GradientBoostingClassifier.java    From jpmml-sklearn with GNU Affero General Public License v3.0 4 votes vote down vote up
@Override
public DataType getDataType(){
	return DataType.FLOAT;
}
 
Example 7
Source File: GradientBoostingRegressor.java    From jpmml-sklearn with GNU Affero General Public License v3.0 4 votes vote down vote up
@Override
public DataType getDataType(){
	return DataType.FLOAT;
}
 
Example 8
Source File: TreeRegressor.java    From jpmml-sklearn with GNU Affero General Public License v3.0 4 votes vote down vote up
@Override
public DataType getDataType(){
	return DataType.FLOAT;
}
 
Example 9
Source File: TreeClassifier.java    From jpmml-sklearn with GNU Affero General Public License v3.0 4 votes vote down vote up
@Override
public DataType getDataType(){
	return DataType.FLOAT;
}
 
Example 10
Source File: KNeighborsClassifier.java    From jpmml-sklearn with GNU Affero General Public License v3.0 4 votes vote down vote up
@Override
public DataType getDataType(){
	return DataType.FLOAT;
}
 
Example 11
Source File: KNeighborsRegressor.java    From jpmml-sklearn with GNU Affero General Public License v3.0 4 votes vote down vote up
@Override
public DataType getDataType(){
	return DataType.FLOAT;
}
 
Example 12
Source File: XGBClassifier.java    From jpmml-sklearn with GNU Affero General Public License v3.0 4 votes vote down vote up
@Override
public DataType getDataType(){
	return DataType.FLOAT;
}
 
Example 13
Source File: XGBRegressor.java    From jpmml-sklearn with GNU Affero General Public License v3.0 4 votes vote down vote up
@Override
public DataType getDataType(){
	return DataType.FLOAT;
}