.. index:: single: chi_square_feature_selector
.. _chi_square_feature_selector/0:

.. rst-class:: right

**object**

``chi_square_feature_selector``
===============================

Selects categorical or discretized continuous features using Pearson or Yates chi-square, or uncorrected or bias-corrected Cramer V.

| **Availability:** 
|    ``logtalk_load(chi_square_feature_selector(loader))``

| **Author:** Paulo Moura
| **Version:** 1:0:0
| **Date:** 2026-10-07

| **Compilation flags:**
|    ``static, context_switching_calls``


| **Imports:**
|    ``public`` :ref:`filter_feature_selector_common <filter_feature_selector_common/0>`
|    ``public`` :ref:`feature_discretization <feature_discretization/0>`
| **Uses:**
|    :ref:`avltree <avltree/0>`

| **Remarks:**
|    (none)

| **Inherited public predicates:**
|     :ref:`options_protocol/0::check_option/1`  :ref:`options_protocol/0::check_options/1`  :ref:`feature_selector_protocol/0::check_selector/1`  :ref:`options_protocol/0::default_option/1`  :ref:`options_protocol/0::default_options/1`  :ref:`feature_selector_protocol/0::diagnostic/2`  :ref:`feature_selector_protocol/0::diagnostics/2`  :ref:`feature_selector_protocol/0::export_to_clauses/4`  :ref:`feature_selector_protocol/0::export_to_file/4`  :ref:`feature_selector_protocol/0::feature_scores/2`  :ref:`feature_selector_protocol/0::learn/2`  :ref:`feature_selector_protocol/0::learn/3`  :ref:`options_protocol/0::option/2`  :ref:`options_protocol/0::option/3`  :ref:`feature_selector_protocol/0::print_selector/1`  :ref:`feature_selector_protocol/0::selected_features/2`  :ref:`feature_selector_protocol/0::selector_options/2`  :ref:`options_protocol/0::valid_option/1`  :ref:`options_protocol/0::valid_options/1`  :ref:`feature_selector_protocol/0::valid_selector/1`  

.. contents::
   :local:
   :backlinks: top

Public predicates
-----------------

(no local declarations; see entity ancestors if any)

Protected predicates
--------------------

(no local declarations; see entity ancestors if any)

Private predicates
------------------

.. index:: score_columns/4
.. _chi_square_feature_selector/0::score_columns/4:

``score_columns/4``
^^^^^^^^^^^^^^^^^^^

Scores prepared columns using sparse contingency counts.

| **Compilation flags:**
|    ``static``

| **Template:**
|    ``score_columns(Columns,Criterion,ExpectedCountPolicy,Scores)``
| **Mode and number of proofs:**
|    ``score_columns(+list(compound),+atom,+term,-list(pair))`` - ``one_or_error``

| **Exceptions:**
|    A nondegenerate table has an expectation below the requested minimum:
|        ``domain_error(chi_square_expected_count,Feature-expected(ObservedMinimum,RequiredMinimum))``


------------

.. index:: check_expected_counts/3
.. _chi_square_feature_selector/0::check_expected_counts/3:

``check_expected_counts/3``
^^^^^^^^^^^^^^^^^^^^^^^^^^^

Checks the requested minimum expectation for nondegenerate tables.

| **Compilation flags:**
|    ``static``

| **Template:**
|    ``check_expected_counts(Policy,Feature,Counts)``
| **Mode and number of proofs:**
|    ``check_expected_counts(+term,+atomic,+compound)`` - ``one_or_error``

| **Exceptions:**
|    A nondegenerate table has an expectation below the requested minimum:
|        ``domain_error(chi_square_expected_count,Feature-expected(ObservedMinimum,RequiredMinimum))``


------------

Operators
---------

(none)

