smile.feature
Class DateFeature
- java.lang.Object
-
- smile.feature.DateFeature
-
- All Implemented Interfaces:
- FeatureGenerator<java.util.Date>
public class DateFeature extends java.lang.Object implements FeatureGenerator<java.util.Date>
Date/time feature generator. A date attribute is usually represented by a long value that is the milliseconds since January 1, 1970, 00:00:00 GMT. Such a value is meaningless in data mining in general. One usually extract information such as year, month, day, etc. as features in further analysis.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class and Description static classDateFeature.TypeThe types of date/time features.
-
Constructor Summary
Constructors Constructor and Description DateFeature(DateFeature.Type[] types)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description Attribute[]attributes()Returns the variable attributes of generated features.double[]feature(java.util.Date date)Generates a feature for given object.
-
-
-
Constructor Detail
-
DateFeature
public DateFeature(DateFeature.Type[] types)
Constructor.- Parameters:
types- the types of features to be generated.
-
-
Method Detail
-
attributes
public Attribute[] attributes()
Description copied from interface:FeatureGeneratorReturns the variable attributes of generated features. Note that these are NOT the original variable attributes of objects.- Specified by:
attributesin interfaceFeatureGenerator<java.util.Date>- Returns:
- the variable attributes of generated features
-
feature
public double[] feature(java.util.Date date)
Description copied from interface:FeatureGeneratorGenerates a feature for given object.- Specified by:
featurein interfaceFeatureGenerator<java.util.Date>- Parameters:
date- an object of interest.- Returns:
- a feature vector.
-
-
DataMelt 3.0 © DataMelt by jWork.ORG