Summary: this tutorial demonstrates how to perform several types of cross validation with FSharp.Stats.
When fitting a data set it often comes down to the selection of the optimal fitting parameter(s).
A method to determine these is given by the leave-one-out cross validation (LOOCV). Thereby, the data set is fitted with a
given parameter range (smoothing strength, polynomial order etc.) in order to select the best.
In each iteration, one data point is excluded from the fitting procedure. The coefficients are determined
based on the remaining (n-1) data points. The difference of the excluded point with its corresponding fitted point is measured.
In a two-dimensional problem it is the y-intercept of f(xi) and the y_orig at xi.
After every data point was excluded once, the average (squared) distance is calculated and assigned to the corresponding fitting parameter (polynomial order or smoothing strength).
The parameter of the model that shows the minimal average error is the best under the given assumptions. It shows the best compromise between over- and underfitting respectively.
let's first create some polynomial fits to cross validate:
open Plotly.NET
open FSharp.Stats
open FSharp.Stats.Fitting
open LinearRegression.OLS
let xV = vector [1. .. 10.]
let yV = vector [1.;20.;51.;40.;37.;6.;-10.;-5.;0.;10.]
// the fitting function fits a polynomial of order 'order' to the training data set (xTrain and yTrain) and applies it to xTest
let getFitFuncPolynomial xTrain yTrain (xTest:RowVector<float>) order =
let xDat = xTrain |> Matrix.toVector
let coeffs = Polynomial.fit order xDat yTrain
let predictFunction = Polynomial.predict coeffs (xTest.[0])
predictFunction
open Plotly.NET
let rawchart() =
Chart.Point (xV,yV)
|> Chart.withTraceInfo "raw data"
let chartOrderOpt =
[1 .. 2 .. 10]
|> List.map (fun order ->
let coeffs = Polynomial.fit order xV yV
let predictFunction = Polynomial.predict coeffs
[1. .. 0.2 .. 10.]
|> List.map (fun x -> x,predictFunction x)
|> Chart.Line
|> Chart.withTraceInfo (sprintf "order=%i" order)
)
|> fun x -> Chart.combine (rawchart()::x)
|> Chart.withTitle "polynomial fits"
|> Chart.withTemplate ChartTemplates.lightMirrored
|> Chart.withXAxisStyle "x"
|> Chart.withYAxisStyle "y"
And then crossvalidate across the polynomial orders:
// the error is calculated as the squared difference of fitted and original y value
let error (f1:float) f2 = pown (f1 - f2) 2
/// Leave-one-out cross validation. Returns the mean squared error of each leave-out at the
/// specific polynomial order. Minimize for model selection.
let loocvPolynomial (xData:Vector<float>) (yData:Vector<float>) order =
let xDataMat = Matrix.ofVector xData
let getFitFuncPol xTrain yTrain (xTest:RowVector<float>) =
getFitFuncPolynomial xTrain yTrain xTest order
let meanSquaredError = CrossValidation.loocv xDataMat yData getFitFuncPol error
meanSquaredError
// polynomial orders that should be checked
let ordersToCheck = [|1 .. 10|]
let errorPol =
ordersToCheck
|> Array.map (fun order ->
let error = loocvPolynomial xV yV order
order,error)
let chartPol =
errorPol
|> Chart.Line
|> Chart.withTemplate ChartTemplates.lightMirrored
|> Chart.withXAxisStyle "polynomial order"
|> Chart.withYAxisStyle "mean error"
|> Chart.withTitle "leave one out cross validation (polynomial)"
let result = sprintf "The minimal error is obtained by order=%i" (errorPol |> Seq.minBy snd |> fst)
"The minimal error is obtained by order=3"
|
A smoothing spline is a non-parametric fitting procedure, fitting cubic polynomials in each interval given by the basis points.
let's first create some smoothing splines to cross validate:
// the fitting function fits a smoothing spline with smoothing factor lambda to the training data set (xTrain and yTrain) and applies it to xTest
let getFitFuncSpline xDat yDat (xDatTrain: RowVector<float>) lambda =
let xDatVec = xDat |> Matrix.toVector
let zippedData = Seq.zip xDatVec yDat |> Array.ofSeq
let xValTest = xDatTrain.[0]
Spline.smoothingSpline zippedData (xDat |> Array.ofSeq) lambda xValTest
/// in loocv the border points are chosen so that the support range of the training data set does not cover the test point.
/// if splines are used, that are not defined outside the border points use the following:
//let xDatSupport = Intervals.create (xDatVec |> Seq.min) (xDatVec |> Seq.max)
//if Intervals.liesInInterval xValTest xDatSupport then
//Spline.smoothingSpline zippedData (xDat |> Array.ofSeq) lambda xValTest
//else nan
let chartSpline =
[0.0002;0.002;0.0216;0.2;2.;20.]
|> List.map (fun lambda ->
let fit = Spline.smoothingSpline (Seq.zip xV yV |> Array.ofSeq) (Array.ofSeq xV) lambda
[1. .. 0.2 .. 10.]
|> List.map (fun x -> x,fit x)
|> Chart.Line
|> Chart.withTraceInfo (sprintf "l=%.4f" lambda)
)
|> fun x ->
Chart.combine (rawchart()::x)
|> Chart.withTemplate ChartTemplates.lightMirrored
|> Chart.withXAxisStyle "x"
|> Chart.withYAxisStyle "y"
|> Chart.withTitle "smoothing splines"
And then crossvalidate across different lambda values:
// the error is calculated as the squared difference of fitted and original y value
let errorSpl (f1:float) f2 =
// if xValue is outside of support area of the fitted model (some smoothing spline algorithms), the error should report 0.
//if nan.Equals f1 then 0.
//else pown (f1 - f2) 2
pown (f1 - f2) 2
/// Leave-one-out cross validation. Returns the mean squared error of each leave-out at the
/// specific regularization parameter (lambda). Minimize the (MSE) for model selection.
let loocvSmoothingSpline (xData:Vector<float>) (yData:Vector<float>) lambda =
let xDataMat = Matrix.ofVector xData
let getFitFuncSpl xDat yDat (xDatTrain: RowVector<float>) =
getFitFuncSpline xDat yDat xDatTrain lambda
CrossValidation.loocv xDataMat yData getFitFuncSpl errorSpl
// smoothing parameter = lambda = regularization parameter
let lambdasToCheck = [|1. .. 15.|] |> Array.map (fun i -> 0.0001 * i**3.)
let errorSpline =
lambdasToCheck
|> Array.map (fun lambda ->
//basisPoints define, where the knots of the spline are located
let error = loocvSmoothingSpline xV yV lambda
lambda,error)
let chartSplineError =
errorSpline
|> Chart.Line
|> Chart.withTemplate ChartTemplates.lightMirrored
|> Chart.withXAxisStyle "lambda"
|> Chart.withYAxisStyle "mean error"
|> Chart.withTitle "leave one out cross validation (smoothing spline)"
let resultSpline = sprintf "The minimal error is obtained by lambda=%f" (errorSpline |> Seq.minBy snd |> fst)
"The minimal error is obtained by lambda=0.021600"
|
The k fold cross validation (kfcv) is a generalized form of the loocv. Rather than excluding every data point separately, kfcv
allows the exclusion of data chunks with a defined fraction of the data points. When using k=10, the data is split up into 10 chunks of sub data sets each
containing 10% of the data set.
In each loop one chunk is excluded (test data), while the other 9 chunks serve as training data. After 10 (k) loops every single point was evaluated as test data set once
and k-1 times as training data. The selection of the subset chunks is random and can be repeated in several iterations.
The output contains the average error together with the standardDeviation computed by the given function.
//repeated k fold cross validation for polynomials
let repeatedKFoldPolynomial k (xData: Vector<float>) (yData: Vector<float>) order =
let xDataMat = xData |> Matrix.Generic.ofVector
let getFitFuncPol xTrain yTrain (xTest:RowVector<float>) =
getFitFuncPolynomial xTrain yTrain xTest order
CrossValidation.repeatedKFold k 10 xDataMat yData getFitFuncPol error Seq.stDev
//creates an output for 10 iterations where defined 20 % of the data set are taken as testing data set
let kfPolynomial order = repeatedKFoldPolynomial 5 xV yV order
//repeated k fold cross validation for smoothing splines
let repeatedKFoldSpline k (xData: Vector<float>) (yData: Vector<float>) lambda =
let xDataMat = xData |> Matrix.ofVector
let getFitFuncSpl xDat yDat (xDatTrain: RowVector<float>) =
getFitFuncSpline xDat yDat xDatTrain lambda
CrossValidation.repeatedKFold k 10 xDataMat yData getFitFuncSpl errorSpl Seq.stDev
//creates an output for 10 iterations where defined 20 % of the data set are taken as testing data set
let kfSpline lambda = repeatedKFoldSpline 5 xV yV lambda
The given data set is small and therefore the mean errors show a high variability
let kfp =
let errorSplinekf =
ordersToCheck
|> Array.map (fun order ->
//basisPoints define, where the knots of the spline are located
let error = kfPolynomial order
(order,error.Error),error.ErrorStDev)
|> Array.unzip
fst errorSplinekf
|> Chart.Line
|> Chart.withTemplate ChartTemplates.lightMirrored
|> Chart.withXAxisStyle "order"
|> Chart.withYAxisStyle "mean error"
|> Chart.withYAxis(LayoutObjects.LinearAxis.init(AxisType=StyleParam.AxisType.Log))
|> Chart.withYErrorStyle (Array= snd errorSplinekf)
|> Chart.withTitle "kfoldPolynomial error"
let kfs =
let errorSplinekf =
lambdasToCheck
|> Array.map (fun lambda ->
//basisPoints define, where the knots of the spline are located
let error = kfSpline lambda
(lambda,error.Error),error.ErrorStDev)
|> Array.unzip
fst errorSplinekf
|> Chart.Line
|> Chart.withTemplate ChartTemplates.lightMirrored
|> Chart.withXAxisStyle "lambda"
|> Chart.withYAxisStyle "mean error"
|> Chart.withYErrorStyle (Array= snd errorSplinekf)
|> Chart.withTitle "kfoldSpline error"
The shuffle and split cross validation (sap) is a modified kfcv version. As in kfcv, sap
allows the exclusion of data chunks with a defined fraction of the data points. When using p=0.3, 30% of the data are taken as testing data set
while 70% serve as training data set. In sap by default only one testing set is evaluated (unlike to kfcv
where every data point is once part of a training data set and k-1 times part of testing data set).
Sap can be performed multiple times. Each time the training data fraction is taken randomly from the original data set. Unlike in kfcv overlaps may occur.
The output contains the average error together with the standardDeviation computed by the given function.
let shuffleAndSplitPolynomial p iterations (xData: Vector<float>) (yData: Vector<float>) order =
let xDataMat = xData |> Matrix.ofVector
let getFitFuncPol xTrain yTrain (xTest:RowVector<float>) =
getFitFuncPolynomial xTrain yTrain xTest order
CrossValidation.shuffelAndSplit p iterations xDataMat yData getFitFuncPol error Seq.stDev
//creates an output for 5 iterations where random 20 % of the data set are taken as testing data set
let sasPolynomial order = shuffleAndSplitPolynomial 0.2 5 xV yV order
let shuffleAndSplitSpline p iterations (xData: Vector<float>) (yData: Vector<float>) lambda =
let xDataMat = xData |> Matrix.ofVector
let getFitFuncSpl xDat yDat (xDatTrain: RowVector<float>) =
getFitFuncSpline xDat yDat xDatTrain lambda
CrossValidation.shuffelAndSplit p iterations xDataMat yData getFitFuncSpl errorSpl Seq.stDev
//creates an output for 5 iterations where random 20 % of the data set are taken as testing data set
let sasSpline lambda = shuffleAndSplitSpline 0.2 5 xV yV lambda
The given data set is small and therefore the mean errors show a high variability.
let sasp =
let errorSplinekf =
ordersToCheck
|> Array.map (fun order ->
//basisPoints define, where the knots of the spline are located
let error = sasPolynomial order
(order,error.Error),error.ErrorStDev)
|> Array.unzip
fst errorSplinekf
|> Chart.Line
|> Chart.withTemplate ChartTemplates.lightMirrored
|> Chart.withXAxisStyle "order"
|> Chart.withYAxisStyle "mean error"
|> Chart.withYAxis(LayoutObjects.LinearAxis.init(AxisType=StyleParam.AxisType.Log))
|> Chart.withYErrorStyle (Array= snd errorSplinekf)
|> Chart.withTitle "shuffle_and_split polynomial error"
let sass =
let errorSplinekf =
lambdasToCheck
|> Array.map (fun lambda ->
//basisPoints define, where the knots of the spline are located
let error = sasSpline lambda
(lambda,error.Error),error.ErrorStDev)
|> Array.unzip
fst errorSplinekf
|> Chart.Line
|> Chart.withTemplate ChartTemplates.lightMirrored
|> Chart.withXAxisStyle "lambda"
|> Chart.withYAxisStyle "mean error"
|> Chart.withYErrorStyle (Array= snd errorSplinekf)
|> Chart.withTitle "shuffle_and_split spline error"
namespace Plotly
namespace Plotly.NET
module Defaults
from Plotly.NET
<summary>
Contains mutable global default values.
Changing these values will apply the default values to all consecutive Chart generations.
</summary>
val mutable DefaultDisplayOptions: DisplayOptions
Multiple items
type DisplayOptions =
inherit DynamicObj
new: unit -> DisplayOptions
static member addAdditionalHeadTags: additionalHeadTags: XmlNode list -> (DisplayOptions -> DisplayOptions)
static member addDescription: description: XmlNode list -> (DisplayOptions -> DisplayOptions)
static member combine: first: DisplayOptions -> second: DisplayOptions -> DisplayOptions
static member getAdditionalHeadTags: displayOpts: DisplayOptions -> XmlNode list
static member getDescription: displayOpts: DisplayOptions -> XmlNode list
static member getPlotlyReference: displayOpts: DisplayOptions -> PlotlyJSReference
static member init: ?AdditionalHeadTags: XmlNode list * ?Description: XmlNode list * ?PlotlyJSReference: PlotlyJSReference -> DisplayOptions
static member initCDNOnly: unit -> DisplayOptions
...
--------------------
new: unit -> DisplayOptions
static member DisplayOptions.init: ?AdditionalHeadTags: Giraffe.ViewEngine.HtmlElements.XmlNode list * ?Description: Giraffe.ViewEngine.HtmlElements.XmlNode list * ?PlotlyJSReference: PlotlyJSReference -> DisplayOptions
type PlotlyJSReference =
| CDN of string
| Full
| Require of string
| NoReference
<summary>
Sets how plotly is referenced in the head of html docs.
</summary>
union case PlotlyJSReference.NoReference: PlotlyJSReference
Multiple items
namespace FSharp
--------------------
namespace Microsoft.FSharp
namespace FSharp.Stats
namespace FSharp.Stats.Fitting
Multiple items
module LinearRegression
from FSharp.Stats.Fitting
<summary>
Linear regression is used to estimate the relationship of one variable (y) with another (x) by expressing y in terms of a linear function of x.
</summary>
--------------------
type LinearRegression =
new: unit -> LinearRegression
static member fit: xData: vector * yData: Vector<float> * ?FittingMethod: Method * ?Constraint: Constraint<float * float> * ?Weighting: vector -> Coefficients + 1 overload
static member predict: coeff: Coefficients -> xValue: float -> float
static member predictMultivariate: coeff: Coefficients -> xVector: vector -> float
<summary>
This LinearRegression type summarized the most common fitting procedures.
</summary>
<returns>Either linear regression coefficients or a prediction function to map x values/vectors to its corresponding y value.</returns>
<example><code>
// e.g. days since experiment start
let xData = vector [|1. .. 100.|]
// e.g. plant size in cm
let yData = vector [|4.;7.;8.;9.;7.;11.; ...|]
// Estimate the intercept and slope of a line, that fits the data.
let coefficientsSimpleLinear =
LinearRegression.fit(xData,yData,FittingMethod=Fitting.Method.SimpleLinear,Constraint=Fitting.Constraint.RegressionThroughOrigin)
// Predict the size on day 10.5
LinearRegression.predict(coefficientsSimpleLinear) 10.5
</code></example>
--------------------
new: unit -> LinearRegression
module OLS
from FSharp.Stats.Fitting.LinearRegressionModule
<summary>
Ordinary Least Squares (OLS) regression aims to minimise the sum of squared y intercepts between the original and predicted points at each x value.
</summary>
val xV: Vector<float>
Multiple items
val vector: l: seq<float> -> Vector<float>
--------------------
type vector = Vector<float>
val yV: Vector<float>
val getFitFuncPolynomial: xTrain: Matrix<float> -> yTrain: Vector<float> -> xTest: RowVector<float> -> order: int -> float
val xTrain: Matrix<float>
val yTrain: Vector<float>
val xTest: RowVector<float>
Multiple items
module RowVector
from FSharp.Stats
--------------------
type RowVector<'T> =
interface IEnumerable
interface IEnumerable<'T>
interface IStructuralEquatable
interface IStructuralComparable
interface IComparable
new: opsRV: INumeric<'T> option * arrRV: 'T array -> RowVector<'T>
override Equals: yobj: obj -> bool
override GetHashCode: unit -> int
member GetSlice: start: int option * finish: int option -> RowVector<'T>
member Permute: p: permutation -> RowVector<'T>
...
--------------------
new: opsRV: INumeric<'T> option * arrRV: 'T array -> RowVector<'T>
Multiple items
val float: value: 'T -> float (requires member op_Explicit)
<summary>Converts the argument to 64-bit float. This is a direct conversion for all
primitive numeric types. For strings, the input is converted using <c>Double.Parse()</c>
with InvariantCulture settings. Otherwise the operation requires an appropriate
static conversion method on the input type.</summary>
<param name="value">The input value.</param>
<returns>The converted float</returns>
<example id="float-example"><code lang="fsharp"></code></example>
--------------------
[<Struct>]
type float = System.Double
<summary>An abbreviation for the CLI type <see cref="T:System.Double" />.</summary>
<category>Basic Types</category>
--------------------
type float<'Measure> =
float
<summary>The type of double-precision floating point numbers, annotated with a unit of measure.
The unit of measure is erased in compiled code and when values of this type
are analyzed using reflection. The type is representationally equivalent to
<see cref="T:System.Double" />.</summary>
<category index="6">Basic Types with Units of Measure</category>
val order: int
val xDat: vector
Multiple items
module Matrix
from FSharp.Stats
--------------------
type Matrix<'T> =
| DenseRepr of DenseMatrix<'T>
| SparseRepr of SparseMatrix<'T>
interface IMatrixFormattable
interface IFsiFormattable
interface IEnumerable
interface IEnumerable<'T>
interface IStructuralEquatable
interface IStructuralComparable
interface IComparable
override Equals: yobj: obj -> bool
member Format: rowStartCount: int * rowEndCount: int * columnStartCount: int * columnEndCount: int * showInfo: bool -> string + 2 overloads
member FormatStrings: rowStartCount: int * rowEndCount: int * columnStartCount: int * columnEndCount: int -> string[][]
...
val toVector: x: Matrix<float> -> vector
val coeffs: LinearRegression.Coefficients
Multiple items
union case Method.Polynomial: int -> Method
<summary>Fits a polynomial of the specified order (degree) to twodimensional data (OLS).</summary>
--------------------
module Polynomial
from FSharp.Stats.Fitting.LinearRegressionModule.OLS
<summary>
Linear regression using polynomials as regression function: f(x) = a + bx + cx^2 + ....
</summary>
val fit: order: int -> xData: Vector<float> -> yData: Vector<float> -> LinearRegression.Coefficients
<summary>
Calculates the polynomial coefficients for polynomial regression.
</summary>
<param name="order">order of the polynomial (1 = linear, 2 = quadratic, ... )</param>
<param name="xData">vector of x values</param>
<param name="yData">vector of y values</param>
<returns>vector of polynomial coefficients sorted as [intercept;constant;quadratic;...]</returns>
<example><code>
// e.g. days since a certain event
let xData = vector [|1.;2.;3.;4.;5.;6.|]
// e.g. temperature measured at noon of the days specified in xData
let yData = vector [|4.;7.;9.;8.;7.;9.;|]
// Estimate the three coefficients of a quadratic polynomial.
let coefficients =
LinearRegression.OLS.Polynomial.fit 2 xData yData
</code></example>
val predictFunction: float
val predict: coef: LinearRegression.Coefficients -> x: float -> float
<summary>
Takes polynomial coefficients and x value to predict the corresponding y value.
</summary>
<param name="order">order of the polynomial (1 = linear, 2 = quadratic, ... )</param>
<param name="coef">vector of polynomial coefficients (e.g. determined by Polynomial.coefficients), sorted as [intercept;constant;quadratic;...]</param>
<param name="x">x value of which the corresponding y value should be predicted</param>
<returns>predicted y value with given polynomial coefficients at X=x</returns>
<example><code>
// e.g. days since a certain event
let xData = vector [|1.;2.;3.;4.;5.;6.|]
// e.g. temperature measured at noon of the days specified in xData
let yData = vector [|4.;7.;9.;8.;7.;9.;|]
// Define the polynomial coefficients.
let coefficients =
LinearRegression.OLS.Polynomial.fit xData yData
// Predict the temperature value at midnight between day 1 and 2.
LinearRegression.OLS.Polynomial.predict coefficients 1.5
</code></example>
<remarks>If all coefficients are nonzero, the order is equal to the length of the coefficient vector!</remarks>
val rawchart: unit -> GenericChart.GenericChart
type Chart =
static member AnnotatedHeatmap: zData: seq<#seq<'a1>> * annotationText: seq<#seq<string>> * ?Name: string * ?ShowLegend: bool * ?Opacity: float * ?X: seq<'a3> * ?MultiX: seq<seq<'a3>> * ?XGap: int * ?Y: seq<'a4> * ?MultiY: seq<seq<'a4>> * ?YGap: int * ?Text: 'a5 * ?MultiText: seq<'a5> * ?ColorBar: ColorBar * ?ColorScale: Colorscale * ?ShowScale: bool * ?ReverseScale: bool * ?ZSmooth: SmoothAlg * ?Transpose: bool * ?UseWebGL: bool * ?ReverseYAxis: bool * ?UseDefaults: bool -> GenericChart (requires 'a1 :> IConvertible and 'a3 :> IConvertible and 'a4 :> IConvertible and 'a5 :> IConvertible) + 1 overload
static member Area: x: seq<#IConvertible> * y: seq<#IConvertible> * ?ShowMarkers: bool * ?Name: string * ?ShowLegend: bool * ?Opacity: float * ?MultiOpacity: seq<float> * ?Text: 'a2 * ?MultiText: seq<'a2> * ?TextPosition: TextPosition * ?MultiTextPosition: seq<TextPosition> * ?MarkerColor: Color * ?MarkerColorScale: Colorscale * ?MarkerOutline: Line * ?MarkerSymbol: MarkerSymbol * ?MultiMarkerSymbol: seq<MarkerSymbol> * ?Marker: Marker * ?LineColor: Color * ?LineColorScale: Colorscale * ?LineWidth: float * ?LineDash: DrawingStyle * ?Line: Line * ?AlignmentGroup: string * ?OffsetGroup: string * ?StackGroup: string * ?Orientation: Orientation * ?GroupNorm: GroupNorm * ?FillColor: Color * ?FillPatternShape: PatternShape * ?FillPattern: Pattern * ?UseWebGL: bool * ?UseDefaults: bool -> GenericChart (requires 'a2 :> IConvertible) + 1 overload
static member Bar: values: seq<#IConvertible> * ?Keys: seq<'a1> * ?MultiKeys: seq<seq<'a1>> * ?Name: string * ?ShowLegend: bool * ?Opacity: float * ?MultiOpacity: seq<float> * ?Text: 'a2 * ?MultiText: seq<'a2> * ?MarkerColor: Color * ?MarkerColorScale: Colorscale * ?MarkerOutline: Line * ?MarkerPatternShape: PatternShape * ?MultiMarkerPatternShape: seq<PatternShape> * ?MarkerPattern: Pattern * ?Marker: Marker * ?Base: #IConvertible * ?Width: 'a4 * ?MultiWidth: seq<'a4> * ?TextPosition: TextPosition * ?MultiTextPosition: seq<TextPosition> * ?UseDefaults: bool -> GenericChart (requires 'a1 :> IConvertible and 'a2 :> IConvertible and 'a4 :> IConvertible) + 1 overload
static member BoxPlot: ?X: seq<'a0> * ?MultiX: seq<seq<'a0>> * ?Y: seq<'a1> * ?MultiY: seq<seq<'a1>> * ?Name: string * ?ShowLegend: bool * ?Text: 'a2 * ?MultiText: seq<'a2> * ?FillColor: Color * ?MarkerColor: Color * ?Marker: Marker * ?Opacity: float * ?WhiskerWidth: float * ?BoxPoints: BoxPoints * ?BoxMean: BoxMean * ?Jitter: float * ?PointPos: float * ?Orientation: Orientation * ?OutlineColor: Color * ?OutlineWidth: float * ?Outline: Line * ?AlignmentGroup: string * ?OffsetGroup: string * ?Notched: bool * ?NotchWidth: float * ?QuartileMethod: QuartileMethod * ?UseDefaults: bool -> GenericChart (requires 'a0 :> IConvertible and 'a1 :> IConvertible and 'a2 :> IConvertible) + 2 overloads
static member Bubble: x: seq<#IConvertible> * y: seq<#IConvertible> * sizes: seq<int> * ?Name: string * ?ShowLegend: bool * ?Opacity: float * ?MultiOpacity: seq<float> * ?Text: 'a2 * ?MultiText: seq<'a2> * ?TextPosition: TextPosition * ?MultiTextPosition: seq<TextPosition> * ?MarkerColor: Color * ?MarkerColorScale: Colorscale * ?MarkerOutline: Line * ?MarkerSymbol: MarkerSymbol * ?MultiMarkerSymbol: seq<MarkerSymbol> * ?Marker: Marker * ?LineColor: Color * ?LineColorScale: Colorscale * ?LineWidth: float * ?LineDash: DrawingStyle * ?Line: Line * ?AlignmentGroup: string * ?OffsetGroup: string * ?StackGroup: string * ?Orientation: Orientation * ?GroupNorm: GroupNorm * ?UseWebGL: bool * ?UseDefaults: bool -> GenericChart (requires 'a2 :> IConvertible) + 1 overload
static member Candlestick: ``open`` : seq<#IConvertible> * high: seq<#IConvertible> * low: seq<#IConvertible> * close: seq<#IConvertible> * ?X: seq<'a4> * ?MultiX: seq<seq<'a4>> * ?Name: string * ?ShowLegend: bool * ?Opacity: float * ?Text: 'a5 * ?MultiText: seq<'a5> * ?Line: Line * ?IncreasingColor: Color * ?Increasing: FinanceMarker * ?DecreasingColor: Color * ?Decreasing: FinanceMarker * ?WhiskerWidth: float * ?ShowXAxisRangeSlider: bool * ?UseDefaults: bool -> GenericChart (requires 'a4 :> IConvertible and 'a5 :> IConvertible) + 2 overloads
static member Column: values: seq<#IConvertible> * ?Keys: seq<'a1> * ?MultiKeys: seq<seq<'a1>> * ?Name: string * ?ShowLegend: bool * ?Opacity: float * ?MultiOpacity: seq<float> * ?Text: 'a2 * ?MultiText: seq<'a2> * ?MarkerColor: Color * ?MarkerColorScale: Colorscale * ?MarkerOutline: Line * ?MarkerPatternShape: PatternShape * ?MultiMarkerPatternShape: seq<PatternShape> * ?MarkerPattern: Pattern * ?Marker: Marker * ?Base: #IConvertible * ?Width: 'a4 * ?MultiWidth: seq<'a4> * ?TextPosition: TextPosition * ?MultiTextPosition: seq<TextPosition> * ?UseDefaults: bool -> GenericChart (requires 'a1 :> IConvertible and 'a2 :> IConvertible and 'a4 :> IConvertible) + 1 overload
static member Contour: zData: seq<#seq<'a1>> * ?Name: string * ?ShowLegend: bool * ?Opacity: float * ?X: seq<'a2> * ?MultiX: seq<seq<'a2>> * ?Y: seq<'a3> * ?MultiY: seq<seq<'a3>> * ?Text: 'a4 * ?MultiText: seq<'a4> * ?ColorBar: ColorBar * ?ColorScale: Colorscale * ?ShowScale: bool * ?ReverseScale: bool * ?Transpose: bool * ?ContourLineColor: Color * ?ContourLineDash: DrawingStyle * ?ContourLineSmoothing: float * ?ContourLine: Line * ?ContoursColoring: ContourColoring * ?ContoursOperation: ConstraintOperation * ?ContoursType: ContourType * ?ShowContourLabels: bool * ?ContourLabelFont: Font * ?Contours: Contours * ?FillColor: Color * ?NContours: int * ?UseDefaults: bool -> GenericChart (requires 'a1 :> IConvertible and 'a2 :> IConvertible and 'a3 :> IConvertible and 'a4 :> IConvertible)
static member Funnel: x: seq<#IConvertible> * y: seq<#IConvertible> * ?Name: string * ?ShowLegend: bool * ?Opacity: float * ?Width: float * ?Offset: float * ?Text: 'a2 * ?MultiText: seq<'a2> * ?TextPosition: TextPosition * ?MultiTextPosition: seq<TextPosition> * ?Orientation: Orientation * ?AlignmentGroup: string * ?OffsetGroup: string * ?MarkerColor: Color * ?MarkerOutline: Line * ?Marker: Marker * ?TextInfo: TextInfo * ?ConnectorLineColor: Color * ?ConnectorLineStyle: DrawingStyle * ?ConnectorFillColor: Color * ?ConnectorLine: Line * ?Connector: FunnelConnector * ?InsideTextFont: Font * ?OutsideTextFont: Font * ?UseDefaults: bool -> GenericChart (requires 'a2 :> IConvertible)
static member Heatmap: zData: seq<#seq<'a1>> * ?X: seq<'a2> * ?MultiX: seq<seq<'a2>> * ?Y: seq<'a3> * ?MultiY: seq<seq<'a3>> * ?Name: string * ?ShowLegend: bool * ?Opacity: float * ?XGap: int * ?YGap: int * ?Text: 'a4 * ?MultiText: seq<'a4> * ?ColorBar: ColorBar * ?ColorScale: Colorscale * ?ShowScale: bool * ?ReverseScale: bool * ?ZSmooth: SmoothAlg * ?Transpose: bool * ?UseWebGL: bool * ?ReverseYAxis: bool * ?UseDefaults: bool -> GenericChart (requires 'a1 :> IConvertible and 'a2 :> IConvertible and 'a3 :> IConvertible and 'a4 :> IConvertible) + 1 overload
...
static member Chart.Point: xy: seq<#System.IConvertible * #System.IConvertible> * ?Name: string * ?ShowLegend: bool * ?Opacity: float * ?MultiOpacity: seq<float> * ?Text: 'a2 * ?MultiText: seq<'a2> * ?TextPosition: StyleParam.TextPosition * ?MultiTextPosition: seq<StyleParam.TextPosition> * ?MarkerColor: Color * ?MarkerColorScale: StyleParam.Colorscale * ?MarkerOutline: Line * ?MarkerSymbol: StyleParam.MarkerSymbol * ?MultiMarkerSymbol: seq<StyleParam.MarkerSymbol> * ?Marker: TraceObjects.Marker * ?AlignmentGroup: string * ?OffsetGroup: string * ?StackGroup: string * ?Orientation: StyleParam.Orientation * ?GroupNorm: StyleParam.GroupNorm * ?UseWebGL: bool * ?UseDefaults: bool -> GenericChart.GenericChart (requires 'a2 :> System.IConvertible)
static member Chart.Point: x: seq<#System.IConvertible> * y: seq<#System.IConvertible> * ?Name: string * ?ShowLegend: bool * ?Opacity: float * ?MultiOpacity: seq<float> * ?Text: 'c * ?MultiText: seq<'c> * ?TextPosition: StyleParam.TextPosition * ?MultiTextPosition: seq<StyleParam.TextPosition> * ?MarkerColor: Color * ?MarkerColorScale: StyleParam.Colorscale * ?MarkerOutline: Line * ?MarkerSymbol: StyleParam.MarkerSymbol * ?MultiMarkerSymbol: seq<StyleParam.MarkerSymbol> * ?Marker: TraceObjects.Marker * ?AlignmentGroup: string * ?OffsetGroup: string * ?StackGroup: string * ?Orientation: StyleParam.Orientation * ?GroupNorm: StyleParam.GroupNorm * ?UseWebGL: bool * ?UseDefaults: bool -> GenericChart.GenericChart (requires 'c :> System.IConvertible)
static member Chart.withTraceInfo: ?Name: string * ?Visible: StyleParam.Visible * ?ShowLegend: bool * ?LegendRank: int * ?LegendGroup: string * ?LegendGroupTitle: Title -> (GenericChart.GenericChart -> GenericChart.GenericChart)
val chartOrderOpt: GenericChart.GenericChart
Multiple items
module List
from FSharp.Stats
<summary>
Module to compute common statistical measure on list
</summary>
--------------------
module List
from Microsoft.FSharp.Collections
<summary>Contains operations for working with values of type <see cref="T:Microsoft.FSharp.Collections.list`1" />.</summary>
<namespacedoc><summary>Operations for collections such as lists, arrays, sets, maps and sequences. See also
<a href="https://docs.microsoft.com/dotnet/fsharp/language-reference/fsharp-collection-types">F# Collection Types</a> in the F# Language Guide.
</summary></namespacedoc>
--------------------
type List =
new: unit -> List
static member geomspace: start: float * stop: float * num: int * ?IncludeEndpoint: bool -> float list
static member linspace: start: float * stop: float * num: int * ?IncludeEndpoint: bool -> float list
--------------------
type List<'T> =
| op_Nil
| op_ColonColon of Head: 'T * Tail: 'T list
interface IReadOnlyList<'T>
interface IReadOnlyCollection<'T>
interface IEnumerable
interface IEnumerable<'T>
member GetReverseIndex: rank: int * offset: int -> int
member GetSlice: startIndex: int option * endIndex: int option -> 'T list
static member Cons: head: 'T * tail: 'T list -> 'T list
member Head: 'T
member IsEmpty: bool
member Item: index: int -> 'T with get
...
<summary>The type of immutable singly-linked lists.</summary>
<remarks>Use the constructors <c>[]</c> and <c>::</c> (infix) to create values of this type, or
the notation <c>[1;2;3]</c>. Use the values in the <c>List</c> module to manipulate
values of this type, or pattern match against the values directly.
</remarks>
<exclude />
--------------------
new: unit -> List
val map: mapping: ('T -> 'U) -> list: 'T list -> 'U list
<summary>Builds a new collection whose elements are the results of applying the given function
to each of the elements of the collection.</summary>
<param name="mapping">The function to transform elements from the input list.</param>
<param name="list">The input list.</param>
<returns>The list of transformed elements.</returns>
<example id="map-1"><code lang="fsharp">
let inputs = [ "a"; "bbb"; "cc" ]
inputs |> List.map (fun x -> x.Length)
</code>
Evaluates to <c>[ 1; 3; 2 ]</c></example>
val predictFunction: (float -> float)
val x: float
static member Chart.Line: xy: seq<#System.IConvertible * #System.IConvertible> * ?ShowMarkers: bool * ?Name: string * ?ShowLegend: bool * ?Opacity: float * ?MultiOpacity: seq<float> * ?Text: 'c * ?MultiText: seq<'c> * ?TextPosition: StyleParam.TextPosition * ?MultiTextPosition: seq<StyleParam.TextPosition> * ?MarkerColor: Color * ?MarkerColorScale: StyleParam.Colorscale * ?MarkerOutline: Line * ?MarkerSymbol: StyleParam.MarkerSymbol * ?MultiMarkerSymbol: seq<StyleParam.MarkerSymbol> * ?Marker: TraceObjects.Marker * ?LineColor: Color * ?LineColorScale: StyleParam.Colorscale * ?LineWidth: float * ?LineDash: StyleParam.DrawingStyle * ?Line: Line * ?AlignmentGroup: string * ?OffsetGroup: string * ?StackGroup: string * ?Orientation: StyleParam.Orientation * ?GroupNorm: StyleParam.GroupNorm * ?Fill: StyleParam.Fill * ?FillColor: Color * ?FillPattern: TraceObjects.Pattern * ?UseWebGL: bool * ?UseDefaults: bool -> GenericChart.GenericChart (requires 'c :> System.IConvertible)
static member Chart.Line: x: seq<#System.IConvertible> * y: seq<#System.IConvertible> * ?ShowMarkers: bool * ?Name: string * ?ShowLegend: bool * ?Opacity: float * ?MultiOpacity: seq<float> * ?Text: 'a2 * ?MultiText: seq<'a2> * ?TextPosition: StyleParam.TextPosition * ?MultiTextPosition: seq<StyleParam.TextPosition> * ?MarkerColor: Color * ?MarkerColorScale: StyleParam.Colorscale * ?MarkerOutline: Line * ?MarkerSymbol: StyleParam.MarkerSymbol * ?MultiMarkerSymbol: seq<StyleParam.MarkerSymbol> * ?Marker: TraceObjects.Marker * ?LineColor: Color * ?LineColorScale: StyleParam.Colorscale * ?LineWidth: float * ?LineDash: StyleParam.DrawingStyle * ?Line: Line * ?AlignmentGroup: string * ?OffsetGroup: string * ?StackGroup: string * ?Orientation: StyleParam.Orientation * ?GroupNorm: StyleParam.GroupNorm * ?Fill: StyleParam.Fill * ?FillColor: Color * ?FillPattern: TraceObjects.Pattern * ?UseWebGL: bool * ?UseDefaults: bool -> GenericChart.GenericChart (requires 'a2 :> System.IConvertible)
val sprintf: format: Printf.StringFormat<'T> -> 'T
<summary>Print to a string using the given format.</summary>
<param name="format">The formatter.</param>
<returns>The formatted result.</returns>
<example>See <c>Printf.sprintf</c> (link: <see cref="M:Microsoft.FSharp.Core.PrintfModule.PrintFormatToStringThen``1" />) for examples.</example>
val x: GenericChart.GenericChart list
static member Chart.combine: gCharts: seq<GenericChart.GenericChart> -> GenericChart.GenericChart
static member Chart.withTitle: title: Title -> (GenericChart.GenericChart -> GenericChart.GenericChart)
static member Chart.withTitle: title: string * ?TitleFont: Font -> (GenericChart.GenericChart -> GenericChart.GenericChart)
static member Chart.withTemplate: template: Template -> (GenericChart.GenericChart -> GenericChart.GenericChart)
module ChartTemplates
from Plotly.NET
val lightMirrored: Template
static member Chart.withXAxisStyle: ?TitleText: string * ?TitleFont: Font * ?TitleStandoff: int * ?Title: Title * ?Color: Color * ?AxisType: StyleParam.AxisType * ?MinMax: (#System.IConvertible * #System.IConvertible) * ?Mirror: StyleParam.Mirror * ?ShowSpikes: bool * ?SpikeColor: Color * ?SpikeThickness: int * ?ShowLine: bool * ?LineColor: Color * ?ShowGrid: bool * ?GridColor: Color * ?GridDash: StyleParam.DrawingStyle * ?ZeroLine: bool * ?ZeroLineColor: Color * ?Anchor: StyleParam.LinearAxisId * ?Side: StyleParam.Side * ?Overlaying: StyleParam.LinearAxisId * ?Domain: (float * float) * ?Position: float * ?CategoryOrder: StyleParam.CategoryOrder * ?CategoryArray: seq<#System.IConvertible> * ?RangeSlider: LayoutObjects.RangeSlider * ?RangeSelector: LayoutObjects.RangeSelector * ?BackgroundColor: Color * ?ShowBackground: bool * ?Id: StyleParam.SubPlotId -> (GenericChart.GenericChart -> GenericChart.GenericChart)
static member Chart.withYAxisStyle: ?TitleText: string * ?TitleFont: Font * ?TitleStandoff: int * ?Title: Title * ?Color: Color * ?AxisType: StyleParam.AxisType * ?MinMax: (#System.IConvertible * #System.IConvertible) * ?Mirror: StyleParam.Mirror * ?ShowSpikes: bool * ?SpikeColor: Color * ?SpikeThickness: int * ?ShowLine: bool * ?LineColor: Color * ?ShowGrid: bool * ?GridColor: Color * ?GridDash: StyleParam.DrawingStyle * ?ZeroLine: bool * ?ZeroLineColor: Color * ?Anchor: StyleParam.LinearAxisId * ?Side: StyleParam.Side * ?Overlaying: StyleParam.LinearAxisId * ?AutoShift: bool * ?Shift: int * ?Domain: (float * float) * ?Position: float * ?CategoryOrder: StyleParam.CategoryOrder * ?CategoryArray: seq<#System.IConvertible> * ?RangeSlider: LayoutObjects.RangeSlider * ?RangeSelector: LayoutObjects.RangeSelector * ?BackgroundColor: Color * ?ShowBackground: bool * ?Id: StyleParam.SubPlotId -> (GenericChart.GenericChart -> GenericChart.GenericChart)
module GenericChart
from Plotly.NET
<summary>
Module to represent a GenericChart
</summary>
val toChartHTML: gChart: GenericChart.GenericChart -> string
val error: f1: float -> f2: float -> float
val f1: float
val f2: float
val pown: x: 'T -> n: int -> 'T (requires member get_One and member ( * ) and member (/))
<summary>Overloaded power operator. If <c>n > 0</c> then equivalent to <c>x*...*x</c> for <c>n</c> occurrences of <c>x</c>. </summary>
<param name="x">The input base.</param>
<param name="n">The input exponent.</param>
<returns>The base raised to the exponent.</returns>
<example id="pown-example"><code lang="fsharp"></code></example>
val loocvPolynomial: xData: Vector<float> -> yData: Vector<float> -> order: int -> float
Leave-one-out cross validation. Returns the mean squared error of each leave-out at the
specific polynomial order. Minimize for model selection.
val xData: Vector<float>
Multiple items
module Vector
from FSharp.Stats
--------------------
type Vector<'T> =
interface IEnumerable
interface IEnumerable<'T>
interface IStructuralEquatable
interface IStructuralComparable
interface IComparable
new: opsV: INumeric<'T> option * arrV: 'T array -> Vector<'T>
override Equals: yobj: obj -> bool
override GetHashCode: unit -> int
member GetSlice: start: int option * finish: int option -> Vector<'T>
member Permute: p: permutation -> Vector<'T>
...
--------------------
new: opsV: INumeric<'T> option * arrV: 'T array -> Vector<'T>
val yData: Vector<float>
val xDataMat: matrix
val ofVector: x: Vector<float> -> matrix
val getFitFuncPol: (Matrix<float> -> Vector<float> -> RowVector<float> -> float)
val meanSquaredError: float
module CrossValidation
from FSharp.Stats.Fitting
val loocv: xData: Matrix<'T> -> yData: Vector<'T> -> fitFunc: (Matrix<'T> -> Vector<'T> -> RowVector<'T> -> 'T) -> error: ('T -> 'T -> 'T) -> 'T (requires member (+) and member DivideByInt and member get_Zero)
<summary>Computes a leave one out cross-validation<br />xData: rowwise x-coordinate matrix,<br />yData: yData vector<br />fit: x and y data lead to function that maps an xData row vector to a y-coordinate,<br />error: defines the error of the fitted y-coordinate and the actual y-coordinate</summary>
<remarks></remarks>
<param name="loocv"></param>
<returns></returns>
<example><code></code></example>
val ordersToCheck: int[]
val errorPol: (int * float)[]
Multiple items
module Array
from FSharp.Stats
<summary>
Module to compute common statistical measure on array
</summary>
--------------------
module Array
from Microsoft.FSharp.Collections
<summary>Contains operations for working with arrays.</summary>
<remarks>
See also <a href="https://docs.microsoft.com/dotnet/fsharp/language-reference/arrays">F# Language Guide - Arrays</a>.
</remarks>
--------------------
type Array =
new: unit -> Array
static member geomspace: start: float * stop: float * num: int * ?IncludeEndpoint: bool -> float array
static member linspace: start: float * stop: float * num: int * ?IncludeEndpoint: bool -> float[]
--------------------
new: unit -> Array
val map: mapping: ('T -> 'U) -> array: 'T[] -> 'U[]
<summary>Builds a new array whose elements are the results of applying the given function
to each of the elements of the array.</summary>
<param name="mapping">The function to transform elements of the array.</param>
<param name="array">The input array.</param>
<returns>The array of transformed elements.</returns>
<exception cref="T:System.ArgumentNullException">Thrown when the input array is null.</exception>
<example id="map-1"><code lang="fsharp">
let inputs = [| "a"; "bbb"; "cc" |]
inputs |> Array.map (fun x -> x.Length)
</code>
Evaluates to <c>[| 1; 3; 2 |]</c></example>
val error: float
val chartPol: GenericChart.GenericChart
val result: string
Multiple items
module Seq
from FSharp.Stats
<summary>
Module to compute common statistical measure
</summary>
--------------------
module Seq
from Microsoft.FSharp.Collections
<summary>Contains operations for working with values of type <see cref="T:Microsoft.FSharp.Collections.seq`1" />.</summary>
--------------------
type Seq =
new: unit -> Seq
static member geomspace: start: float * stop: float * num: int * ?IncludeEndpoint: bool -> seq<float>
static member linspace: start: float * stop: float * num: int * ?IncludeEndpoint: bool -> seq<float>
--------------------
new: unit -> Seq
val minBy: projection: ('T -> 'U) -> source: seq<'T> -> 'T (requires comparison)
<summary>Returns the lowest of all elements of the sequence, compared via Operators.min on the function result.</summary>
<param name="projection">A function to transform items from the input sequence into comparable keys.</param>
<param name="source">The input sequence.</param>
<returns>The smallest element of the sequence.</returns>
<exception cref="T:System.ArgumentNullException">Thrown when the input sequence is null.</exception>
<exception cref="T:System.ArgumentException">Thrown when the input sequence is empty.</exception>
<example id="minby-1"><code lang="fsharp">
let inputs = [ "aaa"; "b"; "cccc" ]
inputs |> Seq.minBy (fun s -> s.Length)
</code>
Evaluates to <c>"b"</c></example>
<example id="minby-2"><code lang="fsharp">
let inputs = []
inputs |> Seq.minBy (fun (s: string) -> s.Length)
</code>
Throws <c>System.ArgumentException</c>.
</example>
val snd: tuple: ('T1 * 'T2) -> 'T2
<summary>Return the second element of a tuple, <c>snd (a,b) = b</c>.</summary>
<param name="tuple">The input tuple.</param>
<returns>The second value.</returns>
<example id="snd-example"><code lang="fsharp">
snd ("first", 2) // Evaluates to 2
</code></example>
val fst: tuple: ('T1 * 'T2) -> 'T1
<summary>Return the first element of a tuple, <c>fst (a,b) = a</c>.</summary>
<param name="tuple">The input tuple.</param>
<returns>The first value.</returns>
<example id="fst-example"><code lang="fsharp">
fst ("first", 2) // Evaluates to "first"
</code></example>
val getFitFuncSpline: xDat: Matrix<float> -> yDat: seq<float> -> xDatTrain: RowVector<float> -> lambda: float -> float
val xDat: Matrix<float>
val yDat: seq<float>
val xDatTrain: RowVector<float>
val lambda: float
val xDatVec: vector
val zippedData: (float * float)[]
val zip: source1: seq<'T1> -> source2: seq<'T2> -> seq<'T1 * 'T2>
<summary>Combines the two sequences into a sequence of pairs. The two sequences need not have equal lengths:
when one sequence is exhausted any remaining elements in the other
sequence are ignored.</summary>
<param name="source1">The first input sequence.</param>
<param name="source2">The second input sequence.</param>
<returns>The result sequence.</returns>
<exception cref="T:System.ArgumentNullException">Thrown when either of the input sequences is null.</exception>
<example id="zip-1"><code lang="fsharp">
let numbers = [1; 2]
let names = ["one"; "two"]
Seq.zip numbers names
</code>
Evaluates to a sequence yielding the same results as <c>seq { (1, "one"); (2, "two") }</c>.
</example>
val ofSeq: source: seq<'T> -> 'T[]
<summary>Builds a new array from the given enumerable object.</summary>
<param name="source">The input sequence.</param>
<returns>The array of elements from the sequence.</returns>
<exception cref="T:System.ArgumentNullException">Thrown when the input sequence is null.</exception>
<example id="ofseq-1"><code lang="fsharp">
let inputs = seq { 1; 2; 5 }
inputs |> Array.ofSeq
</code>
Evaluates to <c>[| 1; 2; 5 |]</c>.
</example>
val xValTest: float
module Spline
from FSharp.Stats.Fitting
val smoothingSpline: data: (float * float)[] -> basispts: float[] -> (float -> float -> float)
<summary>Creates a smoothing spline through some data. Takes as spline points the x-values given by basispts.<br />The resulting function takes lambda (regularization parameter) and a x_Value as input. </summary>
<remarks></remarks>
<param name="data"></param>
<returns></returns>
<example><code></code></example>
val chartSpline: GenericChart.GenericChart
in loocv the border points are chosen so that the support range of the training data set does not cover the test point.
if splines are used, that are not defined outside the border points use the following:
val fit: (float -> float)
val errorSpl: f1: float -> f2: float -> float
val loocvSmoothingSpline: xData: Vector<float> -> yData: Vector<float> -> lambda: float -> float
Leave-one-out cross validation. Returns the mean squared error of each leave-out at the
specific regularization parameter (lambda). Minimize the (MSE) for model selection.
val getFitFuncSpl: (Matrix<float> -> seq<float> -> RowVector<float> -> float)
val lambdasToCheck: float[]
val i: float
val errorSpline: (float * float)[]
val chartSplineError: GenericChart.GenericChart
val resultSpline: string
val repeatedKFoldPolynomial: k: int -> xData: Vector<float> -> yData: Vector<float> -> order: int -> CrossValidation.CrossValidationResult<float>
val k: int
val xDataMat: Matrix<float>
module Generic
from FSharp.Stats.MatrixModule
val ofVector: vector: Vector<'a> -> Matrix<'a>
val repeatedKFold: k: int -> iterations: int -> xData: Matrix<'T> -> yData: Vector<'T> -> fit: (Matrix<'T> -> Vector<'T> -> RowVector<'T> -> 'T) -> error: ('T -> 'T -> 'T) -> getStDev: (seq<'T> -> 'T) -> CrossValidation.CrossValidationResult<'T> (requires member (+) and member DivideByInt and member get_Zero)
<summary>Computes a repeated k fold cross-validation,<br />k: training set size (and number of iterations),<br />iterations: number of random subset creation,<br />xData: rowwise x-coordinate matrix,<br />yData: yData vector<br />fit: x and y data lead to function that maps a xData row vector to a y-coordinate,<br />error: defines the error of the fitted y-coordinate and the actual y-coordinate,<br />getStDev: function that calculates the standard deviation from a seq<^T>. (Seq.stDev)</summary>
<remarks></remarks>
<param name="repeatedKFold"></param>
<returns></returns>
<example><code></code></example>
val stDev: items: seq<'T> -> 'U (requires member (-) and member get_Zero and member DivideByInt and member (+) and member ( * ) and member (+) and member (/) and member Sqrt)
<summary>
Computes the sample standard deviation
</summary>
<param name="items">The input sequence.</param>
<remarks>Returns NaN if data is empty or if any entry is NaN.</remarks>
<returns>standard deviation of a sample (Bessel's correction by N-1)</returns>
val kfPolynomial: order: int -> CrossValidation.CrossValidationResult<float>
val repeatedKFoldSpline: k: int -> xData: Vector<float> -> yData: Vector<float> -> lambda: float -> CrossValidation.CrossValidationResult<float>
val kfSpline: lambda: float -> CrossValidation.CrossValidationResult<float>
val kfp: GenericChart.GenericChart
val errorSplinekf: (int * float)[] * float[]
val error: CrossValidation.CrossValidationResult<float>
CrossValidation.CrossValidationResult.Error: float
CrossValidation.CrossValidationResult.ErrorStDev: float
val unzip: array: ('T1 * 'T2)[] -> 'T1[] * 'T2[]
<summary>Splits an array of pairs into two arrays.</summary>
<param name="array">The input array.</param>
<returns>The two arrays.</returns>
<exception cref="T:System.ArgumentNullException">Thrown when the input array is null.</exception>
<example id="unzip-1"><code lang="fsharp">
let inputs = [| (1, "one"); (2, "two") |]
let numbers, names = inputs |> Array.unzip
</code>
Evaluates <c>numbers</c> to <c>[|1; 2|]</c> and <c>names</c> to <c>[|"one"; "two"|]</c>.
</example>
static member Chart.withYAxis: yAxis: LayoutObjects.LinearAxis * ?Id: StyleParam.SubPlotId -> (GenericChart.GenericChart -> GenericChart.GenericChart)
namespace Plotly.NET.LayoutObjects
Multiple items
type LinearAxis =
inherit DynamicObj
new: unit -> LinearAxis
static member init: ?Visible: bool * ?Color: Color * ?Title: Title * ?AxisType: AxisType * ?AutoTypeNumbers: AutoTypeNumbers * ?AutoRange: AutoRange * ?AutoShift: bool * ?RangeMode: RangeMode * ?Range: Range * ?FixedRange: bool * ?ScaleAnchor: LinearAxisId * ?ScaleRatio: float * ?Constrain: AxisConstraint * ?ConstrainToward: AxisConstraintDirection * ?Matches: LinearAxisId * ?Rangebreaks: seq<Rangebreak> * ?TickMode: TickMode * ?NTicks: int * ?Tick0: #IConvertible * ?DTick: #IConvertible * ?TickVals: seq<#IConvertible> * ?TickText: seq<#IConvertible> * ?Ticks: TickOptions * ?TicksOn: CategoryTickAnchor * ?TickLabelMode: TickLabelMode * ?TickLabelPosition: TickLabelPosition * ?TickLabelStep: int * ?TickLabelOverflow: TickLabelOverflow * ?Mirror: Mirror * ?TickLen: int * ?TickWidth: int * ?TickColor: Color * ?ShowTickLabels: bool * ?AutoMargin: TickAutoMargin * ?ShowSpikes: bool * ?SpikeColor: Color * ?SpikeThickness: int * ?SpikeDash: DrawingStyle * ?SpikeMode: SpikeMode * ?SpikeSnap: SpikeSnap * ?TickFont: Font * ?TickAngle: int * ?ShowTickPrefix: ShowTickOption * ?TickPrefix: string * ?ShowTickSuffix: ShowTickOption * ?TickSuffix: string * ?ShowExponent: ShowExponent * ?ExponentFormat: ExponentFormat * ?MinExponent: float * ?Minor: Minor * ?SeparateThousands: bool * ?TickFormat: string * ?TickFormatStops: seq<TickFormatStop> * ?HoverFormat: string * ?ShowLine: bool * ?LineColor: Color * ?LineWidth: float * ?ShowGrid: bool * ?GridColor: Color * ?GridDash: DrawingStyle * ?GridWidth: float * ?ZeroLine: bool * ?ZeroLineColor: Color * ?ZeroLineWidth: float * ?Shift: int * ?ShowDividers: bool * ?DividerColor: Color * ?DividerWidth: int * ?Anchor: LinearAxisId * ?Side: Side * ?Overlaying: LinearAxisId * ?Layer: Layer * ?Domain: Range * ?Position: float * ?CategoryOrder: CategoryOrder * ?CategoryArray: seq<#IConvertible> * ?UIRevision: #IConvertible * ?RangeSlider: RangeSlider * ?RangeSelector: RangeSelector * ?Calendar: Calendar * ?BackgroundColor: Color * ?ShowBackground: bool -> LinearAxis
static member initCarpet: ?Color: Color * ?Title: Title * ?AxisType: AxisType * ?AutoTypeNumbers: AutoTypeNumbers * ?AutoRange: AutoRange * ?RangeMode: RangeMode * ?Range: Range * ?FixedRange: bool * ?TickMode: TickMode * ?NTicks: int * ?Tick0: #IConvertible * ?DTick: #IConvertible * ?TickVals: seq<#IConvertible> * ?TickText: seq<#IConvertible> * ?Ticks: TickOptions * ?ShowTickLabels: bool * ?TickFont: Font * ?TickAngle: int * ?ShowTickPrefix: ShowTickOption * ?TickPrefix: string * ?ShowTickSuffix: ShowTickOption * ?TickSuffix: string * ?ShowExponent: ShowExponent * ?ExponentFormat: ExponentFormat * ?MinExponent: float * ?SeparateThousands: bool * ?TickFormat: string * ?TickFormatStops: seq<TickFormatStop> * ?ShowLine: bool * ?LineColor: Color * ?LineWidth: float * ?ShowGrid: bool * ?GridColor: Color * ?GridDash: DrawingStyle * ?GridWidth: float * ?CategoryOrder: CategoryOrder * ?CategoryArray: seq<#IConvertible> * ?ArrayDTick: int * ?ArrayTick0: int * ?CheaterType: CheaterType * ?EndLine: bool * ?EndLineColor: Color * ?EndLineWidth: int * ?LabelPadding: int * ?LabelPrefix: string * ?LabelSuffix: string * ?MinorGridColor: Color * ?MinorGridDash: DrawingStyle * ?MinorGridCount: int * ?MinorGridWidth: int * ?Smoothing: float * ?StartLine: bool * ?StartLineColor: Color * ?StartLineWidth: int -> LinearAxis
static member initCategorical: categoryOrder: CategoryOrder * ?Visible: bool * ?Color: Color * ?Title: Title * ?AutoTypeNumbers: AutoTypeNumbers * ?AutoRange: AutoRange * ?AutoShift: bool * ?RangeMode: RangeMode * ?Range: Range * ?FixedRange: bool * ?ScaleAnchor: LinearAxisId * ?ScaleRatio: float * ?Constrain: AxisConstraint * ?ConstrainToward: AxisConstraintDirection * ?Matches: LinearAxisId * ?Rangebreaks: seq<Rangebreak> * ?TickMode: TickMode * ?NTicks: int * ?Tick0: #IConvertible * ?DTick: #IConvertible * ?TickVals: seq<#IConvertible> * ?TickText: seq<#IConvertible> * ?Ticks: TickOptions * ?TicksOn: CategoryTickAnchor * ?TickLabelMode: TickLabelMode * ?TickLabelPosition: TickLabelPosition * ?TickLabelOverflow: TickLabelOverflow * ?Mirror: Mirror * ?TickLen: int * ?TickWidth: int * ?TickColor: Color * ?ShowTickLabels: bool * ?AutoMargin: TickAutoMargin * ?ShowSpikes: bool * ?SpikeColor: Color * ?SpikeThickness: int * ?SpikeDash: DrawingStyle * ?SpikeMode: SpikeMode * ?SpikeSnap: SpikeSnap * ?TickFont: Font * ?TickAngle: int * ?ShowTickPrefix: ShowTickOption * ?TickPrefix: string * ?ShowTickSuffix: ShowTickOption * ?TickSuffix: string * ?ShowExponent: ShowExponent * ?ExponentFormat: ExponentFormat * ?MinExponent: float * ?Minor: Minor * ?SeparateThousands: bool * ?TickFormat: string * ?TickFormatStops: seq<TickFormatStop> * ?HoverFormat: string * ?ShowLine: bool * ?LineColor: Color * ?LineWidth: float * ?ShowGrid: bool * ?GridColor: Color * ?GridDash: DrawingStyle * ?GridWidth: float * ?ZeroLine: bool * ?ZeroLineColor: Color * ?ZeroLineWidth: float * ?Shift: int * ?ShowDividers: bool * ?DividerColor: Color * ?DividerWidth: int * ?Anchor: LinearAxisId * ?Side: Side * ?Overlaying: LinearAxisId * ?Layer: Layer * ?Domain: Range * ?Position: float * ?CategoryArray: seq<#IConvertible> * ?UIRevision: #IConvertible * ?RangeSlider: RangeSlider * ?RangeSelector: RangeSelector * ?Calendar: Calendar -> LinearAxis
static member initIndicatorGauge: ?DTick: #IConvertible * ?ExponentFormat: ExponentFormat * ?MinExponent: float * ?NTicks: int * ?Range: Range * ?SeparateThousands: bool * ?ShowExponent: ShowExponent * ?ShowTickLabels: bool * ?ShowTickPrefix: ShowTickOption * ?ShowTickSuffix: ShowTickOption * ?Tick0: #IConvertible * ?TickAngle: int * ?TickColor: Color * ?TickFont: Font * ?TickFormat: string * ?TickFormatStops: seq<TickFormatStop> * ?TickLen: int * ?TickMode: TickMode * ?TickPrefix: string * ?Ticks: TickOptions * ?TickSuffix: string * ?TickText: seq<#IConvertible> * ?TickVals: seq<#IConvertible> * ?TickWidth: int * ?Visible: bool -> LinearAxis
static member style: ?Visible: bool * ?Color: Color * ?Title: Title * ?AxisType: AxisType * ?AutoTypeNumbers: AutoTypeNumbers * ?AutoRange: AutoRange * ?AutoShift: bool * ?RangeMode: RangeMode * ?Range: Range * ?FixedRange: bool * ?ScaleAnchor: LinearAxisId * ?ScaleRatio: float * ?Constrain: AxisConstraint * ?ConstrainToward: AxisConstraintDirection * ?Matches: LinearAxisId * ?Rangebreaks: seq<Rangebreak> * ?TickMode: TickMode * ?NTicks: int * ?Tick0: #IConvertible * ?DTick: #IConvertible * ?TickVals: seq<#IConvertible> * ?TickText: seq<#IConvertible> * ?Ticks: TickOptions * ?TicksOn: CategoryTickAnchor * ?TickLabelMode: TickLabelMode * ?TickLabelPosition: TickLabelPosition * ?TickLabelStep: int * ?TickLabelOverflow: TickLabelOverflow * ?Mirror: Mirror * ?TickLen: int * ?TickWidth: int * ?TickColor: Color * ?ShowTickLabels: bool * ?AutoMargin: TickAutoMargin * ?ShowSpikes: bool * ?SpikeColor: Color * ?SpikeThickness: int * ?SpikeDash: DrawingStyle * ?SpikeMode: SpikeMode * ?SpikeSnap: SpikeSnap * ?TickFont: Font * ?TickAngle: int * ?ShowTickPrefix: ShowTickOption * ?TickPrefix: string * ?ShowTickSuffix: ShowTickOption * ?TickSuffix: string * ?ShowExponent: ShowExponent * ?ExponentFormat: ExponentFormat * ?MinExponent: float * ?Minor: Minor * ?SeparateThousands: bool * ?TickFormat: string * ?TickFormatStops: seq<TickFormatStop> * ?HoverFormat: string * ?ShowLine: bool * ?LineColor: Color * ?LineWidth: float * ?ShowGrid: bool * ?GridColor: Color * ?GridDash: DrawingStyle * ?GridWidth: float * ?ZeroLine: bool * ?ZeroLineColor: Color * ?ZeroLineWidth: float * ?Shift: int * ?ShowDividers: bool * ?DividerColor: Color * ?DividerWidth: int * ?Anchor: LinearAxisId * ?Side: Side * ?Overlaying: LinearAxisId * ?Layer: Layer * ?Domain: Range * ?Position: float * ?CategoryOrder: CategoryOrder * ?CategoryArray: seq<#IConvertible> * ?UIRevision: #IConvertible * ?RangeSlider: RangeSlider * ?RangeSelector: RangeSelector * ?Calendar: Calendar * ?ArrayDTick: int * ?ArrayTick0: int * ?CheaterType: CheaterType * ?EndLine: bool * ?EndLineColor: Color * ?EndLineWidth: int * ?LabelPadding: int * ?LabelPrefix: string * ?LabelSuffix: string * ?MinorGridColor: Color * ?MinorGridDash: DrawingStyle * ?MinorGridCount: int * ?MinorGridWidth: int * ?Smoothing: float * ?StartLine: bool * ?StartLineColor: Color * ?StartLineWidth: int * ?BackgroundColor: Color * ?ShowBackground: bool -> (LinearAxis -> LinearAxis)
<summary>Linear axes can be used as x and y scales on 2D plots, and as x,y, and z scales on 3D plots.</summary>
--------------------
new: unit -> LayoutObjects.LinearAxis
static member LayoutObjects.LinearAxis.init: ?Visible: bool * ?Color: Color * ?Title: Title * ?AxisType: StyleParam.AxisType * ?AutoTypeNumbers: StyleParam.AutoTypeNumbers * ?AutoRange: StyleParam.AutoRange * ?AutoShift: bool * ?RangeMode: StyleParam.RangeMode * ?Range: StyleParam.Range * ?FixedRange: bool * ?ScaleAnchor: StyleParam.LinearAxisId * ?ScaleRatio: float * ?Constrain: StyleParam.AxisConstraint * ?ConstrainToward: StyleParam.AxisConstraintDirection * ?Matches: StyleParam.LinearAxisId * ?Rangebreaks: seq<LayoutObjects.Rangebreak> * ?TickMode: StyleParam.TickMode * ?NTicks: int * ?Tick0: #System.IConvertible * ?DTick: #System.IConvertible * ?TickVals: seq<#System.IConvertible> * ?TickText: seq<#System.IConvertible> * ?Ticks: StyleParam.TickOptions * ?TicksOn: StyleParam.CategoryTickAnchor * ?TickLabelMode: StyleParam.TickLabelMode * ?TickLabelPosition: StyleParam.TickLabelPosition * ?TickLabelStep: int * ?TickLabelOverflow: StyleParam.TickLabelOverflow * ?Mirror: StyleParam.Mirror * ?TickLen: int * ?TickWidth: int * ?TickColor: Color * ?ShowTickLabels: bool * ?AutoMargin: StyleParam.TickAutoMargin * ?ShowSpikes: bool * ?SpikeColor: Color * ?SpikeThickness: int * ?SpikeDash: StyleParam.DrawingStyle * ?SpikeMode: StyleParam.SpikeMode * ?SpikeSnap: StyleParam.SpikeSnap * ?TickFont: Font * ?TickAngle: int * ?ShowTickPrefix: StyleParam.ShowTickOption * ?TickPrefix: string * ?ShowTickSuffix: StyleParam.ShowTickOption * ?TickSuffix: string * ?ShowExponent: StyleParam.ShowExponent * ?ExponentFormat: StyleParam.ExponentFormat * ?MinExponent: float * ?Minor: LayoutObjects.Minor * ?SeparateThousands: bool * ?TickFormat: string * ?TickFormatStops: seq<TickFormatStop> * ?HoverFormat: string * ?ShowLine: bool * ?LineColor: Color * ?LineWidth: float * ?ShowGrid: bool * ?GridColor: Color * ?GridDash: StyleParam.DrawingStyle * ?GridWidth: float * ?ZeroLine: bool * ?ZeroLineColor: Color * ?ZeroLineWidth: float * ?Shift: int * ?ShowDividers: bool * ?DividerColor: Color * ?DividerWidth: int * ?Anchor: StyleParam.LinearAxisId * ?Side: StyleParam.Side * ?Overlaying: StyleParam.LinearAxisId * ?Layer: StyleParam.Layer * ?Domain: StyleParam.Range * ?Position: float * ?CategoryOrder: StyleParam.CategoryOrder * ?CategoryArray: seq<#System.IConvertible> * ?UIRevision: #System.IConvertible * ?RangeSlider: LayoutObjects.RangeSlider * ?RangeSelector: LayoutObjects.RangeSelector * ?Calendar: StyleParam.Calendar * ?BackgroundColor: Color * ?ShowBackground: bool -> LayoutObjects.LinearAxis
module StyleParam
from Plotly.NET
type AxisType =
| Auto
| Linear
| Log
| Date
| Category
| MultiCategory
member Convert: unit -> obj
override ToString: unit -> string
static member convert: (AxisType -> obj)
static member toString: (AxisType -> string)
<summary>
Sets the axis type. By default (Auto), plotly attempts to determined the axis type by looking into the data of the traces that referenced the axis in question.
</summary>
union case StyleParam.AxisType.Log: StyleParam.AxisType
static member Chart.withYErrorStyle: ?Visible: bool * ?Type: StyleParam.ErrorType * ?Symmetric: bool * ?Array: seq<#System.IConvertible> * ?Arrayminus: seq<#System.IConvertible> * ?Value: float * ?Valueminus: float * ?Traceref: int * ?Tracerefminus: int * ?Copy_ystyle: bool * ?Color: Color * ?Thickness: float * ?Width: float -> (GenericChart.GenericChart -> GenericChart.GenericChart)
val kfs: GenericChart.GenericChart
val errorSplinekf: (float * float)[] * float[]
val shuffleAndSplitPolynomial: p: float -> iterations: int -> xData: Vector<float> -> yData: Vector<float> -> order: int -> CrossValidation.CrossValidationResult<float>
val p: float
val iterations: int
val shuffelAndSplit: p: float -> iterations: int -> xData: Matrix<'T> -> yData: Vector<'T> -> fit: (Matrix<'T> -> Vector<'T> -> RowVector<'T> -> 'T) -> error: ('T -> 'T -> 'T) -> getStDev: (seq<'T> -> 'T) -> CrossValidation.CrossValidationResult<'T> (requires member (+) and member DivideByInt and member get_Zero)
<summary>Computes a repeated shuffel-and-split cross validation<br />p: percentage of training set size from original size,<br />iterations: number of random subset creation,<br />xData: rowwise x-coordinate matrix,<br />yData: yData vector<br />fit: x and y data lead to function that maps a xData row vector to a y-coordinate,<br />error: defines the error of the fitted y-coordinate and the actual y-coordinate,<br />getStDev: function that calculates the standard deviation from a seq<^T>. (Seq.stDev)</summary>
<remarks></remarks>
<param name="shuffelAndSplit"></param>
<returns></returns>
<example><code></code></example>
val sasPolynomial: order: int -> CrossValidation.CrossValidationResult<float>
val shuffleAndSplitSpline: p: float -> iterations: int -> xData: Vector<float> -> yData: Vector<float> -> lambda: float -> CrossValidation.CrossValidationResult<float>
val sasSpline: lambda: float -> CrossValidation.CrossValidationResult<float>
val sasp: GenericChart.GenericChart
val sass: GenericChart.GenericChart