001 /**
002 * Copyright (C) 2007-2011, Jens Lehmann
003 *
004 * This file is part of DL-Learner.
005 *
006 * DL-Learner is free software; you can redistribute it and/or modify
007 * it under the terms of the GNU General Public License as published by
008 * the Free Software Foundation; either version 3 of the License, or
009 * (at your option) any later version.
010 *
011 * DL-Learner is distributed in the hope that it will be useful,
012 * but WITHOUT ANY WARRANTY; without even the implied warranty of
013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
014 * GNU General Public License for more details.
015 *
016 * You should have received a copy of the GNU General Public License
017 * along with this program. If not, see <http://www.gnu.org/licenses/>.
018 */
019
020 package org.dllearner.core.configurators;
021
022 import java.util.Set;
023 import org.dllearner.core.ComponentManager;
024 import org.dllearner.core.AbstractReasonerComponent;
025 import org.dllearner.learningproblems.PosNegLPStrict;
026
027 /**
028 * automatically generated, do not edit manually.
029 * run org.dllearner.scripts.ConfigJavaGenerator to update
030 **/
031 public class PosNegLPStrictConfigurator implements Configurator {
032
033 private boolean reinitNecessary = false;
034 private PosNegLPStrict posNegLPStrict;
035
036 /**
037 * @param posNegLPStrict see PosNegLPStrict
038 **/
039 public PosNegLPStrictConfigurator(PosNegLPStrict posNegLPStrict){
040 this.posNegLPStrict = posNegLPStrict;
041 }
042
043 /**
044 * @param reasoningService see reasoningService
045 * @param positiveExamples positive examples
046 * @param negativeExamples negative examples
047 * @return PosNegLPStrict
048 **/
049 public static PosNegLPStrict getPosNegLPStrict(AbstractReasonerComponent reasoningService, Set<String> positiveExamples, Set<String> negativeExamples) {
050 PosNegLPStrict component = ComponentManager.getInstance().learningProblem(PosNegLPStrict.class, reasoningService);
051 ComponentManager.getInstance().applyConfigEntry(component, "positiveExamples", positiveExamples);
052 ComponentManager.getInstance().applyConfigEntry(component, "negativeExamples", negativeExamples);
053 return component;
054 }
055
056 /**
057 * positiveExamples positive examples.
058 * mandatory: true| reinit necessary: false
059 * default value: null
060 * @return Set(String)
061 **/
062 @SuppressWarnings("unchecked")
063 public Set<String> getPositiveExamples() {
064 return (Set<String>) ComponentManager.getInstance().getConfigOptionValue(posNegLPStrict, "positiveExamples") ;
065 }
066 /**
067 * negativeExamples negative examples.
068 * mandatory: true| reinit necessary: false
069 * default value: null
070 * @return Set(String)
071 **/
072 @SuppressWarnings("unchecked")
073 public Set<String> getNegativeExamples() {
074 return (Set<String>) ComponentManager.getInstance().getConfigOptionValue(posNegLPStrict, "negativeExamples") ;
075 }
076 /**
077 * useRetrievalForClassficiation Specifies whether to use retrieval or instance checks for testing a concept. - NO LONGER FULLY SUPPORTED..
078 * mandatory: false| reinit necessary: true
079 * default value: false
080 * @return boolean
081 **/
082 public boolean getUseRetrievalForClassficiation() {
083 return (Boolean) ComponentManager.getInstance().getConfigOptionValue(posNegLPStrict, "useRetrievalForClassficiation") ;
084 }
085 /**
086 * percentPerLenghtUnit describes the reduction in classification accuracy in percent one is willing to accept for reducing the length of the concept by one.
087 * mandatory: false| reinit necessary: true
088 * default value: 0.05
089 * @return double
090 **/
091 public double getPercentPerLenghtUnit() {
092 return (Double) ComponentManager.getInstance().getConfigOptionValue(posNegLPStrict, "percentPerLenghtUnit") ;
093 }
094 /**
095 * useMultiInstanceChecks See UseMultiInstanceChecks enum. - NO LONGER FULLY SUPPORTED..
096 * mandatory: false| reinit necessary: true
097 * default value: twoChecks
098 * @return String
099 **/
100 public String getUseMultiInstanceChecks() {
101 return (String) ComponentManager.getInstance().getConfigOptionValue(posNegLPStrict, "useMultiInstanceChecks") ;
102 }
103 /**
104 * penaliseNeutralExamples if set to true neutral examples are penalised.
105 * mandatory: false| reinit necessary: true
106 * default value: null
107 * @return boolean
108 **/
109 public boolean getPenaliseNeutralExamples() {
110 return (Boolean) ComponentManager.getInstance().getConfigOptionValue(posNegLPStrict, "penaliseNeutralExamples") ;
111 }
112 /**
113 * accuracyPenalty penalty for pos/neg examples which are classified as neutral.
114 * mandatory: false| reinit necessary: true
115 * default value: 1.0
116 * @return double
117 **/
118 public double getAccuracyPenalty() {
119 return (Double) ComponentManager.getInstance().getConfigOptionValue(posNegLPStrict, "accuracyPenalty") ;
120 }
121 /**
122 * errorPenalty penalty for pos. examples classified as negative or vice versa.
123 * mandatory: false| reinit necessary: true
124 * default value: 3.0
125 * @return double
126 **/
127 public double getErrorPenalty() {
128 return (Double) ComponentManager.getInstance().getConfigOptionValue(posNegLPStrict, "errorPenalty") ;
129 }
130
131 /**
132 * @param positiveExamples positive examples.
133 * mandatory: true| reinit necessary: false
134 * default value: null
135 **/
136 public void setPositiveExamples(Set<String> positiveExamples) {
137 ComponentManager.getInstance().applyConfigEntry(posNegLPStrict, "positiveExamples", positiveExamples);
138 }
139 /**
140 * @param negativeExamples negative examples.
141 * mandatory: true| reinit necessary: false
142 * default value: null
143 **/
144 public void setNegativeExamples(Set<String> negativeExamples) {
145 ComponentManager.getInstance().applyConfigEntry(posNegLPStrict, "negativeExamples", negativeExamples);
146 }
147 /**
148 * @param useRetrievalForClassficiation Specifies whether to use retrieval or instance checks for testing a concept. - NO LONGER FULLY SUPPORTED..
149 * mandatory: false| reinit necessary: true
150 * default value: false
151 **/
152 public void setUseRetrievalForClassficiation(boolean useRetrievalForClassficiation) {
153 ComponentManager.getInstance().applyConfigEntry(posNegLPStrict, "useRetrievalForClassficiation", useRetrievalForClassficiation);
154 reinitNecessary = true;
155 }
156 /**
157 * @param percentPerLenghtUnit describes the reduction in classification accuracy in percent one is willing to accept for reducing the length of the concept by one.
158 * mandatory: false| reinit necessary: true
159 * default value: 0.05
160 **/
161 public void setPercentPerLenghtUnit(double percentPerLenghtUnit) {
162 ComponentManager.getInstance().applyConfigEntry(posNegLPStrict, "percentPerLenghtUnit", percentPerLenghtUnit);
163 reinitNecessary = true;
164 }
165 /**
166 * @param useMultiInstanceChecks See UseMultiInstanceChecks enum. - NO LONGER FULLY SUPPORTED..
167 * mandatory: false| reinit necessary: true
168 * default value: twoChecks
169 **/
170 public void setUseMultiInstanceChecks(String useMultiInstanceChecks) {
171 ComponentManager.getInstance().applyConfigEntry(posNegLPStrict, "useMultiInstanceChecks", useMultiInstanceChecks);
172 reinitNecessary = true;
173 }
174 /**
175 * @param penaliseNeutralExamples if set to true neutral examples are penalised.
176 * mandatory: false| reinit necessary: true
177 * default value: null
178 **/
179 public void setPenaliseNeutralExamples(boolean penaliseNeutralExamples) {
180 ComponentManager.getInstance().applyConfigEntry(posNegLPStrict, "penaliseNeutralExamples", penaliseNeutralExamples);
181 reinitNecessary = true;
182 }
183 /**
184 * @param accuracyPenalty penalty for pos/neg examples which are classified as neutral.
185 * mandatory: false| reinit necessary: true
186 * default value: 1.0
187 **/
188 public void setAccuracyPenalty(double accuracyPenalty) {
189 ComponentManager.getInstance().applyConfigEntry(posNegLPStrict, "accuracyPenalty", accuracyPenalty);
190 reinitNecessary = true;
191 }
192 /**
193 * @param errorPenalty penalty for pos. examples classified as negative or vice versa.
194 * mandatory: false| reinit necessary: true
195 * default value: 3.0
196 **/
197 public void setErrorPenalty(double errorPenalty) {
198 ComponentManager.getInstance().applyConfigEntry(posNegLPStrict, "errorPenalty", errorPenalty);
199 reinitNecessary = true;
200 }
201
202 /**
203 * true, if this component needs reinitializsation.
204 * @return boolean
205 **/
206 public boolean isReinitNecessary(){
207 return reinitNecessary;
208 }
209
210
211 }