Feature selector: private API

PortfolioOptimisers.panel_field_keys — Function
panel_field_keys(f::NumericPanelField) -> Vector{String}
panel_field_keys(f::CategoricalPanelField) -> VecStr
panel_field_keys(f::TensorPanelField) -> VecStr

Return the namespace a Feature Selector entry pairs with a Panel Field's name.

A numeric Panel Field contributes one column and has no second namespace, so it answers with an empty vector. Every key paired with it is then absent, and strict decides what that means. A categorical Panel Field answers with its levels and a tensor Panel Field with its labels, and in both the position of a key is the position of the column it selects.

Algorithm

The method that Julia selects is the algorithm.

Arguments

  • f: The Panel Field.

Returns

  • keys::VecStr: The levels, the labels, or an empty vector.

Related

source
PortfolioOptimisers.panel_claim! — Function
panel_claim!(nz::AbstractVector{String}, labels::AbstractVector{String}) -> Vector{Int}

Append a Panel Field's column names to a derived Feature Matrix's names, and return the columns they took.

The one place a derived column index is minted, so the names and the write cannot disagree about where a Panel Field's columns are.

Algorithm

  1. Read the current length of nz, which is the last column already claimed.
  2. Append labels to it.
  3. Return the range of columns the append occupied, as a vector.

Arguments

  • nz: The derived column names under construction. It is appended to.
  • labels: The column names to claim.

Returns

  • cols::Vector{Int}: The columns labels took, in order.

Related

source
PortfolioOptimisers.panel_column_transpose — Function
panel_column_transpose(v::Nothing) -> nothing
panel_column_transpose(v::AbstractVector) -> AbstractVector
panel_column_transpose(v::AbstractMatrix) -> AbstractMatrix

Convert between the shape of the panel axes and the shape of one column of a derived Feature Matrix, in either direction.

A Feature Matrix holds its features on its second axis: assets × features when static, and assets × features × observations when time-varying. So one column of it is assets, or assets × observations. A numeric or a categorical Panel Field, its masks, and the universe masks hold the shape of the panel axes: assets when static, and observations × assets when time-varying, as the returns are. So a static array is the column already, and a time-varying one is the column transposed. The conversion is its own inverse.

Algorithm

The method that Julia selects is the algorithm.

  1. nothing, a mask that marks no cell: return nothing.
  2. A vector: return it.
  3. A matrix: return its lazy transpose.

Arguments

  • v: An array in the shape of the panel axes, or in the shape of one column of a Feature Matrix, or nothing.

Returns

  • c::AbstractArray: v in the other shape.

Related

source
PortfolioOptimisers.panel_onehot — Function
panel_onehot(f::CategoricalPanelField; datatype::DataType = Float64) -> Array

Build the one-hot block a categorical Panel Field contributes to a derived Feature Matrix.

The block has one column per level. A cell holds one(datatype) in the column of its level and zero(datatype) in the others. The block is assets × levels for a static field, and assets × levels × observations for a time-varying one. The field stores the codes, and the library builds this block only where a matrix is needed.

An indicator is built rather than read, so it carries no type of its own and the caller names the one the block is stacked beside. Every caller inside the library derives that type from the data it stacks the block against, so the default is what a caller who stacks the block against nothing gets. panel_field_stack! writes the same block into a Feature Matrix under construction without building it, and takes its type from the matrix.

Algorithm

  1. Read the codes in the shape of one column with panel_column_transpose, and allocate the zero array with the levels on its second axis.
  2. Write one(datatype) at each cell's own level.

Arguments

  • f: The categorical Panel Field.
  • datatype: The element type of the block.

Returns

  • H::Array{datatype}: The one-hot block.

Related

source
PortfolioOptimisers.panel_field_stack_observed! — Function
panel_field_stack_observed!(Z::AbstractArray, f::AbstractPanelField, cols::VecInt) -> nothing
panel_field_stack_observed!(Z::AbstractArray, f::TensorPanelField, cols::VecInt) -> nothing

Write one Panel Field's observed mask into a derived Feature Matrix, as 0/1 columns.

The columns are the ones that panel_field_observed_labels names. A Panel Field with no label axis claims one column, and a TensorPanelField claims one column per label.

Algorithm

The method that Julia selects is the algorithm.

  1. Return when the Panel Field carries no mask.
  2. A Panel Field with no label axis writes its whole mask into its single column.
  3. A TensorPanelField writes one label slice of its mask into each column.

Arguments

  • Z: The derived Feature Matrix under construction.
  • f: The Panel Field.
  • cols: The observed-mask columns the Panel Field claims, in order.

Returns

  • nothing.

Related

source
PortfolioOptimisers.panel_value_columns! — Function
panel_value_columns!(cols::AbstractVector{Tuple{Int, Int, Symbol}}, k::Integer, f::NumericPanelField) -> nothing
panel_value_columns!(cols::AbstractVector{Tuple{Int, Int, Symbol}}, k::Integer, f::CategoricalPanelField) -> nothing
panel_value_columns!(cols::AbstractVector{Tuple{Int, Int, Symbol}}, k::Integer, f::TensorPanelField) -> nothing

Push every value column of one Panel Field onto a resolved Feature Selector, in column order.

This is what a bare field name expands to, and what an absent selector expands to for every Panel Field of the panel. The mask is not among them, because a bare name selects the values alone.

Algorithm

The method that Julia selects is the algorithm. A numeric Panel Field pushes its one column, and the other two push one column per key of panel_field_keys.

Arguments

  • cols: The resolved columns so far, pushed onto in place.
  • k: The Panel Field's position in the panel.
  • f: The Panel Field.

Returns

  • nothing. cols carries the result.

Related

source
PortfolioOptimisers.panel_key_column! — Function
panel_key_column!(cols::AbstractVector{Tuple{Int, Int, Symbol}}, k::Integer, f::AbstractPanelField, key::AbstractString, strict::Bool) -> nothing

Push the one value column a Panel Field's level or label names onto a resolved Feature Selector.

Algorithm

  1. Find key among the Panel Field's keys, from panel_field_keys.
  2. Push the column it names when it is there.
  3. Otherwise hand panel_selector_msg to strict_diagnostic, which throws under strict and warns and drops otherwise.

Arguments

  • cols: The resolved columns so far, pushed onto in place.
  • k: The Panel Field's position in the panel.
  • f: The Panel Field.
  • key: One of its levels or labels.
  • Whether a sel entry throws when it names a field, a level, a label or a group that the Asset Panel does not hold. When strict is false, the entry warns, and the estimator drops it.

Returns

  • nothing. cols carries the result.

Related

source
PortfolioOptimisers.panel_group_columns! — Function
panel_group_columns!(cols::AbstractVector{Tuple{Int, Int, Symbol}}, k::Integer, f::AbstractPanelField, lg::LabelGroup, strict::Bool) -> nothing

Push the value columns of every label in one group of a tensor Panel Field onto a resolved Feature Selector.

Algorithm

  1. Read the groups of the Panel Field. A numeric or a categorical Panel Field has none, and a tensor Panel Field can carry none.
  2. When there are no groups, hand the message to strict_diagnostic, which throws under strict and warns and drops otherwise.
  3. Find the labels whose group is lg.group. When there is none, hand the message to strict_diagnostic, with the nearest group from did_you_mean.
  4. Push the value column of each such label, in the order of the labels.

Arguments

  • cols: The resolved columns so far, pushed onto in place.
  • k: The Panel Field's position in the panel.
  • f: The Panel Field.
  • lg: The group to select. See LabelGroup.
  • Whether a sel entry throws when it names a field, a level, a label or a group that the Asset Panel does not hold. When strict is false, the entry warns, and the estimator drops it.

Returns

  • nothing. cols carries the result.

Related

source
PortfolioOptimisers.panel_column_label — Function
panel_column_label(pnl::AssetPanel, col::Tuple{Int, Int, Symbol})

Return the Feature Selector entry that selects exactly one resolved column.

A label is a selector entry and not a rendered string. The labels of a Feature Matrix are therefore a Feature Selector, and a stack of the panel against them rebuilds the same matrix column for column.

Algorithm

  1. Read the Panel Field the column belongs to.
  2. An observed-mask column takes the name paired with :observed.
  3. A value column of a Panel Field that contributes one takes the bare name.
  4. Any other value column takes the name paired with its level or its label.

Arguments

  • pnl: The Asset Panel.
  • col: One resolved column, from select_fields.

Returns

  • label: The Feature Selector entry naming that column.

Related

source
PortfolioOptimisers.panel_field_value_column! — Function
panel_field_value_column!(zc::AbstractArray, f::NumericPanelField, l::Integer, rows) -> nothing
panel_field_value_column!(zc::AbstractArray, f::CategoricalPanelField, l::Integer, rows) -> nothing
panel_field_value_column!(zc::AbstractArray, f::TensorPanelField, l::Integer, rows) -> nothing

