Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -12,7 +12,7 @@ matplotlib.use("Agg")
|
|
| 12 |
import matplotlib.pyplot as plt
|
| 13 |
|
| 14 |
import plotly.graph_objects as go
|
| 15 |
-
from sklearn.metrics import
|
| 16 |
from scipy.stats import pearsonr
|
| 17 |
|
| 18 |
# =========================
|
|
@@ -52,7 +52,26 @@ st.markdown(
|
|
| 52 |
.st-hero .tagline { margin:2px 0 0 2px; color:#6b7280; font-size:1.05rem; font-style:italic; }
|
| 53 |
[data-testid="stBlock"]{ margin-top:0 !important; }
|
| 54 |
/* Center align text in table cells */
|
| 55 |
-
.st-emotion-cache-1wq06yv { text-align: center; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 56 |
</style>
|
| 57 |
""",
|
| 58 |
unsafe_allow_html=True
|
|
@@ -177,12 +196,8 @@ def _nice_tick0(xmin: float, step: int = 100) -> float:
|
|
| 177 |
def cross_plot(actual, pred):
|
| 178 |
a = pd.Series(actual).astype(float)
|
| 179 |
p = pd.Series(pred).astype(float)
|
| 180 |
-
lo = float(np.nanmin([a.min(), p.min()]))
|
| 181 |
-
hi = float(np.nanmax([a.max(), p.max()]))
|
| 182 |
-
pad = 0.03 * (hi - lo if hi > lo else 1.0)
|
| 183 |
-
x0, x1 = lo - pad, hi + pad
|
| 184 |
|
| 185 |
-
#
|
| 186 |
all_values = pd.concat([a, p]).dropna()
|
| 187 |
global_min = all_values.min()
|
| 188 |
global_max = all_values.max()
|
|
|
|
| 12 |
import matplotlib.pyplot as plt
|
| 13 |
|
| 14 |
import plotly.graph_objects as go
|
| 15 |
+
from sklearn.metrics import mean_squared_error, mean_absolute_error
|
| 16 |
from scipy.stats import pearsonr
|
| 17 |
|
| 18 |
# =========================
|
|
|
|
| 52 |
.st-hero .tagline { margin:2px 0 0 2px; color:#6b7280; font-size:1.05rem; font-style:italic; }
|
| 53 |
[data-testid="stBlock"]{ margin-top:0 !important; }
|
| 54 |
/* Center align text in table cells */
|
| 55 |
+
.st-emotion-cache-1wq06yv, .st-emotion-cache-1e71x4x table tr td { text-align: center !important; }
|
| 56 |
+
|
| 57 |
+
/* Hide the drag-and-drop helper text */
|
| 58 |
+
.stFileUploader>label+div { display: none; }
|
| 59 |
+
.stFileUploader>label { width: 100%; }
|
| 60 |
+
.stFileUploader > label:first-child + div { display: block; }
|
| 61 |
+
.stFileUploader > label:first-child { display: none; }
|
| 62 |
+
|
| 63 |
+
/* Pinned Titles */
|
| 64 |
+
.pinned-title {
|
| 65 |
+
position: fixed;
|
| 66 |
+
top: 0;
|
| 67 |
+
left: 0;
|
| 68 |
+
right: 0;
|
| 69 |
+
background: #fff;
|
| 70 |
+
z-index: 999;
|
| 71 |
+
padding: 1rem;
|
| 72 |
+
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
|
| 73 |
+
font-weight: bold;
|
| 74 |
+
}
|
| 75 |
</style>
|
| 76 |
""",
|
| 77 |
unsafe_allow_html=True
|
|
|
|
| 196 |
def cross_plot(actual, pred):
|
| 197 |
a = pd.Series(actual).astype(float)
|
| 198 |
p = pd.Series(pred).astype(float)
|
|
|
|
|
|
|
|
|
|
|
|
|
| 199 |
|
| 200 |
+
# Calculate the global min and max of all data points for consistent scaling
|
| 201 |
all_values = pd.concat([a, p]).dropna()
|
| 202 |
global_min = all_values.min()
|
| 203 |
global_max = all_values.max()
|