# from random import randrange
# num = int(input('摇几次骰子: '))
# sides=int(input('筛子有几个面: '))
# sum=0
# for i in range(num):
#     sum+= randrange(sides)+1
# print('最终的点数和是 ',sum,'平均点数是:',sum/num)# from random import shuffle
# from pprint import pprint
# values=list(range(1,11))+'Jack Queen King'.split()  #并入列表中
# card_suits='diamonds clubs hearts spades'.split()
# value_suit=['{} of {}'.format(v,c) for v in values for c in card_suits]
# shuffle(value_suit)  #打乱顺序
# pprint(value_suit[:12])
# while value_suit:
#     input(value_suit.pop())
f=open('a123.txt','a')
f.write('hello aaaaaaaaaaaaadddddddddddddddddd')
f.close()f=open('a123.txt','r')
for i in range(10):print(f.readline(),end='')f = open('a123.txt','a')
f.write('This\nis no\nhaikou')
f.close()def process(string):print('处理中...',string)# with open('a123.txt','r') as f:
#     while True:
#         line=f.readline()
#         if not line:
#             break
#         process(line)
with open('a123.txt','r') as f:for line in f:process(line)with open('a123.txt','r') as f:for line in f.readlines():process(line)def triangles():row = [1]while True:yield(row)row = [1] + [row[k] + row[k + 1] for k in range(len(row) - 1)] + [1]
n = 0
results = []
for t in triangles():print(t)results.append(t)n = n + 1if n == 10:break
if results == [[1],[1, 1],[1, 2, 1],[1, 3, 3, 1],[1, 4, 6, 4, 1],[1, 5, 10, 10, 5, 1],[1, 6, 15, 20, 15, 6, 1],[1, 7, 21, 35, 35, 21, 7, 1],[1, 8, 28, 56, 70, 56, 28, 8, 1],[1, 9, 36, 84, 126, 126, 84, 36, 9, 1]
]:print('测试通过!')
else:print('测试失败!')' a test module '__author__ = 'Michael Liao'import sysdef test():args = sys.argvif len(args)==1:print('Hello, world!')elif len(args)==2:print('Hello, %s!' % args[1])else:print('Too many arguments!')if __name__=='__main__':test()class Student(object):pass
bart = Student()
bart.name='jojo'
bart.nameclass Student(object):def __init__(self, name, score):self.name = nameself.score = scoredef get_grade(self):if self.score >= 90:return 'A'elif self.score >= 60:return 'B'else:return 'C'gg=Student('aaa',100)
gg.get_grade()for c in "python":if c=='t':continueprint(c,end=' ')s='python'
while s !='':for c in s:print(c,end='')s=s[:-1]import random
from pprint import pprint
pprint(random.seed(10))
random.random()from random import random
from time import perf_counter
DARTS=1000*10000
hits=0.0
start=perf_counter()
for i in range(1,DARTS+1):x,y=random(),random()dist=pow(x**2+y**2,0.5)if dist <= 1:hits=hits+1
pi = 4*(hits/DARTS)
print("圆周率值是:{}".format(pi))
print('运行时间是:{:.20f}s'.format(perf_counter()-start))import requests
r=requests.get('http://www.shipxy.com/')
r.status_code
r.textfor i in range(1,5):for j in range(1,5):for k in range(1,5):if (i!=j)and(j!=k)and(k!=i):print(i,j,k)profit = int(input('输入发放的利润值(万元): '))
if 0 <= profit <10:print('提成为:',profit*0.1,'万元')
if 10 <= profit < 20:print('提成为:',(profit-10)*0.075+10*0.1,'万元')
if 20 <= profit < 40:print('提成为:',(profit-20)*0.05+10*0.075+10*0.1,'万元')
if 40 <= profit < 60:print('提成为:',(profit-40)*0.03+20*0.05+10*0.075+10*0.1,'万元')
if 60 <= profit < 100:print('提成为:',(profit-60)*0.015+20*0.03+20*0.05+10*0.075+10*0.1,'万元')
if profit >= 100:print('提成为:',(profit-100)*0.01+40*0.015+20*0.03+20*0.05+10*0.075+10*0.1,'万元')profit = int(input('输入企业的利润值(万元): '))
gap = [100,60,40,20,10,0]
ratio =[0.01,0.015,0.03,0.05,0.075,0.1]
bonus=0
for idx in range(0,6):if profit >= gap[idx]:bonus += (profit-gap[idx])*ratio[idx]profit=gap[idx]
print('提成为:',bonus,'万元')profit = int(input('输入企业的利润值(万元): '))
def get_bonus(profit):bonus = 0if 0 <= profit <= 10:bonus = 0.1*profitelif (profit > 10) and (profit <= 20):bonus = (profit-10)*0.075 + get_bonus(10)elif (profit > 20) and (profit <= 40):bonus = (profit-20)*0.05 + get_bonus(20)elif (profit > 40) and (profit <= 60):bonus = (profit-40)*0.03 + get_bonus(40)elif (profit > 60) and (profit <= 100):bonus = (profit-60)*0.015 + get_bonus(60)elif (profit >100):bonus = (profit-100)*0.01 + get_bonus(100)else:print("利润输入值不能为负")return bonusif __name__ == '__main__':print('提成为:',get_bonus(profit),'万元')'''
分析:
x + 100 = m^2
x + 100 + 168 = n^2
n^2 - m^2 = 168
(n + m) * (n - m) = 168
n > m >= 0
n - m 最小值为 1
n + m 最大为 168
n 最大值为 168
m 最大值为 167
'''def _test():for m in range(0, 168):for n in range(m + 1, 169):#print('n=%s,m=%s' % (n, m))if (n + m) * (n - m) == 168:print("该数为:" + str(n * n - 168 - 100))print("该数为:" + str(m * m - 100))print('n为%s,m为%s' % (n, m))
if __name__ == '__main__':_test()def test1():for n in range(0,168):for m in range(n,169):if (m+n)*(m-n) == 168:print("这个整数是: ",str(n*n-100))
if __name__ =='__main__':test1()import pandas as pd
df = pd.read_csv(r'c:\Users\clemente\Desktop\all\train.csv',index_col='Id')
df.head()for i in range(0,7):for j in range(0,7):for k in range(0,7):for g in range(0,7):for h in range(0,7):while (i!=j) and(i!=g) and(g!=h)and(h!=k)and(k!=i):if (i+j+k+g+h)==15:print (i,j,k,g,h)import random
def gen5num():alldigit=[0,1,2,3,4,5,6,0]first=random.randint(0,6)  #randint包含两端,0和6
    alldigit.remove(first)second=random.choice(alldigit)alldigit.remove(second)third=random.choice(alldigit)alldigit.remove(third)forth=random.choice(alldigit)alldigit.remove(forth)fiveth=random.choice(alldigit)alldigit.remove(fiveth)if (first+second+third+forth+fiveth)==15:return first,second,third,forth,fiveth
