Linear Regression MCP

Linear Regression MCP

一个 MCP 服务器,只需上传 CSV 文件即可让 Claude 训练线性回归模型,处理从数据预处理到模型评估的整个机器学习流程。 (Alternatively, a slightly more technical translation:) 一个 MCP 服务器,允许 Claude 通过简单上传 CSV 文件来训练线性回归模型,并处理包括数据预处理和模型评估在内的整个机器学习流水线。

Category
访问服务器

Tools

check_category_columns

This function check if data has categorical columns. Returns: String which contains list of categorical columns.

label_encode_categorical_columns

This function label encodes all the categorical columns. Returns: String which confirms success of encoding process.

train_linear_regression_model

This function trains linear regression model. Args: Takes input for output column name. Returns: String which contains the RMSE value.

upload_file

This function read the csv data and stores it in the class variable. Args: Absolute path to the .csv file. Returns: String which shows the shape of the data.

get_columns_info

This function gives information about columns. Returns: String which contains column names.

README

线性回归 MCP

欢迎来到 线性回归 MCP! 这个项目演示了使用 Claude 和模型上下文协议 (MCP) 的端到端机器学习工作流程。

Claude 可以完全独立地训练一个线性回归模型,只需上传一个包含数据集的 CSV 文件即可。 系统将经历整个 ML 模型训练生命周期,处理数据预处理、训练和评估(RMSE 计算)。

<br>

设置和安装

1. 克隆仓库:

首先,将仓库克隆到您的本地机器:

git clone https://github.com/HeetVekariya/Linear-Regression-MCP
cd Linear-Regression-MCP

2. 安装 uv:

uv 是一个极其快速的 Python 包和项目管理器,用 Rust 编写。 它对于管理此项目中的服务器和依赖项至关重要。

  • 这里 下载并安装 uv

3. 安装依赖项:

安装 uv 后,运行以下命令以安装所有必需的依赖项:

uv sync

4. 配置 Claude Desktop:

要将服务器与 Claude Desktop 集成,您需要修改 Claude 配置文件。 按照适用于您操作系统的说明进行操作:

  • 对于 macOS 或 Linux:
code ~/Library/Application\ Support/Claude/claude_desktop_config.json
  • 对于 Windows:
code $env:AppData\Claude\claude_desktop_config.json
  • 在配置文件中,找到 mcpServers 部分,并将占位符路径替换为 uv 安装和线性回归项目目录的绝对路径。 它应该看起来像这样:
{
    "mcpServers":
    {
        "linear-regression": 
        {
            "command": "ABSOLUTE/PATH/TO/.local/bin/uv",
            "args":
            [
                "--directory",
                "ABSOLUTE/PATH/TO/YOUR-LINEAR-REGRESSION-REPO", 
                "run",
                "server.py"
            ] 
        }
    }
}
  • 保存文件后,重新启动 Claude Desktop 以与 MCP 服务器链接。

<br>

可用工具

以下工具可在此项目中使用,以帮助您处理数据集并训练模型:

工具 描述 参数
upload_file(path) 上传 CSV 文件并存储以供处理。 path: CSV 文件的绝对路径。
get_columns_info() 检索上传的数据集中的列名。 无参数。
check_category_columns() 检查数据集中是否存在任何分类列。 无参数。
label_encode_categorical_columns() 将分类列标签编码为数值。 无参数。
train_linear_regression_model(output_column) 训练线性回归模型并计算 RMSE。 output_column: 目标列的名称。

开放贡献

我欢迎对此项目做出贡献! 无论是修复错误、添加新功能还是改进文档,都可以随意 fork 存储库并提交 pull request。

如果您有任何建议或功能请求,请提出 issue,我很乐意讨论它们!

<h3 align="center">👀</h3> <p align="center"> <a href="https://github.com/HeetVekariya" target="_blank"> <img alt="Github" src="https://img.shields.io/badge/GitHub-%2312100E.svg?&style=for-the-badge&logo=Github&logoColor=white" /> </a> <a href="https://twitter.com/heet_2104" target="_blank"> <img alt="Twitter" src="https://img.shields.io/badge/twitter-%231DA1F2.svg?&style=for-the-badge&logo=twitter&logoColor=white" /> </a> <a href="https://www.linkedin.com/in/heet-vekariya-16326024b" target="_blank"> <img alt="LinkedIn" src="https://img.shields.io/badge/linkedin-%230077B5.svg?&style=for-the-badge&logo=linkedin&logoColor=white" /> </a> <a href="https://medium.com/@heetvekariya50" target="_blank"> <img alt="Medium" src="https://img.shields.io/badge/medium-%2312100E.svg?&style=for-the-badge&logo=medium&logoColor=white" /> </a> <a href="https://dev.to/heetvekariya" target="_blank"> <img alt="Dev.to" src="https://img.shields.io/badge/devto-%2312100E.svg?&style=for-the-badge&logo=devto&logoColor=white" /> </a> <a href="mailto:heetvekariya50@gmail.com" target="_blank"> <img alt="Dev.to" src="https://img.shields.io/badge/gmail-%2312100E.svg?&style=for-the-badge&logo=gmail&logoColor=white" /> </a> </p>

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选