congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
MathUtils.clamp
Code IndexAdd Tabnine to your IDE (free)

How to use
clamp
method
in
org.canova.api.util.MathUtils

Best Java code snippets using org.canova.api.util.MathUtils.clamp (Showing top 2 results out of 315)

origin: jpatanooga/Canova

/**
 * Discretize the given value
 * @param value the value to discretize
 * @param min the min of the distribution
 * @param max the max of the distribution
 * @param binCount the number of bins
 * @return the discretized value
 */
public static int discretize(double value, double min, double max, int binCount) {
  int discreteValue = (int) (binCount * normalize(value, min, max));
  return clamp(discreteValue, 0, binCount - 1);
}
origin: org.nd4j/canova-api

/**
 * Discretize the given value
 *
 * @param value    the value to discretize
 * @param min      the min of the distribution
 * @param max      the max of the distribution
 * @param binCount the number of bins
 * @return the discretized value
 */
public static int discretize(double value, double min, double max, int binCount) {
 int discreteValue = (int) (binCount * normalize(value, min, max));
 return clamp(discreteValue, 0, binCount - 1);
}
org.canova.api.utilMathUtilsclamp

Javadoc

Clamps the value to a discrete value

Popular methods of MathUtils

  • column
    This returns the given column over an n arrays
  • combination
    This returns the combination of n choose r
  • coordSplit
    This returns the coordinate split in a list of coordinates such that the values for ret[0] are the x
  • correlation
    Returns the correlation coefficient of two double vectors.
  • factorial
    This will return the factorial of the given number n.
  • gr
    Tests if a is greater than b.
  • idf
    Inverse document frequency: the total docs divided by the number of times the word appeared in a doc
  • log2
    Returns the logarithm of a for base 2.
  • maxIndex
    Returns index of maximum element in a given array of doubles. First maximum is returned.
  • normalize
    Normalizes the doubles in the array using the given value.
  • randomNumberBetween
    Generates a random integer between the specified numbers
  • sm
    Tests if a is smaller than b.
  • randomNumberBetween,
  • sm,
  • ssError,
  • ssReg,
  • ssTotal,
  • sum,
  • sumOfMeanDifferences,
  • sumOfMeanDifferencesOnePoint,
  • sumOfProducts

Popular in Java

  • Running tasks concurrently on multiple threads
  • setContentView (Activity)
  • getExternalFilesDir (Context)
  • getSharedPreferences (Context)
  • Rectangle (java.awt)
    A Rectangle specifies an area in a coordinate space that is enclosed by the Rectangle object's top-
  • URLEncoder (java.net)
    This class is used to encode a string using the format required by application/x-www-form-urlencoded
  • Date (java.sql)
    A class which can consume and produce dates in SQL Date format. Dates are represented in SQL as yyyy
  • Random (java.util)
    This class provides methods that return pseudo-random values.It is dangerous to seed Random with the
  • JTextField (javax.swing)
  • Options (org.apache.commons.cli)
    Main entry-point into the library. Options represents a collection of Option objects, which describ
  • Top 12 Jupyter Notebook extensions
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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