Open Anaxagor opened 3 months ago
Размерность датасета
bnlearn
def independence_test(model, df, test="chi_square", alpha=0.05, prune=False, verbose=3):
Compute edge strength using test statistic.
Description
-----------
Compute the edge strength using a statistical test of independence based using the model structure (DAG) and the data.
For the pairs in the DAG (either by structure learning or user-defined), an statistical test is performed.
Any two variables are associated if the test's p-value < significance_level.
Parameters
----------
model: Instance of bnlearn.structure_learning.
The (learned) model which needs to be tested.
df: pandas.DataFrame instance
The dataset against which to test the model structure.
test: str or function
The statistical test to compute associations.
* chi_square
* g_sq
* log_likelihood
* freeman_tuckey
* modified_log_likelihood
* neyman
* cressie_read
alpha: float
A value between 0 and 1. If p_value < significance_level, the variables are
considered uncorrelated.
prune: bool (default: False)
True: Keep only edges that are significant (<=alpha) based on the independence test.
Returns
-------
df: pandas.DataFrame instance
The dataset against which to test the model structure.
feature engineering / feature construction / feature extraction / feature generation
создание нового признака из 1 или неск. объектов
Продумать конкретные практические кейсы и варианты использования модуля отбора и генерации признаков на основе БС.