Write one Panel Field's value column into a Feature Matrix under construction.

The method cuts the Panel Field to rows along its observation axis before it writes the column. A stack of one observation therefore reads one row of the Panel Field, and it reads a lifted static Panel Field, whose values are a RepeatedObservations, once and not once per observation. Colon() is the whole field. A static panel has no observation axis, so its only cut is Colon(). stacked_axes refuses every other value before this method runs.

Algorithm

The method that Julia selects is the algorithm. A numeric Panel Field writes its values, a categorical Panel Field writes the 0/1 indicator of one level, and a tensor Panel Field writes one label slice of its values, each cut to rows. A numeric or a categorical Panel Field is observations × assets, and the column is assets × observations, so these two write through panel_column_transpose.

Arguments

  • zc: The column of the Feature Matrix, assets, or assets × stacked rows.
  • f: The Panel Field.
  • l: The position of the level or the label, and 0 for a numeric Panel Field.
  • rows: The observation rows a time-varying Asset Panel stacks, as positions or as a Bool mask, and Colon() for every row. A static panel has no observation axis and refuses any other value.

Returns

  • nothing. zc carries the result.

Related

source
PortfolioOptimisers.panel_field_observed_column! — Function
panel_field_observed_column!(zc::AbstractArray, f::NumericPanelField, rows) -> nothing
panel_field_observed_column!(zc::AbstractArray, f::CategoricalPanelField, rows) -> nothing
panel_field_observed_column!(zc::AbstractArray, f::TensorPanelField, rows) -> nothing

Write one Panel Field's observed mask into a Feature Matrix under construction, as a 0/1 column.

A Panel Field contributes one mask column, whatever its kind and however many value columns it contributes. The column shows whether the cell of that Panel Field was observed for that asset. The mask of a tensor Panel Field carries a label axis of its own, so its column holds where every label of that asset was observed.

A Panel Field that carries no mask gives a column of ones, because omsk === nothing means that the Panel Field cannot blank. The method cuts a mask to rows along its observation axis before it writes it, as panel_field_value_column! cuts a value column. A column of ones is the same whatever rows holds.

Algorithm

The method that Julia selects is the algorithm.

  1. Write ones when the Panel Field carries no mask.
  2. A numeric or a categorical Panel Field writes its mask, cut to rows, through panel_column_transpose.
  3. A tensor Panel Field cuts its mask to rows, reduces it over the label axis, its second axis, with all, and writes that.

Arguments

  • zc: The column of the Feature Matrix, assets, or assets × stacked rows.
  • f: The Panel Field.
  • rows: The observation rows a time-varying Asset Panel stacks, as positions or as a Bool mask, and Colon() for every row. A static panel has no observation axis and refuses any other value.

Returns

  • nothing. zc carries the result.

Related

source
PortfolioOptimisers.panel_data_mask — Function
panel_data_mask(f::AbstractPanelField) -> Option{AbstractArray{Bool}}

Return the mask of the cells of a Panel Field that hold data, or nothing when every cell holds data.

A cell holds data where the raw input carried a value, or where a fill policy wrote one. It holds no data where it holds the placeholder of a blank that no fill reached. So the mask is the negation of the placeholder mask pmsk. A reader that must not take a placeholder as data, such as FeatureDistance and the panel collapse of a meta-optimiser, reads a cell only where this mask is true.

Arguments

  • f: The Panel Field.

Returns

  • d::Option{AbstractArray{Bool}}: .!f.pmsk, the same size as the values, or nothing when f.pmsk is nothing.

Related

source
PortfolioOptimisers.panel_field_column_mask — Function
panel_field_column_mask(f::NumericPanelField, l::Integer, rows = Colon()) -> Option{AbstractArray{Bool}}
panel_field_column_mask(f::CategoricalPanelField, l::Integer, rows = Colon()) -> Option{AbstractArray{Bool}}
panel_field_column_mask(f::TensorPanelField, l::Integer, rows = Colon()) -> Option{AbstractArray{Bool}}

Return the mask of the cells of one value column of a Panel Field that hold data, or nothing when every cell holds data.