if __name__=='__main__':for i in range(100):print(gen5num())#!/usr/bin/env python3
#coding=utf-8from itertools import permutations
t = 0
for i in permutations('0123456',5):print(''.join(i))t += 1print("不重复的数量有:%s"%t)def sum_1():"""aaaddd"""for i in '01234567':p += int(i)print(sum(p))
sum_1()np.*load*?#题目:数组中找出两个元素之和 等于给定的整数# 思路:
# 1、将数组元素排序;
# 2、array[i]与a[j](j的取值:i+1到len_array-1) 相加;
# 3、如两两相加<整数继续,如=整数则输出元素值;
# 4、如>则直接退出,i+1 开始下一轮相加比较def addData(array, sumdata):"""aaaadddd"""temp_array = arraytemp_sumdata = sumdataprint ("sumdata: {}".format(temp_sumdata))sorted(temp_array)len_temp_array = len(temp_array)# 计数符合条件的组数num = 0for i in range(0, len_temp_array-1):for j in range(i+1, len_temp_array):for k in range(j+1,len_temp_array):if temp_array[i] + temp_array[j] + temp_array[k] < temp_sumdata:continueelif temp_array[i] + temp_array[j] + temp_array[k] == temp_sumdata:num += 1print("Group {} :".format(num))print("下标:{}, 元素值: {}".format(i, temp_array[i]))else:breakif __name__=="__main__":test_array = [0,1,2,3,4,5,6,0]test_sumdata = 4addData(test_array, test_sumdata)#题目:数组中找出两个元素之和 等于给定的整数# 思路:
# 1、将数组元素排序;
# 2、array[i]与a[j](j的取值:i+1到len_array-1) 相加;
# 3、如两两相加<整数继续,如=整数则输出元素值;
# 4、如>则直接退出,i+1 开始下一轮相加比较import numpy as np
names=np.array(['Bob','Joe','Will','Bob','Will','Joe','Joe'])
data=np.random.randn(7,4)
names
data
names == 'Bob'
data[names=='Bob']arr[[4,3,0,6]]import matplotlib.pyplot as plt
points = np.arange(-5,5,0.01)
xs,ys=np.meshgrid(points,points)
z=np.sqrt(xs**2+ys**2)plt.imshow(z,cmap=plt.cm.gray)
plt.colorbar()
plt.title("图像  $\sqrt{x^2+y^2}$")import pandas as pd
obj=pd.Series(range(3),index=["a","b","c"])
index=obj.index
index[1]='d'
import numpy as np
import pandas as pd
data=pd.DataFrame(np.arange(16).reshape(4,4),index=[1,2,3,4],columns=["one","two","three","forth"])
data<3df1=pd.DataFrame({"A":[1,2]})
df1obj=pd.Series(["a","a","b","c"]*4)
obj
obj.describe()import json
result = json.loads(obj)
resultimport pandas as pd
ages=[12,34,23,45,67,30,20,55,98,30,43]
bins=[1,20,30,40,50,100]
cats=pd.cut(ages,bins)
cats
cats.codes
pd.value_counts(cats)DataF=pd.DataFrame(np.arange(5*4).reshape((5,4)))
DataF
sample_1=np.random.permutation(5*4)
sample_1.reshape(5,4)df=pd.DataFrame({'key':['b','b','a','c','a','b'],'data1':range(6)})
df
df[["data1"]]import pandas as pd
left=pd.DataFrame({'key1':['foo','foo','bar'],'key2':['one','two','one'],'lval':[1,2,3]})
right=pd.DataFrame({'key1':['foo','foo','bar','bar'],'key2':['one','one','one','two'],'rval':[4,5,6,7]})
pd.merge(left,right,on=['key1'])import matplotlib.pyplot as plt
import numpy as np
data=np.arange(10000)
plt.plot(data)fig=plt.figure()
ax1=fig.add_subplot(2,2,1)
ax2=fig.add_subplot(2,2,2)
ax3=fig.add_subplot(2,2,3)ax1.hist(np.random.randn(100),bins=20,color='k',alpha=0.5)
ax2.scatter(np.arange(30),np.arange(30)+3*np.random.randn(30))
ax3.plot(np.random.randn(50).cumsum(),drawstyle='steps-post')fig=plt.figure()
ax=fig.add_subplot(1,1,1)
rect=plt.Rectangle((0.5,0.8),0.4,0.4,color='g',alpha=0.4)
ax.add_patch(rect)plt.savefig("真的.svg",bbox_inches='tight')s=pd.Series(np.random.randn(10).cumsum())
s.plot()s=pd.Series(np.random.randn(10).cumsum(),index=np.arange(0,100,10))
s.plot()df=pd.DataFrame(np.random.randn(10,4).cumsum(0),columns=['A','B','C','D'],index=np.arange(0,100,10))
df.plot()fig,axes=plt.subplots(2,1)
data=pd.Series(np.random.rand(16),index=list("abcdefghijklmnop"))
data.plot.bar(ax=axes[0],color='k',alpha=0.7)
data.plot.barh(ax=axes[1],color='g',alpha=0.7)
plt.show()df=pd.DataFrame(np.random.rand(6,4),index=['one','two','three','four','five','six'],columns=pd.Index(['A','B','C','D'],name='Genus'))
df
df.plot.bar()
df.plot.barh(stacked=True,alpha=0.5)tips=pd.read_csv('tips.csv')
party_counts = pd.crosstab(tips['day'],tips['size'])
party_counts
party_counts=party_counts.loc[:,2:5]
party_countsparty_counts.sum(1)party_pcts= party_counts.div(party_counts.sum(1),axis=0)
party_pcts.plot.bar()import seaborn as sns
tips=pd.read_csv('tips.csv')
tips['tip_pct']=tips['tip']/(tips['total_bill']-tips['tip'])
tips.head()
sns.barplot(x='tip_pct',y='day',data=tips,orient='h')
sns.barplot(x='tip_pct',y='day',hue='time',data=tips,orient='h')
sns.set(style='whitegrid')tips['tip_pct'].plot.hist(bins=50)
tips['total_bill'].plot.hist(bins=50)tips['tip_pct'].plot.density()
tips['total_bill'].plot.density()comp1=np.random.normal(0,1,size=200)
comp2=np.random.normal(10,2,size=200)
values=pd.Series(np.concatenate([comp1,comp2]))
sns.distplot(values,bins=101,color='k')macro=pd.read_csv('macrodata.csv')
data=macro[['cpi','m1','tbilrate','unemp']]
trans_data=np.log(data).diff().dropna()
trans_data.head()
trans_data[-5:]sns.regplot("m1","unemp",data=trans_data)
plt.title('Changes in log {} versus log {}'.format('m1','unemp'))
sns.set(style="ticks", color_codes=True)
sns.pairplot(trans_data,diag_kind='kde',kind='reg')
sns.pairplot(trans_data,diag_kind='hist',kind='reg')sns.factorplot(x='day',y='tip_pct',row='time',hue='smoker',kind='box',data=tips[tips.tip_pct<0.5])tips.describe()import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
df=pd.DataFrame({'key1':['a','a','b','b','a'],'key2':['one','two','one','two','one'],'data1':np.random.randn(5),'data2':np.random.randn(5)})
dfgroup_1=df['data1'].groupby(df['key1'])
group_1.describe()
group_2=df['data1'].groupby([df['key1'],df['key2']]).mean()
group_2states=np.array(['Ohio','California','California','Ohio','Ohio'])
years=np.array([2005,2005,2006,2005,2006])
df['data1'].groupby([states,years]).mean()dict(list(df.groupby('key1')))try:year=input("输入年份:")month=input("输入月份: ")day=input("输入日期号: ")
finally:print("正在计算")months2days=[0,31,59,90,120,151,181,212,243,273,304,334]
# 闰年
if int(year) % 4 ==0:for i in range(2,12,1):months2days[i] +=1month_index=[]
for j in range(12):month_index.append(i+1)
dict_md=dict(zip(month_index,months2days))
whichday=dict_md[int(month)]+int(day)
print('结果是: 第{}天'.format(whichday))def unsortedSearch(list, i, u):found = Falsepos = 0pos2 = 0while pos < len(list) and not found:if int(list[pos]) < int(u) :if int(list[pos2]) > int(i):found = Truepos2 = pos2 + 1pos = pos + 1return foundunsortedList = ['1', '3', '4', '2', '6', '9', '2', '1', '3', '7']
num1 = '3'
num2 = '5'isItThere = unsortedSearch(unsortedList, num1, num2)if isItThere:print ("There is a number between those values")
else:print ("There isn't a number between those values")def get_nums():nums=[]n=int(input("一共有几个整数?"))for i in range(n):x=int(input('请按次随机输入第{}个整数(剩余{}次输入):'.format(i+1,n-i)))nums.append(x)return nums
if __name__=='__main__':list_nums=get_nums()def BubbleSort(nums):  #冒泡法print('初始整数集合为:{}'.format(nums))for i in range(len(nums)-1):for j in range(len(nums)-i-1):if nums[j]>nums[j+1]:nums[j],nums[j+1]=nums[j+1],nums[j] #调换位置,相互赋值print("第{}次迭代排序结果:{}".format((len(nums)-j-1),nums))return nums
if __name__=='__main__':print('经过冒泡法排序最终得到:{}'.format(BubbleSort(list_nums)))def get_nums():nums=[]n=int(input("一共有几个整数?"))for i in range(n):x=int(input('请按次随机输入第{}个整数(剩余{}次输入):'.format(i+1,n-i)))nums.append(x)return nums
if __name__=='__main__':myList=get_nums()def selectedSort(myList):#获取list的长度length = len(myList)#一共进行多少轮比较for i in range(0,length-1):#默认设置最小值得index为当前值smallest = i#用当先最小index的值分别与后面的值进行比较,以便获取最小indexfor j in range(i+1,length):#如果找到比当前值小的index,则进行两值交换if myList[j]<myList[smallest]:tmp = myList[j]myList[j] = myList[smallest]myList[smallest]=tmp#打印每一轮比较好的列表print("Round ",i,": ",myList) #根据第一个i循环进行打印,而不是选j循环print("选择排序法:迭代过程 ")
selectedSort(myList)def merge_sort(LIST):start = []end = []while len(LIST) > 1:a = min(LIST)b = max(LIST)start.append(a)end.append(b)LIST.remove(a)LIST.remove(b)if LIST: start.append(LIST[0])end.reverse()return (start + end)if __name__=='__main__':nums=[]n=int(input('一共几位数: '))for i in range(n):x=int(input("请依次输入整数:"))nums.append(x)print(merge_sort(nums))# =============================================================================
#10.1.2
# =============================================================================
import pandas as pd
df=pd.DataFrame({'key1':['a','a','b','b','a'],'key2':['one','two','one','two','one'],'data1':np.random.randn(5),'data2':np.random.randn(5)})
df
df.groupby(['key1','key2'])['data1'].mean()people=pd.DataFrame(np.random.randn(5,5),columns=['a','b','c','d','e'],index=['joe','steve','wes','jim','travis'])
people
mapping={'a':'red','b':'red','c':'blue','d':'blue','e':'red','f':'orange'}
by_column=people.groupby(mapping,axis=1)
by_column.mean()
map_series=pd.Series(mapping)people.groupby(len).sum()# =============================================================================
# 分组加权
# =============================================================================import pandas as pd
df=pd.DataFrame({'目录':['a','a','a','a','b','b','b','b'],'data':np.random.randn(8),'weights':np.random.randn(8)})
df
grouped=df.groupby('目录')
get_weighpoint=lambda x: np.average(x['data'],weights=x['weights'])
grouped.apply(get_weighpoint)# =============================================================================
#
# =============================================================================

