• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java Entity类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.dmg.pmml.Entity的典型用法代码示例。如果您正苦于以下问题:Java Entity类的具体用法?Java Entity怎么用?Java Entity使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Entity类属于org.dmg.pmml包,在下文中一共展示了Entity类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: createRegressionNeuralOutputs

import org.dmg.pmml.Entity; //导入依赖的package包/类
static
public NeuralOutputs createRegressionNeuralOutputs(List<? extends Entity> entities, ContinuousLabel continuousLabel){

	if(entities.size() != 1){
		throw new IllegalArgumentException();
	}

	Entity entity = Iterables.getOnlyElement(entities);

	DerivedField derivedField = new DerivedField(OpType.CONTINUOUS, continuousLabel.getDataType())
		.setExpression(new FieldRef(continuousLabel.getName()));

	NeuralOutput neuralOutput = new NeuralOutput()
		.setOutputNeuron(entity.getId())
		.setDerivedField(derivedField);

	NeuralOutputs neuralOutputs = new NeuralOutputs()
		.addNeuralOutputs(neuralOutput);

	return neuralOutputs;
}
 
开发者ID:jpmml,项目名称:jpmml-converter,代码行数:22,代码来源:NeuralNetworkUtil.java


示例2: createClassificationNeuralOutputs

import org.dmg.pmml.Entity; //导入依赖的package包/类
static
public NeuralOutputs createClassificationNeuralOutputs(List<? extends Entity> entities, CategoricalLabel categoricalLabel){

	if(entities.size() != categoricalLabel.size()){
		throw new IllegalArgumentException();
	}

	NeuralOutputs neuralOutputs = new NeuralOutputs();

	for(int i = 0; i < categoricalLabel.size(); i++){
		Entity entity = entities.get(i);

		DerivedField derivedField = new DerivedField(OpType.CATEGORICAL, categoricalLabel.getDataType())
			.setExpression(new NormDiscrete(categoricalLabel.getName(), categoricalLabel.getValue(i)));

		NeuralOutput neuralOutput = new NeuralOutput()
			.setOutputNeuron(entity.getId())
			.setDerivedField(derivedField);

		neuralOutputs.addNeuralOutputs(neuralOutput);
	}

	return neuralOutputs;
}
 
开发者ID:jpmml,项目名称:jpmml-converter,代码行数:25,代码来源:NeuralNetworkUtil.java


示例3: load

import org.dmg.pmml.Entity; //导入依赖的package包/类
@Override
public BiMap<String, Entity> load(NeuralNetwork neuralNetwork){
	ImmutableBiMap.Builder<String, Entity> builder = new ImmutableBiMap.Builder<>();

	AtomicInteger index = new AtomicInteger(1);

	NeuralInputs neuralInputs = neuralNetwork.getNeuralInputs();
	for(NeuralInput neuralInput : neuralInputs){
		builder = EntityUtil.put(neuralInput, index, builder);
	}

	List<NeuralLayer> neuralLayers = neuralNetwork.getNeuralLayers();
	for(NeuralLayer neuralLayer : neuralLayers){
		List<Neuron> neurons = neuralLayer.getNeurons();

		for(int i = 0; i < neurons.size(); i++){
			Neuron neuron = neurons.get(i);

			builder = EntityUtil.put(neuron, index, builder);
		}
	}

	return builder.build();
}
 
开发者ID:jpmml,项目名称:jpmml-evaluator,代码行数:25,代码来源:NeuralNetworkEvaluator.java


示例4: createAffinityFields

import org.dmg.pmml.Entity; //导入依赖的package包/类
static
public List<OutputField> createAffinityFields(final DataType dataType, List<? extends Entity> entities){
	Function<Entity, OutputField> function = new Function<Entity, OutputField>(){

		@Override
		public OutputField apply(Entity entity){
			return createAffinityField(dataType, entity.getId());
		}
	};

	return Lists.newArrayList(Lists.transform(entities, function));
}
 
开发者ID:jpmml,项目名称:jpmml-converter,代码行数:13,代码来源:ModelUtil.java


示例5: createNeuron

import org.dmg.pmml.Entity; //导入依赖的package包/类
static
public Neuron createNeuron(List<? extends Entity> entities, List<Double> weights, Double bias){

	if(entities.size() != weights.size()){
		throw new IllegalArgumentException();
	}

	Neuron neuron = new Neuron();

	for(int i = 0; i < entities.size(); i++){
		Entity entity = entities.get(i);
		Double weight = weights.get(i);

		if(weight.isNaN() || ValueUtil.isZero(weight)){
			continue;
		}

		Connection connection = new Connection()
			.setFrom(entity.getId())
			.setWeight(weight);

		neuron.addConnections(connection);
	}

	if(!bias.isNaN() && !ValueUtil.isZero(bias)){
		neuron.setBias(bias);
	}

	return neuron;
}
 
开发者ID:jpmml,项目名称:jpmml-converter,代码行数:31,代码来源:NeuralNetworkUtil.java


示例6: getEntityRegistry

import org.dmg.pmml.Entity; //导入依赖的package包/类
@Override
public BiMap<String, Entity> getEntityRegistry(){

	if(this.entityRegistry == null){
		this.entityRegistry = getValue(NeuralNetworkEvaluator.entityCache);
	}

	return this.entityRegistry;
}
 
开发者ID:jpmml,项目名称:jpmml-evaluator,代码行数:10,代码来源:NeuralNetworkEvaluator.java


示例7: getId

import org.dmg.pmml.Entity; //导入依赖的package包/类
static
public <E extends Entity> String getId(E entity, BiMap<String, E> entityRegistry){
	String id = entity.getId();

	if(id == null){
		BiMap<E, String> inversedEntityRegistry = entityRegistry.inverse();

		return inversedEntityRegistry.get(entity);
	}

	return id;
}
 
开发者ID:jpmml,项目名称:jpmml-evaluator,代码行数:13,代码来源:EntityUtil.java


示例8: buildBiMap

import org.dmg.pmml.Entity; //导入依赖的package包/类
static
public <E extends Entity> ImmutableBiMap<String, E> buildBiMap(List<E> entities){
	ImmutableBiMap.Builder<String, E> builder = new ImmutableBiMap.Builder<>();

	builder = putAll(entities, new AtomicInteger(1), builder);

	return builder.build();
}
 
开发者ID:jpmml,项目名称:jpmml-evaluator,代码行数:9,代码来源:EntityUtil.java


示例9: put

import org.dmg.pmml.Entity; //导入依赖的package包/类
static
public <E extends Entity> ImmutableBiMap.Builder<String, E> put(E entity, AtomicInteger index, ImmutableBiMap.Builder<String, E> builder){
	String implicitId = String.valueOf(index.getAndIncrement());

	String id = entity.getId();
	if(id == null){
		id = implicitId;
	}

	return builder.put(id, entity);
}
 
开发者ID:jpmml,项目名称:jpmml-evaluator,代码行数:12,代码来源:EntityUtil.java


示例10: putAll

import org.dmg.pmml.Entity; //导入依赖的package包/类
static
public <E extends Entity> ImmutableBiMap.Builder<String, E> putAll(List<E> entities, AtomicInteger index, ImmutableBiMap.Builder<String, E> builder){

	for(E entity : entities){
		builder = put(entity, index, builder);
	}

	return builder;
}
 
开发者ID:jpmml,项目名称:jpmml-evaluator,代码行数:10,代码来源:EntityUtil.java



注:本文中的org.dmg.pmml.Entity类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java BaseInterpolator类代码示例发布时间:2022-05-23
下一篇:
Java SetEntityLinkPacket类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap