Class DefaultObservation
- All Implemented Interfaces:
Serializable
,Cloneable
,Iterable<Double>
,Collection<Double>
,List<Double>
,RandomAccess
,SequencedCollection<Double>
,Observation
A default observation is a vector of double values, representing
an observation for machine learning tasks.
- Author:
- Matthias Thimm
- See Also:
-
Constructor Summary
ConstructorDescriptionDefault constructor for the `DefaultObservation` class. -
Method Summary
Modifier and TypeMethodDescriptionlibsvm.svm_node[]
Converts this observation into an array of `svm_node` objects.Methods inherited from class java.util.Vector
add, add, addAll, addAll, addElement, capacity, clear, clone, contains, containsAll, copyInto, elementAt, elements, ensureCapacity, equals, firstElement, forEach, get, hashCode, indexOf, indexOf, insertElementAt, isEmpty, iterator, lastElement, lastIndexOf, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeAllElements, removeElement, removeElementAt, removeIf, replaceAll, retainAll, set, setElementAt, setSize, size, sort, spliterator, subList, toArray, toArray, toString, trimToSize
Methods inherited from interface java.util.Collection
parallelStream, stream, toArray
Methods inherited from interface java.util.List
addFirst, addLast, getFirst, getLast, removeFirst, removeLast, reversed
Methods inherited from interface org.tweetyproject.machinelearning.Observation
equals, hashCode
-
Constructor Details
-
DefaultObservation
public DefaultObservation()Default constructor for the `DefaultObservation` class.This constructor initializes an empty `DefaultObservation` object that can be populated with double values representing an observation.
-
-
Method Details
-
toSvmNode
public libsvm.svm_node[] toSvmNode()Converts this observation into an array of `svm_node` objects.The conversion is intended for use in SVM-based machine learning algorithms. Each value in the observation is transformed into an `svm_node` where the index corresponds to the position of the value in the vector, and the value is the actual double value.
- Specified by:
toSvmNode
in interfaceObservation
- Returns:
- an array of `svm_node` objects representing this observation.
-