A122-Android音乐播放器app(IDEA,SpringBoot,SSM,MySQL)

【项目功能介绍】

    本系统包含后台管理和前端app双端系统,后台管理的功能包含: 登录, 退出, 修改管理员信息(基本信息与头像),资源管理,角色管理,资源权限分配,字典管理,用户管理,音乐管理;  app端功能:注册,登录,轮播图,网络音乐,收藏点赞音乐,播放音乐,搜索音乐,本地音乐,播放本地音乐,用户基本信息管理,用户头像修改,密码修改,我的收藏,用户退出

【技术栈】

    Web端                               

    后台前端:layui,js、jQuery、css、html       

    后台框架:Java、Spring boot、Spring Mvc、Mybatis Plus、Shiro、ajax

    数据库:Mysql5.7

    App客户端

    前端框架:xml、LinearLayout、RelativeLayout

    后台框架:OkHttp、fastJson   

项目成果展示:

  • 4
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
1. 导入必要的库和数据 首先,我们需要导入必要的库和数据。在这里,我们使用的是scikit-learn内置的贷款违约数据集。 ```python import pandas as pd from sklearn.linear_model import LogisticRegression from sklearn.model_selection import train_test_split from sklearn.metrics import accuracy_score # 导入数据集 data = pd.read_csv('https://raw.githubusercontent.com/jbrownlee/Datasets/master/german.csv', header=None) # 设置列名 data.columns = ['checking_account', 'duration', 'credit_history', 'purpose', 'credit_amount', 'savings_account', 'employment', 'installment_rate', 'personal_status', 'other_debtors', 'residence_since', 'property', 'age', 'other_installment_plans', 'housing', 'existing_credits', 'job', 'num_dependents', 'own_telephone', 'foreign_worker', 'class'] # 查看前5行数据 print(data.head()) ``` 输出: ``` checking_account duration credit_history purpose credit_amount \ 0 A11 6 A34 A43 1169 1 A12 48 A32 A43 5951 2 A14 12 A34 A46 2096 3 A11 42 A32 A42 7882 4 A11 24 A33 A40 4870 savings_account employment installment_rate personal_status other_debtors \ 0 A65 A75 4 A93 A101 1 A61 A73 2 A92 A101 2 A61 A74 2 A93 A101 3 A61 A74 2 A93 A103 4 A61 A73 3 A93 A101 ... property age other_installment_plans housing existing_credits job \ 0 ... A121 67 A143 A152 2 A173 1 ... A121 22 A143 A152 1 A173 2 ... A121 49 A143 A152 1 A172 3 ... A122 45 A143 A153 1 A173 4 ... A124 53 A143 A153 2 A173 num_dependents own_telephone foreign_worker class 0 1 A192 A201 1 1 1 A191 A201 2 2 2 A191 A201 1 3 2 A191 A201 1 4 2 A191 A201 2 [5 rows x 21 columns] ``` 2. 数据预处理 接下来,我们需要对数据进行预处理,包括将分类变量进行编码、将样本分为训练集和测试集等。 ```python # 将分类变量进行编码 data = pd.get_dummies(data, columns=['checking_account', 'credit_history', 'purpose', 'savings_account', 'employment', 'personal_status', 'other_debtors', 'property', 'other_installment_plans', 'housing', 'job', 'own_telephone', 'foreign_worker']) # 将类别变量class转换为0和1 data['class'] = data['class'].apply(lambda x: 0 if x == 2 else 1) # 将数据集分为训练集和测试集 X_train, X_test, y_train, y_test = train_test_split(data.drop('class', axis=1), data['class'], test_size=0.2, random_state=42) ``` 3. 训练模型 接下来,我们使用逻辑回归模型对贷款人的违约风险进行分类。我们使用scikit-learn的LogisticRegression类。 ```python # 训练模型 model = LogisticRegression() model.fit(X_train, y_train) ``` 4. 预测并评估模型 最后,我们使用测试集对模型进行评估,并计算模型的准确性。 ```python # 预测并评估模型 y_pred = model.predict(X_test) accuracy = accuracy_score(y_test, y_pred) print('Accuracy:', accuracy) ``` 输出: ``` Accuracy: 0.775 ``` 这意味着我们的模型可以正确地分类贷款人的违约风险约77.5%的时间。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值