rasbt / mlxtend

A library of extension and helper modules for Python's data analysis and machine learning libraries.
https://rasbt.github.io/mlxtend/
Other
4.85k stars 857 forks source link

plot_decision_regions filler_feature_values filler_feature_ranges #873

Closed kurikabocya closed 2 years ago

kurikabocya commented 2 years ago

I can't understand plot_decison_regions's filler_feature_values and filler_feature_ranges Here the filler_feature_values says that the featuer No.3's value is 1.5 Here the filler_feature_ranges says that the featuer No.3's width is 0.75 But what is that 1.5 and 0.75 ?

X, y = datasets.make_blobs(n_samples=600, n_features=3, centers=[[2, 2, -2],[-2, -2, 2]], cluster_std=[2, 2], random_state=2)

Training a classifier

svm = SVC(gamma='auto') svm.fit(X, y)

Decision region for feature 3 = 1.5

value = 1.5

Plot training sample with feature 3 = 1.5 +/- 0.75

width = 0.75

plot_decision_regions(X, y, clf=svm, feature_index=[0,1], filler_feature_values={2: value}, filler_feature_ranges={2: width}, legend=2, ax=axes[0])