-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
38 additions
and
25 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import numpy as np | ||
|
||
import pandas as pd | ||
pd.set_option('display.expand_frame_repr', False) | ||
pd.set_option('max_colwidth', 1000) | ||
|
||
from ezmodel.core.benchmark import Benchmark | ||
from ezmodel.core.factory import models_from_clazzes | ||
from ezmodel.models.kriging import Kriging | ||
from ezmodel.models.rbf import RBF | ||
from ezmodel.util.partitioning.crossvalidation import CrossvalidationPartitioning | ||
|
||
X = np.random.random((100, 3)) * 2 * np.pi | ||
y = np.sin(X).sum(axis=1) | ||
|
||
models = models_from_clazzes(RBF, Kriging) | ||
|
||
# set up the benchmark and add the models to be used | ||
benchmark = Benchmark(models, n_threads=4, verbose=True, raise_exception=True) | ||
|
||
# create partitions to validate the performance of each model | ||
partitions = CrossvalidationPartitioning(k_folds=5, seed=1).do(X) | ||
|
||
# runs the experiment with the specified partitioning | ||
benchmark.do(X, y, partitions=partitions) | ||
|
||
# print out the benchmark results | ||
print(benchmark.statistics("mae")) | ||
|