congrats Icon
New! Announcing our next generation AI code completions
Read here
Tabnine Logo
Standardize
Code IndexAdd Tabnine to your IDE (free)

How to use
Standardize
in
weka.filters.unsupervised.attribute

Best Java code snippets using weka.filters.unsupervised.attribute.Standardize (Showing top 20 results out of 315)

origin: stackoverflow.com

Instances train = ...   // from somewhere
Instances test = ...    // from somewhere
Standardize filter = new Standardize();
filter.setInputFormat(train);  // initializing the filter once with training set
Instances newTrain = Filter.useFilter(train, filter);  // configures the Filter based on train instances and returns filtered instances
Instances newTest = Filter.useFilter(test, filter);    // create new test se
origin: Waikato/weka-trunk

/**
 * Input an instance for filtering. Filter requires all
 * training instances be read before producing output.
 *
 * @param instance the input instance
 * @return true if the filtered instance may now be
 * collected with output().
 * @throws IllegalStateException if no input format has been set.
 */
public boolean input(Instance instance) throws Exception {
 if (getInputFormat() == null) {
  throw new IllegalStateException("No input instance format defined");
 }
 if (m_NewBatch) {
  resetQueue();
  m_NewBatch = false;
 }
 if (m_Means == null) {
  bufferInput(instance);
  return false;
 } else {
  convertInstance(instance);
  return true;
 }
}
origin: nz.ac.waikato.cms.weka/weka-stable

 /**
  * Main method for testing this class.
  *
  * @param argv should contain arguments to the filter: 
  * use -h for help
  */
 public static void main(String [] argv) {
  runFilter(new Standardize(), argv);
 }
}
origin: nz.ac.waikato.cms.weka/partialLeastSquares

 m_ClassStdDev = StrictMath.sqrt(instances.variance(instances
  .classIndex()));
 m_Filter = new Standardize();
 ((Standardize) m_Filter).setIgnoreClass(true);
 break;
default:
origin: Waikato/weka-trunk

