File size: 1,407 Bytes
79f6c4b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<html>
	<head>
		<script type="module" crossorigin src="https://cdn.jsdelivr.net/npm/@gradio/lite/dist/lite.js"></script>
		<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@gradio/lite/dist/lite.css" />
	</head>
	<body>

            
            
		<gradio-lite>
            <gradio-requirements>
            lightgbm
            plotly
            scikit-learn
            seaborn
            </gradio-requirements>
        
            <gradio-file name="app.py" entrypoint>
import gradio as gr
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt


df = pd.read_csv("hf://datasets/merve/supersoaker-failures/supersoaker.csv")
df.dropna(axis=0, inplace=True)

def plot(df):
    plt.scatter(df.measurement_13, df.measurement_15, c = df.loading,alpha=0.5)
    plt.savefig("scatter.png")
    df['failure'].value_counts().plot(kind='bar')
    plt.savefig("bar.png")
    sns.heatmap(df.select_dtypes(include="number").corr())
    plt.savefig("corr.png")
    plots = ["corr.png","scatter.png", "bar.png"]
    return plots
    
inputs = [gr.Dataframe(label="Supersoaker Production Data")]
outputs = [gr.Gallery(label="Profiling Dashboard")]

gr.Interface(plot, inputs=inputs, outputs=outputs, examples=[df.head(100)], title="Supersoaker Failures Analysis Dashboard").launch()
                
            </gradio-file>
        
        </gradio-lite>
            
	</body>
</html>