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 int
DEFAULT_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 double
calculateArea()
protected double
calculateArea(double[] x, double[] y)
protected String
format(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 String
getTitle()
abstract double[]
getX()
abstract double[]
getY()
abstract int
numPoints()
String
toJson()
String
toYaml()
-
-
-
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
-
-