protected void fillCovariance() throws Exception {
 // just center the data or standardize it?
 if (m_center) {
  m_centerFilter = new Center();
  m_centerFilter.setInputFormat(m_TrainInstances);
  m_TrainInstances = Filter.useFilter(m_TrainInstances, m_centerFilter);
 } else {
  m_standardizeFilter = new Standardize();
  m_standardizeFilter.setInputFormat(m_TrainInstances);
  m_TrainInstances = Filter.useFilter(m_TrainInstances, m_standardizeFilter);
 }
 // now compute the covariance matrix
 m_Correlation = new UpperSymmDenseMatrix(m_NumAttribs);
 for (int i = 0; i < m_NumAttribs; i++) {
  for (int j = i; j < m_NumAttribs; j++) {
   double cov = 0;
   for (Instance inst: m_TrainInstances) {
    cov += inst.value(i) * inst.value(j);
   }
   cov /= m_TrainInstances.numInstances() - 1;
   m_Correlation.set(i, j, cov);
  }
 }
}
origin: nz.ac.waikato.cms.weka/weka-stable

 m_standardizeFilter.input(tempInst);
 m_standardizeFilter.batchFinished();
 tempInst = m_standardizeFilter.output();
} else {
 m_centerFilter.input(tempInst);
origin: nz.ac.waikato.cms.weka/weka-stable

if (getInputFormat() == null) {
 throw new IllegalStateException("No input instance format defined");
 Instances input = getInputFormat();
 m_Means = new double[input.numAttributes()];
 m_StdDevs = new double[input.numAttributes()];
  convertInstance(input.instance(i));
flushInput();
return (numPendingOutput() != 0);
origin: nz.ac.waikato.cms.weka/weka-stable

  if (instance.attribute(j).isNumeric() &&
      (!Utils.isMissingValue(vals[j])) &&
      (getInputFormat().classIndex() != j)) {
} else {
 double[] vals = instance.toDoubleArray();
 for (int j = 0; j < getInputFormat().numAttributes(); j++) {
  if (instance.attribute(j).isNumeric() &&
      (!Utils.isMissingValue(vals[j])) &&
      (getInputFormat().classIndex() != j)) {
push(inst, false); // No need to copy
origin: nz.ac.waikato.cms.weka/weka-stable

m_Filter = new Standardize();
((Standardize)m_Filter).setIgnoreClass(true);
m_Filter.setInputFormat(instances);
instances = Filter.useFilter(instances, m_Filter);            
origin: nz.ac.waikato.cms.weka/weka-stable

protected void fillCovariance() throws Exception {
 // just center the data or standardize it?
 if (m_center) {
  m_centerFilter = new Center();
  m_centerFilter.setInputFormat(m_TrainInstances);
  m_TrainInstances = Filter.useFilter(m_TrainInstances, m_centerFilter);
 } else {
  m_standardizeFilter = new Standardize();
  m_standardizeFilter.setInputFormat(m_TrainInstances);
  m_TrainInstances = Filter.useFilter(m_TrainInstances, m_standardizeFilter);
 }
 // now compute the covariance matrix
 m_Correlation = new UpperSymmDenseMatrix(m_NumAttribs);
 for (int i = 0; i < m_NumAttribs; i++) {
  for (int j = i; j < m_NumAttribs; j++) {
   double cov = 0;
   for (Instance inst: m_TrainInstances) {
    cov += inst.value(i) * inst.value(j);
   }
   cov /= m_TrainInstances.numInstances() - 1;
   m_Correlation.set(i, j, cov);
  }
 }
}
origin: Waikato/weka-trunk

 /**
  * Main method for testing this class.
  *
  * @param argv should contain arguments to the filter: 
  * use -h for help
  */
 public static void main(String [] argv) {
  runFilter(new Standardize(), argv);
 }
}
origin: Waikato/weka-trunk

 m_standardizeFilter.input(tempInst);
 m_standardizeFilter.batchFinished();
 tempInst = m_standardizeFilter.output();
} else {
 m_centerFilter.input(tempInst);
origin: Waikato/weka-trunk

if (getInputFormat() == null) {
 throw new IllegalStateException("No input instance format defined");
 Instances input = getInputFormat();
 m_Means = new double[input.numAttributes()];
 m_StdDevs = new double[input.numAttributes()];
  convertInstance(input.instance(i));
flushInput();
return (numPendingOutput() != 0);
origin: Waikato/weka-trunk

  if (instance.attribute(j).isNumeric() &&
      (!Utils.isMissingValue(vals[j])) &&
      (getInputFormat().classIndex() != j)) {
} else {
 double[] vals = instance.toDoubleArray();
 for (int j = 0; j < getInputFormat().numAttributes(); j++) {
  if (instance.attribute(j).isNumeric() &&
      (!Utils.isMissingValue(vals[j])) &&
      (getInputFormat().classIndex() != j)) {
push(inst, false); // No need to copy
origin: stackoverflow.com

 Instances train = ...   // from somewhere
Instances test = ...    // from somewhere
Standardize filter = new Standardize();
filter.setInputFormat(train);  // initializing the filter once with training set
Instances newTrain = Filter.useFilter(train, filter);  // configures the Filter based on train instances and returns filtered instances
Instances newTest = Filter.useFilter(test, filter);    // create new test set
origin: Waikato/weka-trunk

m_Filter = new Standardize();
((Standardize)m_Filter).setIgnoreClass(true);
m_Filter.setInputFormat(instances);
instances = Filter.useFilter(instances, m_Filter);            
origin: nz.ac.waikato.cms.weka/weka-stable

 m_trainInstances = Filter.useFilter(m_trainInstances, m_centerFilter);
} else {
 m_standardizeFilter = new Standardize();
 m_standardizeFilter.setInputFormat(m_trainInstances);
 m_trainInstances = Filter.useFilter(m_trainInstances, m_standardizeFilter);
origin: nz.ac.waikato.cms.weka/weka-stable

 m_standardizeFilter.input(tempInst);
 m_standardizeFilter.batchFinished();
 tempInst = m_standardizeFilter.output();
} else {
 m_centerFilter.input(tempInst);
origin: nz.ac.waikato.cms.weka/weka-stable

/**
 * Input an instance for filtering. Filter requires all
 * training instances be read before producing output.
 *
 * @param instance the input instance
 * @return true if the filtered instance may now be
 * collected with output().
 * @throws IllegalStateException if no input format has been set.
 */
public boolean input(Instance instance) throws Exception {
 if (getInputFormat() == null) {
  throw new IllegalStateException("No input instance format defined");
 }
 if (m_NewBatch) {
  resetQueue();
  m_NewBatch = false;
 }
 if (m_Means == null) {
  bufferInput(instance);
  return false;
 } else {
  convertInstance(instance);
  return true;
 }
}
origin: nz.ac.waikato.cms.weka/weka-stable

/** Creates an example Standardize */
public Filter getFilter() {
 Standardize f = new Standardize();
 return f;
}
weka.filters.unsupervised.attributeStandardize

Javadoc

Standardizes all numeric attributes in the given dataset to have zero mean and unit variance (apart from the class attribute, if set).

Valid options are:

 -unset-class-temporarily 
Unsets the class index temporarily before the filter is 
applied to the data. 
(default: no)

Most used methods

  • <init>
  • setIgnoreClass
  • batchFinished
    Signify that this batch of input to the filter is finished. If the filter requires all instances pri
  • bufferInput
  • convertInstance
    Convert a single instance over. The converted instance is added to the end of the output queue.
  • flushInput
  • getInputFormat
  • input
    Input an instance for filtering. Filter requires all training instances be read before producing out
  • numPendingOutput
  • output
  • push
  • resetQueue
  • push,
  • resetQueue,
  • runFilter,
  • setInputFormat,
  • setOutputFormat

Popular in Java

  • Finding current android device location
  • getResourceAsStream (ClassLoader)
  • onCreateOptionsMenu (Activity)
  • setRequestProperty (URLConnection)
  • Graphics2D (java.awt)
    This Graphics2D class extends the Graphics class to provide more sophisticated control overgraphics
  • Calendar (java.util)
    Calendar is an abstract base class for converting between a Date object and a set of integer fields
  • Deque (java.util)
    A linear collection that supports element insertion and removal at both ends. The name deque is shor
  • Locale (java.util)
    Locale represents a language/country/variant combination. Locales are used to alter the presentatio
  • ConcurrentHashMap (java.util.concurrent)
    A plug-in replacement for JDK1.5 java.util.concurrent.ConcurrentHashMap. This version is based on or
  • LoggerFactory (org.slf4j)
    The LoggerFactory is a utility class producing Loggers for various logging APIs, most notably for lo
  • 21 Best IntelliJ Plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now