Package org.nd4j.evaluation.curves
Class BaseCurve
- java.lang.Object
-
- org.nd4j.evaluation.curves.BaseCurve
-
- Direct Known Subclasses:
PrecisionRecallCurve,ReliabilityDiagram,RocCurve
public abstract class BaseCurve extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static intDEFAULT_FORMAT_PREC
-
Constructor Summary
Constructors Constructor Description BaseCurve()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected doublecalculateArea()protected doublecalculateArea(double[] x, double[] y)protected Stringformat(double d, int precision)static <T extends BaseCurve>
TfromJson(String json, Class<T> curveClass)static <T extends BaseCurve>
TfromYaml(String yaml, Class<T> curveClass)abstract StringgetTitle()abstract double[]getX()abstract double[]getY()abstract intnumPoints()StringtoJson()StringtoYaml()
-
-
-
Field Detail
-
DEFAULT_FORMAT_PREC
public static final int DEFAULT_FORMAT_PREC
- See Also:
- Constant Field Values
-
-
Method Detail
-
numPoints
public abstract int numPoints()
- Returns:
- The number of points in the curve
-
getX
public abstract double[] getX()
- Returns:
- X axis values
-
getY
public abstract double[] getY()
- Returns:
- Y-axis values
-
getTitle
public abstract String getTitle()
- Returns:
- Title for the curve
-
calculateArea
protected double calculateArea()
- Returns:
- Area under the curve
-
calculateArea
protected double calculateArea(double[] x, double[] y)
-
format
protected String format(double d, int precision)
-
toJson
public String toJson()
- Returns:
- JSON representation of the curve
-
toYaml
public String toYaml()
- Returns:
- YAML representation of the curve
-
fromJson
public static <T extends BaseCurve> T fromJson(String json, Class<T> curveClass)
- Type Parameters:
T- Type- Parameters:
json- JSON representationcurveClass- Class for the curve- Returns:
- Instance of the curve
-
-