spx=pd.read_csv('stock_px_2.csv',index_col=0,parse_dates=True)
spx
spx.info()from datetime import datetimedatestrs=['7/6/2011','8/6/2011']
[datetime.strptime(x,'%m/%d/%Y')for x in datestrs]dates=pd.date_range('1/1/2018',periods=1000)
dates
long_df=pd.DataFrame(np.random.randn(1000,4),index=dates,columns=['Colorado','Texas','New York','Ohio'])
long_dfpd.date_range('2018-10-1',periods=30,freq='1h')# =============================================================================
#
# =============================================================================
close_px_all=pd.read_csv("stock_px_2.csv",parse_dates=True,index_col=0)
close_px=close_px_all[['AAPL','MSFT','XOM']]
close_px=close_px.resample("B").ffill()
close_px.AAPL.plot()
close_px.AAPL.rolling(250).mean().plot()import pandas as pd
import numpy as np
values=pd.Series(['apple','orange','apple','apple']*2)
values
pd.unique(values)
pd.value_counts(values)import pandas as pd
import matplotlib.pyplot as plt
from sklearn.linear_model import RANSACRegressor, LinearRegression, TheilSenRegressor
from sklearn.metrics import explained_variance_score, mean_absolute_error, mean_squared_error, median_absolute_error, r2_score
from sklearn.svm import SVR
from sklearn.linear_model import Ridge,Lasso,ElasticNet,BayesianRidge
from sklearn.ensemble import GradientBoostingRegressor
from sklearn.cross_validation import train_test_splitdata = pd.read_csv('../cement_data.csv')
# 查看数据记录的长度,共1030行
print(len(data))
# 查看前五行数据
data.head()import pandas
titanic=pandas.read_csv('train.csv')
titanic.head()
titanic.describe()
titanic['Age']=titanic['Age'].fillna(titanic['Age'].median())
print(titanic['Sex'].unique()) #找Sex特征里的分类字符名,只有两种可能性
titanic.loc[titanic['Sex']=='female','Sex']=1#把分类字符名转换成整数1,0形式,进行标记
titanic.loc[titanic['Sex']=='male','Sex']=0
#对embarked 登船地 进行填充(按最多标记)
print(titanic['Embarked'].unique())
titanic['Embarked']=titanic['Embarked'].fillna('S')
titanic.loc[titanic['Embarked']=='S']=0
titanic.loc[titanic['Embarked']=='C']=1
titanic.loc[titanic['Embarked']=='Q']=2# =============================================================================
# 引进模型,线性回归
# =============================================================================
from sklearn.linear_model import LinearRegression
from sklearn.cross_validation import KFold
#cross_validation 交叉验证,进行调参,训练数据集分成三份,三份做交叉验证

