📄 attributereference.java.old
字号:
/* * YALE - Yet Another Learning Environment * Copyright (C) 2002 * Simon Fischer, Ralf Klinkenberg, Ingo Mierswa, * Katharina Morik, Oliver Ritthoff * Artificial Intelligence Unit * Computer Science Department * University of Dortmund * 44221 Dortmund, Germany * email: yale@ls8.cs.uni-dortmund.de * web: http://yale.cs.uni-dortmund.de/ * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA. */package edu.udo.cs.yale.example;/** Objects of this class reference an Attribute in the ExampleTable. ExampleSets contain a list * of AttributeReferences some of which may be switched off by feature selection algorithms. This * is indicated by the used-flag. * * @author ingo, simon * @version $Id: AttributeReference.java,v 1.3 2002/06/13 13:55:26 klinkenb Exp $ */public class AttributeReference implements Cloneable { /** Indicates whether or not this attribute is selected. */ private boolean used; /** References an attribute in the ExampleTable. */ private Attribute attribute; /** This double indicates the information gain of this attribute. */ private double informationGain; /** Constructs a new reference to an attribute. */ public AttributeReference(Attribute att, boolean used) { this.attribute = att; this.used = used; } /** Clone constructor. */ private AttributeReference(AttributeReference ar) { this.attribute = ar.attribute; this.used = ar.used; this.informationGain = ar.informationGain; } /** Returns the referenced attribute. */ public Attribute getAttribute() { return attribute; } /** Returns true if the attribute is switched on. */ public boolean isUsed() { return used; } public boolean invertUsed() { return (used = !used); } public void setUsed(boolean u) { used = u; } /** Set the value of informationGain. */ public void setInformationGain(double informationGain) { this.informationGain = informationGain; } /** Get the value of informationGain. */ public double getInformationGain() { return informationGain; } public Object clone() { return new AttributeReference(this); } public boolean equals(AttributeReference ar) { return (this.attribute.getIndex() == ar.attribute.getIndex()) && (this.used == ar.used); }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -