public class FeatureScalingOperation extends java.lang.Object implements DatasetOperation
Constructor and Description |
---|
FeatureScalingOperation()
Creates a new FeatureScalingOperation.
|
FeatureScalingOperation(java.util.List<? extends Dataset> datasets)
Creates a new scaler and fits with the provided data.
|
Modifier and Type | Method and Description |
---|---|
void |
fit(java.util.List<? extends Dataset> datasets)
"Trains" (i.e.
|
java.util.List<java.lang.Double> |
getFeatureMeans()
Returns the feature means
|
java.util.List<java.lang.Double> |
getFeatureStds()
Returns the feature standard deviations
|
java.util.Map<java.lang.String,java.lang.Object> |
getObjectMap()
Creates a map of the important fields for the instance, suitable for serialization.
|
OnlineStats |
getOnlineStats()
Returns the online statistics approximator.
|
long |
getSerializationVersion()
Returns the current version of the serialization format.
|
int |
getVersion()
Returns the current class version.
|
void |
initCurrentVersion(java.util.Map<java.lang.String,java.lang.Object> objectMap)
Initializes an instance with a current-version object graph.
|
static void |
main(java.lang.String[] args) |
void |
partial_fit(java.util.List<? extends Dataset> datasets)
Incremental training - keeps approximations of feature means and standard deviations.
|
Dataset |
run(Dataset input)
Scales the input data by substracting the feature means and dividing by their standard deviations.
|
void |
setFeatureMeans(java.util.List<java.lang.Double> featureMeans)
Sets the feature means
|
void |
setFeatureStds(java.util.List<java.lang.Double> featureStds)
Sets the feature standard deviations
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
init, initPreviousVersion, initUnknownVersion, load, read, save, write
public FeatureScalingOperation()
public FeatureScalingOperation(java.util.List<? extends Dataset> datasets)
datasets
- data with which to fit the scalerpublic Dataset run(Dataset input)
run
in interface DatasetOperation
input
- Dataset to scalejava.lang.RuntimeException
- if the scaler hasn't been trained yetfit(java.util.List<? extends com.emphysic.myriad.core.data.io.Dataset>)
public void fit(java.util.List<? extends Dataset> datasets)
datasets
- data to usepublic void partial_fit(java.util.List<? extends Dataset> datasets)
datasets
- new batch of samples of size >=2 (approximations require 2 or more elements)public java.util.List<java.lang.Double> getFeatureMeans()
public void setFeatureMeans(java.util.List<java.lang.Double> featureMeans)
featureMeans
- means of the featurespublic java.util.List<java.lang.Double> getFeatureStds()
public void setFeatureStds(java.util.List<java.lang.Double> featureStds)
featureStds
- standard deviations of the featurespublic long getSerializationVersion()
ObjectMap
getSerializationVersion
in interface ObjectMap
public int getVersion()
ObjectMap
getVersion
in interface ObjectMap
public java.util.Map<java.lang.String,java.lang.Object> getObjectMap()
ObjectMap
getObjectMap
in interface ObjectMap
public void initCurrentVersion(java.util.Map<java.lang.String,java.lang.Object> objectMap)
ObjectMap
initCurrentVersion
in interface ObjectMap
objectMap
- object graph for initializationpublic OnlineStats getOnlineStats()
public static void main(java.lang.String[] args)