predictors=['Pclass','Sex','Age','SibSp','Parch','Fare','Embarked'] #需要输入并做预测的特征列
alg=LinearRegression()
kf=KFold(titanic.shape[0],n_folds=3,random_state=1) #shape[0]一共有多少行,random_state=1 随机种子开启,n_fold=3把训练集分为三份

predictions=[]
for train,test in kf:train_predictors=titanic[predictors].iloc[train,:]  #交叉验证中,除开训练的部分train_target=titanic['Survived'].iloc[train]#获取目标训练集alg.fit(train_predictors,train_target) #依据模型,训练
    test_predictions=alg.predict(titanic[predictors].iloc[test,:]) #测试集
    predictions.append(test_predictions)import numpy as np
predictions=np.concatenate(predictions,axis=0)
# 整理输出值,按照可能性分类到0,1
predictions[predictions>=0.5]=0
predictions[predictions<0.5]=1
accuracy=sum(predictions[predictions==titanic['Survived']])/len(predictions)
print(accuracy)# =============================================================================
# 逻辑回归
# =============================================================================
from sklearn import cross_validation
from sklearn.linear_model import LogisticRegression
alg=LogisticRegression(random_state=1)
scores=cross_validation.cross_val_score(alg,titanic[predictors],titanic['Survived'],cv=3)
print(scores.mean())# =============================================================================
# 随机森林
# =============================================================================
from sklearn import cross_validation
from sklearn.ensemble import RandomForestClassifier
predictors=['Pclass','Sex','Age','SibSp','Parch','Fare','Embarked']
alg=RandomForestClassifier(random_state=1,n_estimators=10,min_samples_split=2,min_samples_leaf=1)
kf=cross_validation.KFold(titanic.shape[0],n_folds=3,random_state=1)
scores=scores=cross_validation.cross_val_score(alg,titanic[predictors],titanic['Survived'],cv=kf)
print(scores.mean())

