Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -47,7 +47,8 @@ parameters = [
|
|
47 |
gr.inputs.Slider(10, 100, step=10, default=50, label="Number of data points (n)"),
|
48 |
gr.inputs.Slider(-50, 50, step=1, default=-50, label="Random Value Range (Min)"),
|
49 |
gr.inputs.Slider(-50, 50, step=1, default=50, label="Random Value Range (Max)"),
|
50 |
-
gr.inputs.
|
|
|
51 |
]
|
52 |
|
53 |
description = "This app presents an illustration of the isotonic regression on generated data (non-linear monotonic trend with homoscedastic uniform noise). The isotonic regression algorithm finds a non-decreasing approximation of a function while minimizing the mean squared error on the training data. The benefit of such a non-parametric model is that it does not assume any shape for the target function besides monotonicity. For comparison a linear regression is also presented. See the original scikit-learn example here: https://scikit-learn.org/stable/auto_examples/miscellaneous/plot_isotonic_regression.html"
|
@@ -58,5 +59,5 @@ examples = [
|
|
58 |
[70, -10, 20, "raise"],
|
59 |
]
|
60 |
|
61 |
-
iface = gr.Interface(fn=visualize_isotonic_regression, inputs=parameters, outputs="plot", title="Isotonic Regression Visualization", description=description, examples=examples)
|
62 |
iface.launch()
|
|
|
47 |
gr.inputs.Slider(10, 100, step=10, default=50, label="Number of data points (n)"),
|
48 |
gr.inputs.Slider(-50, 50, step=1, default=-50, label="Random Value Range (Min)"),
|
49 |
gr.inputs.Slider(-50, 50, step=1, default=50, label="Random Value Range (Max)"),
|
50 |
+
gr.inputs.Radio(["clip", "nan", "raise"], default="clip", label="Out of Bounds Strategy"),
|
51 |
+
# gr.inputs.Dropdown(["clip", "nan", "raise"], default="clip", label="Out of Bounds Strategy"),
|
52 |
]
|
53 |
|
54 |
description = "This app presents an illustration of the isotonic regression on generated data (non-linear monotonic trend with homoscedastic uniform noise). The isotonic regression algorithm finds a non-decreasing approximation of a function while minimizing the mean squared error on the training data. The benefit of such a non-parametric model is that it does not assume any shape for the target function besides monotonicity. For comparison a linear regression is also presented. See the original scikit-learn example here: https://scikit-learn.org/stable/auto_examples/miscellaneous/plot_isotonic_regression.html"
|
|
|
59 |
[70, -10, 20, "raise"],
|
60 |
]
|
61 |
|
62 |
+
iface = gr.Interface(fn=visualize_isotonic_regression, inputs=parameters, outputs="plot", title="Isotonic Regression Visualization", description=description, examples=examples, live=True)
|
63 |
iface.launch()
|