当前位置:网站首页>Random forest and poetry maker trained by AMR
Random forest and poetry maker trained by AMR
2022-06-28 11:38:00 【NikoDos】
AMR namely Artificial mental retardation( Artificial mental retardation ), Is a new machine learning algorithm , It aims to ravage the best data by all means , Into a pile of garbage , The following will guide the reader on how to use this algorithm .
# Case study Poetry maker
This case is relatively simple , Just apply to random forests and AMR Technology is enough , The difficulty lies in mastering , Paste source code .
import random
typ = input(" Please enter the selection : 1. Five words 2. Seven words ")
data = [
' Weeping poplar ',
' Xinliu ',
' Yusi Lun ',
' Jinnen ',
' Soft strip ',
' Weeping poplar on the curved bank ',
' Willow branch ',
' Idle willows ',
' Thousands of flowers and willows ',
' The flowers ',
' Fragrant and tender ',
' Shake green ',
' Green roll ',
' Thick green ',
' Hengcui ',
' Jinbi ',
' Unwind and relax ',
' Piece by piece ',
' Wisps ',
' New sunny days after falling ',
' Long Qing ',
' Time ',
' Wanmei ',
' Wenli ',
' thick ',
' youth ',
' Emptiness ',
' Spring is soft ',
' Qingwan ',
' Xin lie ',
' He wan ',
' Clear the pistils ',
' Qingfen ',
' Su Yue ',
' Red pigment ',
' Beautiful flying flowers ',
' Floating flower ',
' newly bloomed flowers ',
' Flower Shadow ',
' Fragrant cluster ',
' Floating fragrance ',
' Brocade flowers ',
' Embroidered grass ',
' brilliant ',
' A trace ',
' Carved jade ',
' Diao Qiong ',
' Numerous branches ',
' Plain scenery ',
' Dense leaf ',
' A little water for thick flowers ',
' Face ',
' The wind is light ',
' The water is hazy ',
' Warm rouge ',
' Water dissolves ',
' Non-marking ',
' What time is spring ',
' Invite spring to ',
' Flowers reflect willows ',
' Flower depth ',
' The height of the tree ',
' Turn the breeze ',
' The fragrance connects with the thick dew in the sky ',
' Soft east wind ',
' Water passes away and clouds roll ',
' Flowers and branches ',
' Hundreds of flowers ',
' Warm with the wind ',
' Spring is full of trees ',
' Beautiful and bright ',
' Tired guests of the world of mortals ',
' Liu Dai shakes the wind ',
' Fragrance falls on the court house ',
' The water is wide and the flowers are flying ',
' Thin leaves and wind ',
' Yeyexinxin ',
' Eye enchanting pull ',
' Light pink crimson ',
]
def choose_word(num):
chose = []
for i in range(num):
chose.append(random.choice(data))
return chose
if int(typ) == 1:
sentence_list = []
for i in range(10):
chose = choose_word(2)
while len(chose[-1]) + len(chose[-2]) != 5:
chose = choose_word(2)
if len(chose[-1]) == 2 and len(chose[-2]) == 3:
sentence_list.append(chose[-1] + chose[-2])
elif len(chose[-1]) == 3 and len(chose[-2]) == 2:
sentence_list.append(chose[-2] + chose[-1])
print(sentence_list)
elif int(typ) == 2:
sentence_list = []
for i in range(10):
chose = choose_word(3)
while len(chose[-1]) + len(chose[-2]) != 7:
chose = choose_word(3)
sentence_list.append(chose[-1] + chose[-2])
print(sentence_list)
131 Line code , Data accounts for more than half , This proves the enormity of the data , It tests your coding speed and patience . The following logic handles , Using random forest random Advanced library .
random.choice(list)This code is for random forest training data set ,AMR It is reflected in the stupidity of code writing and the rubbish.
The time complexity of this algorithm is O (2^n), The resulting poems are all Rotten poetry , It is also a fine product . yes AMR A good sample for testing , A good example of random forest !
边栏推荐
猜你喜欢

太阳能无线LED显示屏的特点

day30 js笔记 BOM和DOM 2021.09.24

Making and using of static library

如临现场的视觉感染力,NBA决赛直播还能这样看?

Day36 JS notes ecma6 syntax 2021.10.09

Day31 JS notes DOM 2021.09.26

Day39 prototype chain and page Fireworks Effect 2021.10.13

Blue Bridge Cup Maze (dfs+ backtracking)

2022中国信通院首届业务与应用安全发展论坛成功召开!

零基础自学SQL课程 | IF函数
随机推荐
Which broker is safer and more convenient to open an account for Oriental Fortune mobile stock?
Thesis reading (59):keyword based diverse image retrieval with variable multiple instance graph
Setinterval, setTimeout and requestanimationframe
day33 js笔记 事件(下)2021.09.28
day36 js笔记 ECMA6语法 2021.10.09
The default point of this in JS and how to modify it to 2021.11.09
什么是DAPP系统发展与解析理解
Day39 prototype chain and page Fireworks Effect 2021.10.13
JS foundation 1-js introduction and operator
MySql5.7添加新用户
JS foundation 6
day31 js笔记 DOM下 2021.09.26
Tidb v6.0.0 (DMR): initial test of cache table - tidb Book rush
Solutions to connection failures and errors when accessing mysql8 using the SSM project
Day23 JS notes 2021.09.14
GDB简介
近况
太阳能无线LED显示屏的特点
Day28 strict mode, string JS 2021.09.22
Introduction to GDB