AUTOKERAS:虹膜数据集分类

时间:2019-08-28 01:59:09

标签: python

我想使用python autokeras库为应用程序生成最佳算法和超参数:鸢尾花分类。

但是,在互联网上,我只能找到图像分类的示例。

此站点显示了用于图像分类的autokeras库的示例应用程序。

https://www.pyimagesearch.com/2019/01/07/auto-keras-and-automl-a-getting-started-guide/

# loop over the number of seconds to allow the current Auto-Keras
# model to train for
for seconds in TRAINING_TIMES:
    # train our Auto-Keras model
    print("[INFO] training model for {} seconds max...".format(
        seconds))


# I would like to substitute for the multiclass classification problem 
# (not image)
    model = ak.ImageClassifier(verbose=True)
    model.fit(trainX, trainY, time_limit=seconds)
    model.final_fit(trainX, trainY, testX, testY, retrain=True)

    # evaluate the Auto-Keras model
    score = model.evaluate(testX, testY)
    predictions = model.predict(testX)
    report = classification_report(testY, predictions,
        target_names=labelNames)

    # write the report to disk
    p = os.path.sep.join(OUTPUT_PATH, "{}.txt".format(seconds))
    f = open(p, "w")
    f.write(report)
    f.write("\nscore: {}".format(score))
    f.close()

我想替代多类分类问题(不是图像)

0 个答案:

没有答案