diff --git a/dev/api/index.html b/dev/api/index.html index 42eca88..7d957f0 100644 --- a/dev/api/index.html +++ b/dev/api/index.html @@ -3,7 +3,7 @@ StatsModels.Schema with 1 entry: x => center(x, 5)

You can use a function to compute the center value:

julia> schema((x=collect(1:10), ), Dict(:x => Center(median))) StatsModels.Schema with 1 entry: x => x(centered: 5.5)

Or center will be automatically computed if omitted:

julia> schema((x=collect(1:10), ), Dict(:x => Center()))
 StatsModels.Schema with 1 entry:
-  x => center(x, 5.5)
source
StandardizedPredictors.CenteredTermType
struct CenteredTerm{T,C} <: AbstractTerm

A lazily centered term. A wrapper around an T<:AbstractTerm which will produce centered values with modelcols by subtracting center from each element generated by the wrapped term with modelcols.

Fields

  • term::T: The wrapped term.
  • center::C: The center value subtracted from the resulting modelcols.

Examples

Directly construct with given center:

julia> d = (x=collect(1:10), );
+  x => center(x, 5.5)
source
StandardizedPredictors.CenteredTermType
struct CenteredTerm{T,C} <: AbstractTerm

A lazily centered term. A wrapper around an T<:AbstractTerm which will produce centered values with modelcols by subtracting center from each element generated by the wrapped term with modelcols.

Fields

  • term::T: The wrapped term.
  • center::C: The center value subtracted from the resulting modelcols.

Examples

Directly construct with given center:

julia> d = (x=collect(1:10), );
 
 julia> t = concrete_term(term(:x), d)
 x(continuous)
@@ -38,11 +38,11 @@
   9.0   3.5
  10.0   4.5

Or similarly via schema hints:

julia> sch = schema(d, Dict(:x => Center()))
 StatsModels.Schema with 1 entry:
-  x => center(x, 5.5)
source
StandardizedPredictors.ScaleType
struct Scale

Represents a scaling scheme, akin to StatsModels.AbstractContrasts. Pass as value in Dict as hints to schema (or as contrasts kwarg for fit).

Examples

Can specify scale value to use:

julia> schema((x=collect(1:10), ), Dict(:x => Scale(5)))
+  x => center(x, 5.5)
source
StandardizedPredictors.ScaleType
struct Scale

Represents a scaling scheme, akin to StatsModels.AbstractContrasts. Pass as value in Dict as hints to schema (or as contrasts kwarg for fit).

Examples

Can specify scale value to use:

julia> schema((x=collect(1:10), ), Dict(:x => Scale(5)))
 StatsModels.Schema with 1 entry:
   x => x(scaled: 5))

You can use a function to compute the scale value:

julia> schema((x=collect(1:10), ), Dict(:x => Scale(mad))) StatsModels.Schema with 1 entry: x => x(scaled: 3.71)

Or scale will be automatically computed if left out:

julia> schema((x=collect(1:10), ), Dict(:x => Scale()))
 StatsModels.Schema with 1 entry:
-  x => x(scaled: 3.03)
source
StandardizedPredictors.ScaledTermType
struct ScaledTerm{T,S} <: AbstractTerm

A lazily scaled term. A wrapper around an T<:AbstractTerm which will produce scaled values with modelcols by dividing each element by scale.

Fields

  • term::T: The wrapped term.
  • scale::S: The scale value which the resulting modelcols are divided by.

Examples

Directly construct with given scale:

julia> d = (x=collect(1:10), );
+  x => x(scaled: 3.03)
source
StandardizedPredictors.ScaledTermType
struct ScaledTerm{T,S} <: AbstractTerm

A lazily scaled term. A wrapper around an T<:AbstractTerm which will produce scaled values with modelcols by dividing each element by scale.

Fields

  • term::T: The wrapped term.
  • scale::S: The scale value which the resulting modelcols are divided by.

Examples

Directly construct with given scale:

julia> d = (x=collect(1:10), );
 
 julia> t = concrete_term(term(:x), d)
 x(continuous)
@@ -77,11 +77,11 @@
   9.0  2.9726
  10.0  3.30289

Or similarly via schema hints:

julia> sch = schema(d, Dict(:x => Scale()))
 StatsModels.Schema with 1 entry:
-  x => scale(x, 3.03)
source
StandardizedPredictors.ZScoreType
struct ZScore

Represents a z-scoring scheme, akin to StatsModels.AbstractContrasts. Pass as value in Dict as hints to schema (or as contrasts kwarg for fit).

Examples

Can specify the center and scale values to use:

julia> schema((x=collect(1:10), ), Dict(:x => ZScore(; center=5, scale=3)))
+  x => scale(x, 3.03)
source
StandardizedPredictors.ZScoreType
struct ZScore

Represents a z-scoring scheme, akin to StatsModels.AbstractContrasts. Pass as value in Dict as hints to schema (or as contrasts kwarg for fit).

Examples

Can specify the center and scale values to use:

