本文整理汇总了Python中benchmark.Benchmark.benchmark_experiment方法的典型用法代码示例。如果您正苦于以下问题:Python Benchmark.benchmark_experiment方法的具体用法?Python Benchmark.benchmark_experiment怎么用?Python Benchmark.benchmark_experiment使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类benchmark.Benchmark
的用法示例。
在下文中一共展示了Benchmark.benchmark_experiment方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: generate_dataset
# 需要导入模块: from benchmark import Benchmark [as 别名]
# 或者: from benchmark.Benchmark import benchmark_experiment [as 别名]
argument_parser.add_argument('--plot', dest='plot', help="Plotting enabling", nargs='?', const=1)
def generate_dataset(n_classes=5, n_samples=300, n_features=100, center_box=(5.0, 10.0), cluster_std=3.0):
print '''Dataset parameters:
Number of classes: {}
Number of samples: {}
Number of features: {}
The box of centers of classes: {}
Standard deviation of class elements: {}
'''.format(n_classes, n_samples, n_features, center_box, cluster_std)
return make_blobs(n_samples, n_features, n_classes, center_box=center_box, cluster_std=cluster_std)
if __name__ == '__main__':
add_arguments(argument_parser)
args = argument_parser.parse_args()
benchmark = Benchmark(plot=args.plot, logging=args.log, average=args.average)
n_classes, n_samples, n_features, cluster_std = args.classes,\
args.samples, args.features, args.std
try:
center_box = tuple(float(coord) for coord in args.box)
except ValueError:
center_box = (5.0, 10.0)
dataset = generate_dataset(n_classes, n_samples, n_features, center_box, cluster_std)
benchmark.alpha_experiment(dataset)
benchmark.benchmark_experiment(dataset)