コード例 #1
0
ファイル: train.py プロジェクト: ozeron/uds_p1_sentiment
def train(name):
    data_pipeline = DataPipeline
    X_train, X_test, y_train, y_test = load_and_split(name)


    X_after_processing = data_pipeline.fit_transform(X_train)
    print("Data processed!")

    LearningPipeline.fit(X_after_processing, y_train)
    print("Models trained!")

    predicted = calculate_performance(name, name, X_test, y_test,
                                     data_pipeline=data_pipeline)
    store_results(name, y_test, predicted,
                  data_pipeline=data_pipeline)
    calculate_other_performance(name)
コード例 #2
0
def calculate_other_performance(name):
    other_dataset = other_name(name)
    X_train, X_test, y_train, y_test = load_and_split(other_dataset)
    calculate_performance(name, other_dataset, X_test, y_test)
コード例 #3
0
def calculate_stats(trained, testing):
    X_train, X_test, y_train, y_test = load_and_split(testing)
    return calculate_performance(trained, testing, X_test, y_test)