[Python] 练习代码相关推荐

  1. 【机器视觉案例】(5) AI视觉,手势调节物体尺寸,附python完整代码

    各位同学好,今天和大家分享一下如何使用opencv+mediapipe完成远程手势调节图片尺寸的案例.先放张图看效果.当拇指和食指竖起时,根据食指间的连线的长度自由缩放图片尺寸.图片的中点始终位于指尖 ...

  2. 【机器视觉案例】(5) AI视觉,远程手势控制虚拟计算器,附python完整代码

    各位同学好,今天和大家分享一下如何使用MediaPipe+Opencv完成虚拟计算器,先放张图看效果.FPS值为29,食指和中指距离小于规定阈值则认为点击按键,为避免重复数字出现,规定每20帧可点击一 ...

  3. 【MediaPipe】(4) AI视觉,远程手势调节电脑音量,附python完整代码

    各位同学好,今天和大家分享一下如何使用MediaPipe完成手势调节电脑音量,先放张图看效果. 注意!! 本节需要用到手部关键点的实时跟踪,我已经在之前的文章中详细写过了,本节会直接使用,有疑问的同学 ...

  4. 【深度学习】(2) 数据加载,前向传播2,附python完整代码

    生成数据集: tf.data.Dataset.from_tensor_slices(tensor变量) 创建一个数据集,其元素是给定张量的切片 生成迭代器: next(iter()) next() 返 ...

  5. 【机器学习入门】(13) 实战:心脏病预测,补充: ROC曲线、精确率--召回率曲线,附python完整代码和数据集

    各位同学好,经过前几章python机器学习的探索,想必大家对各种预测方法也有了一定的认识.今天我们来进行一次实战,心脏病病例预测,本文对一些基础方法就不进行详细解释,有疑问的同学可以看我前几篇机器学习 ...

  6. 【机器学习入门】(8) 线性回归算法:正则化、岭回归、实例应用(房价预测)附python完整代码和数据集

    各位同学好,今天我和大家分享一下python机器学习中线性回归算法的实例应用,并介绍正则化.岭回归方法.在上一篇文章中我介绍了线性回归算法的原理及推导过程:[机器学习](7) 线性回归算法:原理.公式 ...

  7. 【机器学习入门】(5) 决策树算法实战:sklearn实现决策树,实例应用(沉船幸存者预测)附python完整代码及数据集

    各位同学好,今天和大家分享一下python机器学习中的决策树算法,在上一节中我介绍了决策树算法的基本原理,这一节,我将通过实例应用带大家进一步认识这个算法.文末有完整代码和数据集,需要的自取.那我们开 ...

  8. 【机器学习入门】(3) 朴素贝叶斯算法:多项式、高斯、伯努利,实例应用(心脏病预测)附python完整代码及数据集

    各位同学好,今天我和大家分享一下朴素贝叶斯算法中的三大模型.在上一篇文章中,我介绍了朴素贝叶斯算法的原理,并利用多项式模型进行了文本分类预测. 朴素贝叶斯算法 -- 原理,多项式模型文档分类预测,附p ...

  9. 同一个内容,对比Java、C、PHP、Python的代码量,结局意外了

    为什么都说Python容易上手!是真的吗? 都说Python通俗易懂,容易上手,甚至不少网友表示「完成同一个任务,C 语言要写 1000 行代码,Java 只需要写 100 行,而 Python 可能 ...

  10. GitHub上7000+ Star的Python常用代码合集

    作者 | 二胖并不胖 来源 | 大数据前沿(ID:bigdataqianyan) 今天二胖给大家介绍一个由一个国外小哥用好几年时间维护的Python代码合集.简单来说就是,这个程序员小哥在几年前开始保 ...