A cell holds data where the raw input carried a value or a fill policy wrote one. Elsewhere it holds the placeholder of a blank that no fill reached, and a reader must not take that placeholder as data. The mask is panel_data_mask, the negation of the placeholder mask. A numeric Panel Field has one value column, and a categorical Panel Field holds a placeholder or not for the whole cell, never for one level, so both give their whole mask. A tensor Panel Field gives the mask of the label that the column reads. The method cuts the mask to rows along its observation axis, as panel_field_value_column! cuts a value column. The mask takes the shape of the panel axes, as the active mask does, so a reader tests the two cell by cell.

Algorithm

The method that Julia selects is the algorithm.

  1. A Panel Field that holds no placeholder gives nothing.
  2. A numeric or a categorical Panel Field gives its mask, cut to rows.
  3. A tensor Panel Field gives the slice of its mask at label l, cut to rows, in the shape of the panel axes through panel_column_transpose.

Arguments

  • f: The Panel Field.
  • l: The position of the level or the label, and 0 for a numeric Panel Field.
  • rows: The observation rows a time-varying Asset Panel stacks, as positions or as a Bool mask, and Colon() for every row. A static panel has no observation axis and refuses any other value.

Returns

  • m::Option{AbstractArray{Bool}}: The mask, assets or observations × assets, or nothing.

Related

source
PortfolioOptimisers.feature_data_cells — Function
feature_data_cells(pnl::AssetPanel, cols::AbstractVector{Tuple{Int, Int, Symbol}}) -> Option{AbstractArray{Bool}}

Mark the cells of an Asset Panel at which every resolved value column holds data.

A cell is one asset of a static panel, or one observation and one asset of a time-varying one. It is true where each value column of cols holds data, observed or filled, and false where one of them holds the placeholder of a blank that no fill reached. An observed-mask column holds data in every cell, so it adds nothing. The answer is nothing when no value column of cols holds a placeholder. A FeatureDistance reads an asset at a cell only where this mask and the active mask are both true.

Algorithm

Take the conjunction of the masks that panel_field_column_mask gives for the value columns of cols, and skip each nothing.

Arguments

  • pnl: The Asset Panel.
  • cols: The resolved columns, from select_fields.

Returns

  • d::Option{AbstractArray{Bool}}: The mask, with the shape of the panel's axes, or nothing.

Related

source
PortfolioOptimisers.feature_stack — Function
feature_stack(pnl::AssetPanel, cols::AbstractVector{Tuple{Int, Int, Symbol}}; rows = Colon(),
              placeholder::Option{<:Real} = NaN) -> Array

Stack the resolved columns cols of an Asset Panel into a Feature Matrix. It is steps 2 to 5 of feature_matrix, which states them, for a caller that resolved the Feature Selector already. FeatureDistance resolves it once and reads the same columns for its mask of the cells that hold data.

Arguments

  • pnl: The Asset Panel.
  • cols: The resolved columns, from select_fields.
  • rows: The observation rows a time-varying Asset Panel stacks, as positions or as a Bool mask, and Colon() for every row. A static panel has no observation axis and refuses any other value.
  • placeholder: The value that the Feature Matrix holds at a value column's cell that holds the placeholder of a blank that no fill reached, or nothing to keep the stored placeholder. A cell that a fill policy wrote holds data, and the Feature Matrix keeps its value. The default NaN shows where no data exists, so no reader takes the placeholder as data.

Returns

  • Z::Array: The Feature Matrix.

Related

source
PortfolioOptimisers.feature_stack_eltype — Function
feature_stack_eltype(pnl::AssetPanel, cols::AbstractVector{Tuple{Int, Int, Symbol}}, placeholder::Option{<:Real}) -> Type

Derive the element type of the Feature Matrix that feature_stack stacks from the resolved columns cols. It is steps 2 and 3 of feature_matrix, which states the rule.

Algorithm

  1. Promote over the Panel Fields whose value columns cols holds. An observed-mask column and an indicator contribute nothing, see panel_value_eltype.
  2. With nothing to promote, take the promotion over every Panel Field of the panel.
  3. When a value column reads a Panel Field that holds a placeholder, widen the type to hold placeholder through panel_read_eltype.

Arguments

  • pnl: The Asset Panel.
  • cols: The resolved columns, from select_fields.
  • placeholder: The value that the Feature Matrix holds at a value column's cell that holds the placeholder of a blank that no fill reached, or nothing to keep the stored placeholder. A cell that a fill policy wrote holds data, and the Feature Matrix keeps its value. The default NaN shows where no data exists, so no reader takes the placeholder as data.

