/** * @param columnA * @param columnB * @return correlation value of columnA and columnB * @throws DDFException */ public double correlation(String columnA, String columnB) throws DDFException { return this.getAggregationHandler().computeCorrelation(columnA, columnB); }
public DDF groupBy(List<String> groupedColumns) { return this.getAggregationHandler().groupBy(groupedColumns); }
public DDF groupBy(List<String> groupedColumns, List<String> aggregateFunctions) throws DDFException { return this.getAggregationHandler().groupBy(groupedColumns, aggregateFunctions); }
public DDF agg(List<String> aggregateFunctions) throws DDFException { return this.getAggregationHandler().agg(aggregateFunctions); }
/** * Compute aggregation which is equivalent to SQL aggregation statement like * "SELECT a, b, sum(c), max(d) FROM e GROUP BY a, b" * * @param fields a string includes aggregated fields and functions, e.g "a, b, sum(c), max(d)" * @return * @throws DDFException */ public AggregationResult aggregate(String fields) throws DDFException { return this.getAggregationHandler().aggregate(AggregateField.fromSqlFieldSpecs(fields)); }
public AggregationResult xtabs(String fields) throws DDFException { return this.getAggregationHandler().xtabs(AggregateField.fromSqlFieldSpecs(fields)); }
Column curColumn = this.getDDF().getColumn(col); if (this.getDDF().getColumn(col).isNumeric()) { double filledValue = this.getDDF().getAggregationHandler().aggregateOnColumn(function, col); if (curColumn.getType() == ColumnType.DOUBLE) { caseCmd.append(fillNACaseSql(col, filledValue));
/** * Initialization to be done after constructor assignments, such as setting of the all-important DDFManager. */ protected void initialize(DDFManager manager, Object data, Class<?>[] typeSpecs, String name, Schema schema) throws DDFException { this.validateSchema(schema); this.setManager(manager); // this must be done first in case later stuff needs a manager if (typeSpecs != null) { this.getRepresentationHandler().set(data, typeSpecs); } this.getSchemaHandler().setSchema(schema); if(schema!= null && schema.getTableName() == null) { String tableName = this.getSchemaHandler().newTableName(); schema.setTableName(tableName); } manager.setDDFUUID(this, UUID.randomUUID()); if(!Strings.isNullOrEmpty(name)) manager.setDDFName(this, name); // Facades this.ML = new MLFacade(this, this.getMLSupporter()); this.VIEWS = new ViewsFacade(this, this.getViewHandler()); this.Transform = new TransformFacade(this, this.getTransformationHandler()); this.R = new RFacade(this, this.getAggregationHandler()); }