001/* 002 * Copyright (c) 2015-2020, Oracle and/or its affiliates. All rights reserved. 003 * 004 * Licensed under the Apache License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * http://www.apache.org/licenses/LICENSE-2.0 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 */ 016 017package org.tribuo.interop; 018 019import com.oracle.labs.mlrg.olcut.provenance.ListProvenance; 020import com.oracle.labs.mlrg.olcut.provenance.Provenance; 021import org.tribuo.Dataset; 022import org.tribuo.Output; 023import org.tribuo.OutputFactory; 024import org.tribuo.provenance.DatasetProvenance; 025import org.tribuo.provenance.SimpleDataSourceProvenance; 026 027import java.time.OffsetDateTime; 028import java.util.Map; 029 030/** 031 * A dummy provenance used to describe the dataset of external models. 032 * <p> 033 * Should not be used apart from by the external model system. 034 */ 035public class ExternalDatasetProvenance extends DatasetProvenance { 036 private static final long serialVersionUID = 1L; 037 038 public <T extends Output<T>> ExternalDatasetProvenance(String description, OutputFactory<T> factory, boolean isSequence, int numFeatures, int numOutputs) { 039 super(new SimpleDataSourceProvenance(description, OffsetDateTime.now(),factory), new ListProvenance<>(), Dataset.class.getName(), false, isSequence, -1, numFeatures, numOutputs); 040 } 041 042 public ExternalDatasetProvenance(Map<String, Provenance> map) { 043 super(map); 044 } 045}