Returns

  • T::Type: The element type of the Feature Matrix.

Related

source
PortfolioOptimisers.stacked_axes — Function
stacked_axes(ax::Tuple, rows) -> Tuple

Cut the observation axis of an Asset Panel's axes to the rows a Feature Matrix stacks.

A time-varying panel has the axes (observations, assets). Its Feature Matrix stacks the observation rows that rows names, so the matrix has one row for each of them. rows names a row by its position or by a true in a Bool mask, because both are the indices that the column writers cut with. Colon() is every row, and gives the axes unchanged, on a static panel too. A static panel has the axes (assets,) alone. It has no observation axis to cut, so it refuses any other rows. Without that check, rows would cut the asset axis.

Algorithm

The method that Julia selects is the algorithm.

  1. Colon(): give ax unchanged.
  2. A vector: check that ax carries an observation axis and that rows indexes it. Count the rows it names, which is its length for positions and its count of true for a mask, and give (count, ax[2]).

Arguments

  • ax: The panel's axes, as panel_axes reads them.
  • rows: The observation rows a time-varying Asset Panel stacks, as positions or as a Bool mask, and Colon() for every row. A static panel has no observation axis and refuses any other value.

Validation

  • length(ax) == 2 when rows is not Colon(). Raises an ArgumentError.
  • Every position in rows lies in 1:ax[1], and a Bool mask has length ax[1]. Raises an ArgumentError.

Returns

  • ax::Tuple: (assets,) for a static panel, and (rows named, assets) for a time-varying one.

Related

source
PortfolioOptimisers.select_fields — Function
select_fields(pnl::AssetPanel, sel, strict::Bool) -> Vector{Tuple{Int, Int, Symbol}}

Resolve a Feature Selector against an AssetPanel, and return the columns it names.

feature_matrix and feature_labels both call this one resolution, so the matrix and its labels always name the same columns. It is unexported, because a caller reads the labels and not the positions.

A resolved column is the triple (k, l, part). k is the Panel Field's position in the panel. part is :vals or :observed. l is the position of the level or the label within the Panel Field, and 0 where the Panel Field contributes one column of that part: a numeric Panel Field's value column, and every Panel Field's observed-mask column.

The order of sel is the column order, so a caller decides it. A nothing selector takes the panel's own order, and stacks each Panel Field's values without its mask.

Algorithm

  1. Check that the panel holds a Panel Field. A panel with none carries no feature data. The check refuses it here, where the cause is still known, and not later, where only the empty matrix shows.
  2. Check sel with assert_feature_selector.
  3. sel is nothing: push every Panel Field's value columns in panel order, and return.
  4. Otherwise resolve each entry with select_fields_push!, in the order sel writes them.
  5. Check that no two entries resolved to one column.
  6. Check that the selection is not empty, which happens when every entry resolved against nothing and was dropped.

Arguments

  • pnl: The Asset Panel.
  • Feature Selector that names the Panel Fields that the Feature Matrix stacks, or nothing to stack the values of every field. An entry is a field name, a field paired with the levels or labels that it keeps, a field paired with one level or label, a tensor field paired with a LabelGroup, or a field paired with :observed. The order of the vector is the order of the columns.
  • Whether a sel entry throws when it names a field, a level, a label or a group that the Asset Panel does not hold. When strict is false, the entry warns, and the estimator drops it.

Validation

Returns

  • cols::Vector{Tuple{Int, Int, Symbol}}: One triple per column, in column order.

Related

source
PortfolioOptimisers.select_fields_push! — Function
select_fields_push!(cols::AbstractVector{Tuple{Int, Int, Symbol}}, pnl::AssetPanel, entry, pool, strict::Bool) -> nothing

Resolve one Feature Selector entry against an AssetPanel's Panel Fields.

Algorithm

  1. Read the Panel Field name off the entry: a paired entry names it first, and a bare entry is the name.
  2. Find the Panel Field. Hand panel_selector_msg to strict_diagnostic and return when the panel holds none.
  3. A bare name expands to the Panel Field's value columns, through panel_value_columns!.
  4. A name paired with a Symbol claims the Panel Field's one observed-mask column.
  5. A name paired with one key claims that key's column, through panel_key_column!.
  6. A name paired with a LabelGroup claims the column of every label in that group, through panel_group_columns!.
  7. A name paired with a vector of keys claims one column per key, in the order the vector writes them.

