2017-10-22 7 views
1

私は能動的な学習を使った研究プロジェクトを研究する機械を研究しています。私はalpを使用しようとしています。これは、主流の能動的な学習テクニックの実装を提供します。alp - active learningの使用python framework

しかし、私は提供された例でいくらか混乱しています。最初の例はこれです:

from active_learning.active_learning import ActiveLearner 
from sklearn.model_selection import train_test_split 
from sklearn.linear_model import LogisticRegression 
from sklearn.datasets import make_classification 

X, X_unlabeled, y, y_oracle = train_test_split(*make_classification()) 
clf = LogisticRegression().fit(X, y) 

AL = ActiveLearner(strategy='entropy') 
AL.rank(clf, X_unlabeled, num_queries=5) 

そして私は、データがX、X_unlabeled、Y & y_oracleにどうあるべきかわかりませんよ。

  • Xには、すべてのラベルなしデータ、またはラベル付きデータとラベルなしデータの両方が含まれている必要があります。
  • 「y」は空のリストであるか、トレーニングデータのラベルを含みます。
  • y_oracle学習データのみのラベル

答えて

1
>>> help(make_classification) 

make_classification(n_samples=100, n_features=20, n_informative=2, n_redundant=2, 
        n_repeated=0, n_classes=2, n_clusters_per_class=2, weights=None, 
        flip_y=0.01, class_sep=1.0, hypercube=True, shift=0.0, scale=1.0, 
        shuffle=True, random_state=None) 

    Generate a random n-class classification problem. 

    This initially creates clusters of points normally distributed (std=1) 
    about vertices of a `2 * class_sep`-sided hypercube, and assigns an equal 
    number of clusters to each class. It introduces interdependence between 
    these features and adds various types of further noise to the data.

太字強調鉱山が含まれています。この関数は、基本的にあなたのためにダミーデータを生成します。また、help通り、戻り値は、次のとおり次いでシャッフルや電車やテストデータを返すtrain_test_splitに渡され

Returns 
------- 
X : array of shape [n_samples, n_features] 
    The generated samples. 

y : array of shape [n_samples] 
    The integer labels for class membership of each sample. 

試料およびラベルは、。

関連する問題