最新文章

  1. 开工啦!这本书助你快速回归高效工作状态
  2. Erdaicms旅游网站系统微信和手机端分销系统正式上线发布啦
  3. 常考数据结构与算法:二叉树的之字形层序遍历
  4. python调用java方法_python调用java
  5. Android逆向基础笔记—Android中的常用ARM汇编指令
  6. 磁盘串口和并口的区别
  7. word删除空白页的方法和技巧详细介绍,提高工作效率!!!!!!!!!!!!
  8. PartialDependencePlots
  9. 医学图像开源数据集汇总
  10. 在EXCEL表格中如何进行快速换行
  11. 绿色IT,从环保到经济效益
  12. 阿里巴巴图标库(iconfont)使用
  13. 玩转华为数据中心交换机系列 | 配置M-LAG双归接入普通以太网络示例
  14. netstat -an
  15. JVM 常用配置参数(Java 8)
  16. useful words in the work
  17. 【oracle】配置恢复管理器Configuring Recovery Manager
  18. 今天我是如何10分钟完成30万售后单问题分类的
  19. 查看DB2数据库版本的方法
  20. JDBC连接mysql数据库及PrepareStatement的作用及原理

热门文章

  1. 推荐一个不错的免费的asp空间
  2. 好友返利网站开发 一
  3. svn 冲突 Error:Node remains in conflict
  4. 服务器端查看图片库 eog display Xforwarding
  5. [GIS笔记] 闾国年:地理全息与全息GIS(未来的GIS)
  6. 从后端到页面:如何全方位监控 Ruby 应用?
  7. 职称最新消息:2022年开始湖北全面实行职称电子证书
  8. scratch编程三级--小猫和笔合作画正方形
  9. Blue Coat 拓展安全行业最大的加密流量管理协作组织
  10. 【谷歌地图--PlacesSDK集成】