Arguments

  • cols: The resolved columns so far, pushed onto in place.
  • pnl: The Asset Panel.
  • entry: One entry of the Feature Selector.
  • pool: The panel's Panel Field names, the suggestion pool of the first namespace.
  • Whether a sel entry throws when it names a field, a level, a label or a group that the Asset Panel does not hold. When strict is false, the entry warns, and the estimator drops it.

Returns

  • nothing. cols carries the result.

Related

source
PortfolioOptimisers.panel_selector_msg — Function
panel_selector_msg(name, pool::VecStr) -> String
panel_selector_msg(f::NumericPanelField, key, keys::VecStr) -> String
panel_selector_msg(f::AbstractPanelField, key, keys::VecStr) -> String

Build the diagnostic for a Feature Selector entry that resolves against nothing.

The messages name the two namespaces an entry resolves in. The first is the Panel Field names of the panel, and the second is the levels or the labels of one Panel Field. Each method hands its own suggestion pool to did_you_mean, so the suggestion for a misspelling comes from the names the entry could have meant and not from every column of the panel. A numeric Panel Field has no second namespace. For a key paired with it, the message names the two entry forms that the field takes, and it offers no suggestion.

Algorithm

  1. Name the entry that resolved against nothing, and the namespace it was resolved in.
  2. Append the nearest match from the pool with did_you_mean, where there is a pool.

Arguments

  • name: The Panel Field name that resolved against nothing.
  • pool: The Panel Field names of the panel. See VecStr.
  • f: The Panel Field whose key resolved against nothing.
  • key: The level or label that resolved against nothing.
  • keys: The Panel Field's levels or labels. See VecStr.

Returns

  • msg::String: The diagnostic.

Related

source
PortfolioOptimisers.assert_feature_selector — Function
assert_feature_selector(sel::Nothing) -> nothing
assert_feature_selector(sel::AbstractVector) -> nothing

Check that a Feature Selector is a non-empty vector of distinct entries, each in one of the five admitted forms.

The check refuses an empty sel and does not read it as every Panel Field. nothing already says that, and a selection that widens to the whole panel without a message is the failure this selector exists to prevent. The check refuses a repeated entry because it doubles the contribution of its column to every distance.

Algorithm

The method that Julia selects decides whether there is anything to check.

  1. sel is nothing: it stacks every Panel Field's values, so there is nothing to check.
  2. sel is a vector: check that it is non-empty, that it repeats no entry, and that each entry takes an admitted form, with assert_selector_entry.

Arguments

  • Feature Selector that names the Panel Fields that the Feature Matrix stacks, or nothing to stack the values of every field. An entry is a field name, a field paired with the levels or labels that it keeps, a field paired with one level or label, a tensor field paired with a LabelGroup, or a field paired with :observed. The order of the vector is the order of the columns.

Validation

Returns

  • nothing.

Related

source
PortfolioOptimisers.assert_selector_entry — Function
assert_selector_entry(entry) -> nothing

Check that one Feature Selector entry takes one of the five forms the grammar admits.

The five forms are a Panel Field name, a name paired with the levels or labels it keeps, a name paired with one level or label, a name paired with a LabelGroup, and a name paired with :observed. No entry is a column position. Every field, level and label of an Asset Panel carries a name, so an integer has nothing to index.

The check refuses an empty name, and a paired vector that is empty, holds an empty key or repeats a key. Each of those resolves to no column or to a doubled column, and the selector exists to prevent both.

Algorithm

  1. A string: check that it is not empty.
  2. A pair whose first element is a non-empty string: check its second element with selector_value_ok.
  3. Refuse anything else.

Arguments

  • entry: One entry of a Feature Selector.

Validation

  • entry takes one of the five forms. Raises an ArgumentError.

Returns

  • nothing.

Related

source
PortfolioOptimisers.selector_value_ok — Function
selector_value_ok(v) -> Bool

Check the right side of a paired Feature Selector entry, whose left side names a Panel Field.

Algorithm

The method that Julia selects is the algorithm.

  1. A Symbol is admitted when it is :observed.
  2. A string, one level or label, is admitted when it is not empty.
  3. A LabelGroup is admitted when its group is a non-empty string. The check reads the field, because a call of the generated positional constructor skips the check of the typed one.
  4. A vector of strings is admitted when it is not empty, holds no empty key and repeats none.
  5. Anything else is refused.

Arguments

  • v: The right side of the pair.

Returns

  • ok::Bool: Whether the right side takes an admitted form.

Related

source