julia> schema((x=collect(1:10), ), Dict(:x => ZScore(; center=5, scale=3)))
 StatsModels.Schema with 1 entry:
   x => x(centered: 5 scaled: 3)

Or scale will be automatically computed if left out:

julia> schema((x=collect(1:10), ), Dict(:x => ZScore()))
 StatsModels.Schema with 1 entry:
-  x => x(centered: 5.5 scaled: 3.03)
source
StandardizedPredictors.ZScoredTermType
struct ZScoredTerm{T,C,S} <: AbstractTerm

A lazily z-scored term. A wrapper around an T<:AbstractTerm which will produce scaled values with modelcols by subtracting center from each element and then dividing by scale.

Fields

  • term::T: The wrapped term.
  • center::C: The center value which is subtracted from the resulting modelcols.
  • scale::S: The scale value which the resulting modelcols are divided by.

Examples

Directly construct with given scale:

julia> d = (x=collect(1:10), );
+  x => x(centered: 5.5 scaled: 3.03)
source
StandardizedPredictors.ZScoredTermType
struct ZScoredTerm{T,C,S} <: AbstractTerm

A lazily z-scored term. A wrapper around an T<:AbstractTerm which will produce scaled values with modelcols by subtracting center from each element and then dividing by scale.

Fields

  • term::T: The wrapped term.
  • center::C: The center value which is subtracted from the resulting modelcols.
  • scale::S: The scale value which the resulting modelcols are divided by.

Examples

Directly construct with given scale:

julia> d = (x=collect(1:10), );
 
 julia> t = concrete_term(term(:x), d)
 x(continuous)
@@ -116,4 +116,4 @@
   9.0   1.15601
  10.0   1.4863

Or similarly via schema hints:

julia> sch = schema(d, Dict(:x => ZScore()))
 StatsModels.Schema with 1 entry:
-  x => x(centered: 5.5 scaled: 3.03)
source
StandardizedPredictors._standardMethod
_standard(xs::AbstractArray, val)

Translate an abstract standardization value to a concrete one based on xs.

nothing and already concrete Number vals are passed through. Otherwise, val(xs) is returned.

source
StandardizedPredictors.center!Method
center!(f=mean, x, y=f(skipmissing(x)))

Center an array x in place about a scalar y.

See also center

source
StandardizedPredictors.centerMethod
center(f=mean, x, y=f(skipmissing(x)))

Center an array x about a scalar y.

See also center!

source
StandardizedPredictors.scale!Method
scale(f=std, x, y=f(skipmissing(x)))

Scale an array x in place by a scalar y.

Warning

This only scales and does not center the values, unlike scale in R. See StatsBase.zscore for that functionality.

See also scale

source
StandardizedPredictors.scaleMethod
scale(f=std, x, y=f(skipmissing(x)))

Scale an array x by a scalar y.

Warning

This only scales and does not center the values, unlike scale in R. See StatsBase.zscore for that functionality.

See also scale!

source
+ x => x(centered: 5.5 scaled: 3.03)source
StandardizedPredictors._standardMethod
_standard(xs::AbstractArray, val)

Translate an abstract standardization value to a concrete one based on xs.

nothing and already concrete Number vals are passed through. Otherwise, val(xs) is returned.

source
StandardizedPredictors.center!Method
center!(f=mean, x, y=f(skipmissing(x)))

Center an array x in place about a scalar y.

See also center

source
StandardizedPredictors.centerMethod
center(f=mean, x, y=f(skipmissing(x)))

Center an array x about a scalar y.

See also center!

source
StandardizedPredictors.scale!Method
scale(f=std, x, y=f(skipmissing(x)))

Scale an array x in place by a scalar y.

Warning

This only scales and does not center the values, unlike scale in R. See StatsBase.zscore for that functionality.

See also scale

source
StandardizedPredictors.scaleMethod
scale(f=std, x, y=f(skipmissing(x)))

Scale an array x by a scalar y.

Warning

This only scales and does not center the values, unlike scale in R. See StatsBase.zscore for that functionality.

See also scale!

source
diff --git a/dev/index.html b/dev/index.html index 44db188..faf051a 100644 --- a/dev/index.html +++ b/dev/index.html @@ -64,4 +64,4 @@ sex: male -0.107954 0.900037 -0.12 0.9065 -2.06897 1.85306 age(centered: 13) 3.58693 0.152134 23.58 <1e-10 3.25545 3.9184 sex: male & age(centered: 13) 4.37602 0.21515 20.34 <1e-09 3.90725 4.84479 -──────────────────────────────────────────────────────────────────────────────────────────── +──────────────────────────────────────────────────────────────────────────────────────────── diff --git a/dev/search/index.html b/dev/search/index.html index 3e89000..c1f3053 100644 --- a/dev/search/index.html +++ b/dev/search/index.html @@ -1,2 +1,2 @@ -Search · StandardizedPredictors.jl

Loading search...

    +Search · StandardizedPredictors.jl

    Loading search...