Update app.py
Browse files44 unmodified lines45464748494849505152535455565657585859606144 unmodified lines
with gr.Blocks() as demo: gr.Markdown("## Learning the XOR function: An application of Binary Classification using Non-linear SVM") gr.Markdown("This demo is based on this [scikit-learn example](https://scikit-learn.org/stable/auto_examples/svm/plot_svm_nonlinear.html#sphx-glr-auto-examples-svm-plot-svm-nonlinear-py).") gr.Markdown("In this demo, we use a non-linear SVC (Support Vector Classifier) to learn the decision function of the XOR operator.") gr.Markdown("### This demo is based on this [scikit-learn example](https://scikit-learn.org/stable/auto_examples/svm/plot_svm_nonlinear.html#sphx-glr-auto-examples-svm-plot-svm-nonlinear-py).") gr.Markdown("### In this demo, we use a non-linear SVC (Support Vector Classifier) to learn the decision function of the XOR operator.") xor_image = Image.open("xor.png") gr.Image(xor_image, label="Table explaining the 'XOR' operator", shape = (208.5, 250)) gr.HTML("<hr>") gr.Markdown("Furthermore, we observe that we get different decision function plots by varying the Kernel and Gamma hyperparameters of the non-linear SVC.") gr.Markdown("### Furthermore, we observe that we get different decision function plots by varying the Kernel and Gamma hyperparameters of the non-linear SVC.")
gr.Markdown("Feel free to experiment with kernel and gamma values below to see how the quality of the decision function changes with the hyperparameters.") gr.Markdown("### Feel free to experiment with kernel and gamma values below to see how the quality of the decision function changes with the hyperparameters.")
inp1 = gr.Radio(['poly', 'rbf', 'sigmoid'], label="Kernel", info="Choose a kernel") inp2 = gr.Radio(['scale', 'auto'], label="Gamma", info="Choose a gamma value")app.py+4-4