Spaces:
Sleeping
Sleeping
from fastmcp import FastMCP | |
from scipy import stats | |
mcp = FastMCP() | |
def scipy_ttest(a: list[float], b: list[float]) -> dict: | |
"""Performs an independent two-sample t-test.""" | |
t_stat, p_value = stats.ttest_ind(a, b) | |
return {"t_statistic": t_stat, "p_value": p_value} | |
def scipy_pearsonr(x: list[float], y: list[float]) -> dict: | |
"""Calculates the Pearson correlation coefficient.""" | |
corr_coefficient, p_value = stats.pearsonr(x, y) | |
return {"correlation_coefficient": corr_coefficient, "p_value": p_value} | |
if __name__ == "__main__": | |
mcp.run() |