Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
An open source Java client that gives you a simple binding to interact with BigML. You can use it to
easily create, retrieve, list, update, and delete BigML resources.
/*
Tree structure for the BigML local boosted Model
This module defines an auxiliary Tree structure that is used in the local
boosted Ensemble to predict locally or embedded into your application
without needing to send requests to BigML.io.
*/
package org.bigml.binding.localmodel;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.bigml.binding.MissingStrategy;
import org.bigml.binding.utils.Utils;
import org.json.simple.JSONArray;
import org.json.simple.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* A boosted tree-like predictive model.
*
*/
public class BoostedTree extends AbstractTree {
/**
* Logging
*/
static Logger LOGGER = LoggerFactory.getLogger(
BoostedTree.class.getName());
private final List children;
private final Double g_sum;
private final Double h_sum;
/**
* Constructor
*/
public BoostedTree(final JSONObject root, final JSONObject fields,
final Object objective) {
super(root, fields, objective);
children = new ArrayList();
JSONArray childrenObj = (JSONArray) root.get("children");
if (childrenObj != null) {
for (int i = 0; i < childrenObj.size(); i++) {
JSONObject child = (JSONObject) childrenObj.get(i);
BoostedTree childTree = new BoostedTree(child, fields, objectiveField);
children.add(childTree);
}
}
this.g_sum = ((Number) root.get("g_sum")).doubleValue();
this.h_sum = ((Number) root.get("h_sum")).doubleValue();
}
public List getChildren() {
return children;
}
/**
* Makes a prediction based on a number of field values.
*
* The input fields must be keyed by Id.
*
* .predict({"petal length": 1})
*
*/
public HashMap