当前位置: 首页 > news >正文

有没有可以做各种字体的网站网站开发需要投入多少时间

有没有可以做各种字体的网站,网站开发需要投入多少时间,做淘宝还是做网站容易,云vps怎么搭建网站写在前面 关于数据科学环境的建立#xff0c;可以参考我的博客#xff1a; 【深耕 Python】Data Science with Python 数据科学#xff08;1#xff09;环境搭建 往期数据科学博文一览#xff1a; 【深耕 Python】Data Science with Python 数据科学#xff08;2可以参考我的博客 【深耕 Python】Data Science with Python 数据科学1环境搭建 往期数据科学博文一览 【深耕 Python】Data Science with Python 数据科学2jupyter-lab和numpy数组 【深耕 Python】Data Science with Python 数据科学3Numpy 常量、函数和线性空间 【深耕 Python】Data Science with Python 数据科学4书337页练习题及解答 【深耕 Python】Data Science with Python 数据科学5Matplotlib可视化1 【深耕 Python】Data Science with Python 数据科学6Matplotlib可视化2 【深耕 Python】Data Science with Python 数据科学7书352页练习题 【深耕 Python】Data Science with Python 数据科学8pandas数据结构Series和DataFrame 【深耕 Python】Data Science with Python 数据科学9书361页练习题 【深耕 Python】Data Science with Python 数据科学10pandas 数据处理一 【深耕 Python】Data Science with Python 数据科学11pandas 数据处理二 【深耕 Python】Data Science with Python 数据科学12pandas 数据处理三 【深耕 Python】Data Science with Python 数据科学13pandas 数据处理四书377页练习题 【深耕 Python】Data Science with Python 数据科学14pandas 数据处理五泰坦尼克号亡魂 Perished Souls on “RMS Titanic” 【深耕 Python】Data Science with Python 数据科学15pandas 数据处理六书385页练习题 【深耕 Python】Data Science with Python 数据科学16Scikit-learn机器学习一 【深耕 Python】Data Science with Python 数据科学17Scikit-learn机器学习二 【深耕 Python】Data Science with Python 数据科学18Scikit-learn机器学习三 代码说明 由于实机运行的原因可能省略了某些导入import语句。 11.7.4 Exercises 1. The RandomForestClassifier( ) function takes a keyword argument called n_estimators that represents the “number of trees in the forest”. According to the documentation, what is the default value for n_estimators? Use random_state1. Answer in Python: # ex 1 from sklearn.ensemble import RandomForestClassifier random_forest RandomForestClassifier(random_state1) print(random_forest.n_estimators) # default value of number of trees random_forest_2 RandomForestClassifier(random_state1, n_estimators10) print(random_forest_2.n_estimators) # set the value of number of trees程序输出 100 # 默认树棵数 10 # 设置值2. By varying n_estimators in the call to RandomForestClassifier( ), determine the approximate value where the Random Forest classifier is less accurate than Decision Tree. Use random_state1. Answer in Python: 首先取n_estimators50 import numpy as np import pandas as pd import matplotlib.pyplot as pltURL https://learnenough.s3.amazonaws.com/titanic.csv titanic pd.read_csv(URL)from sklearn.tree import DecisionTreeClassifier from sklearn.ensemble import RandomForestClassifierdropped_columns [PassengerId, Name, Cabin, Embarked, SibSp, Parch, Ticket, Fare] for column in dropped_columns:titanic titanic.drop(column, axis1)for column in [Age, Sex, Pclass]:titanic titanic[titanic[column].notna()]sexes {male: 0, female: 1} titanic[Sex] titanic[Sex].map(sexes)X titanic.drop(Survived, axis1) Y titanic[Survived]from sklearn.model_selection import train_test_split(X_train, X_test, Y_train, Y_test) train_test_split(X, Y, random_state1)decision_tree DecisionTreeClassifier(random_state1) decision_tree.fit(X_train, Y_train) accuracy_decision_tree decision_tree.score(X_test, Y_test)random_forest RandomForestClassifier(random_state1, n_estimators50) random_forest.fit(X_train, Y_train) accuracy_random_forest random_forest.score(X_test, Y_test)results pd.DataFrame({Model: [Decision Tree, Random Forest],Score: [accuracy_decision_tree, accuracy_random_forest] })result_df results.sort_values(byScore, ascendingFalse) result_df result_df.set_index(Score) print(result_df)模型准确率排序输出 # 准确率 模型 Score Model 0.854749 Decision Tree 0.854749 Random Forest此时使用50棵树的随机森林模型和决策树模型的识别准确率恰好相等保留至小数点后第6位。经过多次尝试当取n_estimators18时两种模型的识别准确率相等 random_forest RandomForestClassifier(random_state1, n_estimators18) random_forest.fit(X_train, Y_train) accuracy_random_forest random_forest.score(X_test, Y_test)# 准确率 模型 Score Model 0.854749 Decision Tree 0.854749 Random Forest取n_estimators17时随机森林模型的识别准确率首次变为低于决策树模型。 random_forest RandomForestClassifier(random_state1, n_estimators17) random_forest.fit(X_train, Y_train) accuracy_random_forest random_forest.score(X_test, Y_test)# 准确率 模型 Score Model 0.854749 Decision Tree 0.843575 Random Forest综上要寻找的阈值大约为17. 3. By rerunning the steps in Section 11.7.2 using a few different values of random_state, verify that the ordering is not always the same as shown in Listing 11.25. Hint: Try values like 0, 2, 3, and 4. Answer: 在划分数据集过程中和部分模型中修改random_state参数的值。 random_state0 from sklearn.model_selection import train_test_split(X_train, X_test, Y_train, Y_test) train_test_split(X, Y, random_state0)模型参数省略 模型识别准确率输出 # 准确率 模型 Score Model 0.821229 Logistic Regression # 逻辑斯蒂回归 0.793296 Decision Tree # 决策树 0.782123 Naive Bayes # 朴素贝叶斯 0.776536 Random Forest # 随机森林 0.681564 Perceptron # 感知机random_state2 from sklearn.model_selection import train_test_split(X_train, X_test, Y_train, Y_test) train_test_split(X, Y, random_state2)模型参数省略 模型识别准确率输出 # 准确率 模型 Score Model 0.837989 Decision Tree # 决策树 0.826816 Logistic Regression # 逻辑斯蒂回归 0.821229 Random Forest # 随机森林 0.787709 Perceptron # 感知机 0.782123 Naive Bayes # 朴素贝叶斯random_state3 from sklearn.model_selection import train_test_split(X_train, X_test, Y_train, Y_test) train_test_split(X, Y, random_state3)模型参数省略 模型识别准确率输出 # 准确率 模型 Score Model 0.810056 Decision Tree # 决策树 0.810056 Random Forest # 随机森林 0.782123 Logistic Regression # 逻辑斯蒂回归 0.765363 Naive Bayes # 朴素贝叶斯 0.402235 Perceptron # 感知机和random_state1时的准确率排序相同但整体上存在大幅度下降趋势。 random_state4 from sklearn.model_selection import train_test_split(X_train, X_test, Y_train, Y_test) train_test_split(X, Y, random_state4)模型参数省略 模型识别准确率输出 # 准确率 模型 Score Model 0.837989 Random Forest # 随机森林 0.798883 Logistic Regression # 逻辑斯蒂回归 0.782123 Decision Tree # 决策树 0.765363 Naive Bayes # 朴素贝叶斯 0.603352 Perceptron # 感知机日后可以深究一下random_state参数对不同模型识别准确率的影响本文在此不作赘述。不过显而易见的是简单感知机的识别准确率性能确实基本上是垫底的。 4. Repeat the clustering steps in Section 11.7.3 using two clusters and eight clusters. Does the algorithm still work well in both cases? Answer in Python: 首先取KMeans算法中的n_clusters2输出聚类结果聚类中心点坐标 from sklearn.datasets import make_blobs import matplotlib.pyplot as pltX, _ make_blobs(n_samples300, centers4, random_state42)from sklearn.cluster import KMeanskmeans KMeans(n_clusters2) kmeans.fit(X) centers kmeans.cluster_centers_ print(centers)程序输出 [[-6.83235205 -6.83045748] # 中心点1[-2.26099839 6.07059051]] # 中心点2聚类结果可视化 fig, ax plt.subplots() ax.scatter(X[:, 0], X[:, 1]) ax.scatter(centers[:, 0], centers[:, 1], s200, alpha0.9, colororange) plt.title(Cluster Result Illustration) plt.xlabel(X) plt.ylabel(Y) plt.grid() plt.show()输出的图像 可见上方3个簇被模型划分为1个类。 再取KMeans算法中的n_clusters8输出聚类结果聚类中心点坐标 kmeans KMeans(n_clusters8) # 修改的代码行聚类结果图示 结果比较好理解8 4 * 2模型对每一个数据簇赋了2个聚类中心。 但是当n_clusters16时出人意料的是模型并没有简单地按照4 * 4的方式进行“分配”而是3 5 4 4 kmeans KMeans(n_clusters16)直观上认为导致这种现象的原因可能是样本点的数量。 再分别观察n_clusters24 和 n_clusters32时的情形 平均分配6 6 6 6 8 8 7 9“平均率”被打破。 看来模型对于聚类中心的“分配”是随机的但位置基本落在各个数据簇的边缘内这个结果是可以令人满意的。 参考文献 Reference 《Learn Enough Python to be Dangerous——Software Development, Flask Web Apps, and Beginning Data Science with Python》, Michael Hartl, Boston, Pearson, 2023.
http://www.hkea.cn/news/14522956/

