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.classification.explanations; 018 019import org.tribuo.Example; 020import org.tribuo.Model; 021import org.tribuo.Output; 022import org.tribuo.data.columnar.RowProcessor; 023 024import java.util.Map; 025 026/** 027 * An explainer for data using Tribuo's columnar data package. 028 */ 029public interface ColumnarExplainer<T extends Output<T>> { 030 031 /** 032 * Explains the supplied data. The Map is first converted into 033 * an {@link Example} using a {@link RowProcessor}, before being 034 * supplied to the internal {@link Model}. 035 * @param input The data to explain. 036 * @return An Explanation for this data. 037 */ 038 public Explanation<T> explain(Map<String,String> input); 039 040}