FeatureStats#

class scikitplot.feature_selection.FeatureStats(name, dtype, family, n_rows, n_missing, n_non_null, n_unique=None, top_count=None, ordered=None, n_finite=None, n_inf=None, min=None, max=None, mean=None, std=None, q1=None, median=None, q3=None, skewness=None, kurtosis=None, integer_valued=None)[source]#

Training statistics of one column.

Parameters:
namestr

Column name.

dtypestr

str(series.dtype) at fit time.

familystr

DtypeFamily value.

n_rows, n_missing, n_non_nullint

Row count, missing values (NaN, None, NaT, pd.NA) and the rest.

n_uniqueint or None

Distinct non-missing values; None when the cells are unhashable.

top_countint or None

Count of the most frequent non-missing value.

orderedbool or None

Whether a categorical dtype is ordered; None for other families.

n_finite, n_infint or None

Finite and infinite values of a numeric column; None otherwise.

min, max, mean, std, q1, median, q3float or None

Over finite values; std uses ddof=1 and needs two values.

skewness, kurtosisfloat or None

Bias-corrected sample skewness (needs 3 finite values) and excess kurtosis (needs 4), as pandas.Series.skew / pandas.Series.kurt; None for constant data.

integer_valuedbool or None

Every finite value is a whole number; None when there is none.

Parameters:

See also

FeatureSpec

Holds the stats of a fitted feature.

dtype: str[source]#
family: str[source]#
classmethod from_dict(data)[source]#

Rebuild stats from to_dict output, checking field names and types.

Parameters:
datamapping

The stored fields.

Returns:
FeatureStats

The stats.

Raises:
ValueError

For unknown or missing fields or wrongly typed values.

Parameters:

data (Mapping[str, Any])

Return type:

FeatureStats

integer_valued: bool | None = None#
property is_numeric: bool#

The family is integer or float.

Type:

bool

kurtosis: float | None = None#
max: float | None = None#
mean: float | None = None#
median: float | None = None#
min: float | None = None#
property missing_ratio: float#

n_missing / n_rows (0.0 for an empty frame).

Type:

float

n_finite: int | None = None#
n_inf: int | None = None#
n_missing: int[source]#
n_non_null: int[source]#
n_rows: int[source]#
n_unique: int | None = None#
name: str[source]#
ordered: bool | None = None#
q1: float | None = None#
q3: float | None = None#
skewness: float | None = None#
std: float | None = None#
to_dict()[source]#

Return the fields as a mapping of the shared data model.

Return type:

dict[str, Any]

top_count: int | None = None#
property top_ratio: float | None#

share of the most frequent value among non-missing values.

Type:

Float or None

property unique_ratio: float | None#

n_unique / n_non_null; None when undefined.

Type:

Float or None