相关文章:

  • 企业网站发布图片文章策划书案例范文
  • 网站制作 呼和浩特深圳公司注册地址变更
  • 怎么在国税网站上做实名认证巨鹿企业做网站
  • 购物网站模板合肥网站建设模板
  • 广源建设集团有限公司网站平面设计公司图片
  • 海门网站制作动漫网站设计报告
  • wordpress可以问答seo关键词排名优化怎么样
  • 苏州专门网站wordpress的安装教程视频
  • 怎样选择高性价比的建站公司企业注册信息
  • 网站建设分为哪几个步骤汕头网站建设报价
  • 绵阳市建设工程监督网站楼盘网站模板
  • 左右左布局网站建设读经典做临床报名网站
  • 番禺网站建设怎样专业的网页设计服务公司
  • 网站域名要实名认证吗go网站做富集分析
  • 忆唐网不做网站做品牌申京效率值联盟第一
  • 临沂网站建设举措wordpress插件安装本地
  • 企业网站建设记什么会计科目淄博网站制作网页公司
  • 网站标题关键词长度德尔普网络做网站怎么样
  • 人社局网站群建设工作方案成都建站模板公司
  • 个人建站步骤wordpress 自定义网址
  • 2017做网站挣钱域名是什么结构称为域名空间
  • 在哪个网站可以查做项目中标的对战平台网站怎么建设
  • 搭建网站后的网址网站建设灬金手指下拉
  • 建网站和app北京装修设计公司排行
  • 网站开发平台及常用开发工具免费微信小程序免费制作平台
  • 临沂建设公司网站免费查询网
  • wordpress企业网站主题合肥光束网站建设
  • linux系统怎么做网站沈阳个人网站建设代理品牌
  • 先做网站还是app拜年图片制作
  • 电子商务网站建设的可行性分析包括赣州人才招聘网