Skip to content

Commit

Permalink
add defaults for data generator
Browse files Browse the repository at this point in the history
  • Loading branch information
austinhoag committed Sep 24, 2022
1 parent 6ed64e2 commit 97719ff
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
6 changes: 1 addition & 5 deletions examples/engine_tutorial/example.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,7 @@
num_points=1000
# 1. Define the data - X ~ N(0,1), Y ~ X + N(0,1)
dataset = make_synthetic_regression_dataset(
num_points=num_points,
loc_X=0,
loc_Y=0,
sigma_X=1,
sigma_Y=1)
num_points=num_points)

# 2. Create parse trees from the behavioral constraints
# constraint strings:
Expand Down
15 changes: 10 additions & 5 deletions seldonian/utils/tutorial_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@
from seldonian.parse_tree.parse_tree import ParseTree


def generate_data(num_points,loc_X=0.0,loc_Y=0.0,sigma_X=1.0,sigma_Y=1.0):
def generate_data(
num_points,
loc_X=0.0,
loc_Y=0.0,
sigma_X=1.0,
sigma_Y=1.0):
""" Generate 2D random normal data
:param num_points: The number of data points to generate
Expand Down Expand Up @@ -63,10 +68,10 @@ def generate_clipped_data(

def make_synthetic_regression_dataset(
num_points,
loc_X,
loc_Y,
sigma_X,
sigma_Y,
loc_X=0.0,
loc_Y=0.0,
sigma_X=1.0,
sigma_Y=1.0,
include_intercept_term=True,
clipped=False,
clip_min=-3,
Expand Down

0 comments on commit 97719ff

Please sign in to comment.