本文整理汇总了Python中bigml.api.BigML.delete_source方法的典型用法代码示例。如果您正苦于以下问题:Python BigML.delete_source方法的具体用法?Python BigML.delete_source怎么用?Python BigML.delete_source使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类bigml.api.BigML
的用法示例。
在下文中一共展示了BigML.delete_source方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: bigml
# 需要导入模块: from bigml.api import BigML [as 别名]
# 或者: from bigml.api.BigML import delete_source [as 别名]
def bigml( train_csv, test_csv, result_csv ):
api = BigML(dev_mode=True)
# train model
start_training = timer()
source_train = api.create_source(train_csv)
dataset_train = api.create_dataset(source_train)
model = api.create_model(dataset_train)
end_training = timer()
print('Training model.')
print('Training took %i Seconds.' % (end_training - start_training) );
# test create_model
start_test = timer()
source_test = api.create_source(test_csv)
dataset_test = api.create_dataset(source_test)
batch_prediction = api.create_batch_prediction(
model,
dataset_test,
{
"name": "census prediction",
"all_fields": True,
"header": False,
"confidence": False
}
)
# wait until batch processing is finished
while api.get_batch_prediction(batch_prediction)['object']['status']['progress'] != 1:
print api.get_batch_prediction(batch_prediction)['object']['status']['progress']
time.sleep(1)
end_test = timer()
print('Testing took %i Seconds' % (end_test - start_test) );
api.download_batch_prediction(batch_prediction['resource'], filename=result_csv)
# cleanup
api.delete_source(source_train)
api.delete_source(source_test)
api.delete_dataset(dataset_train)
api.delete_dataset(dataset_test)
api.delete_model(model)