当前位置:网站首页>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 !
边栏推荐
- Day37 JS note motion function 2021.10.11
- Wealth management for programmers
- 动态库(共享库)的制作和使用
- Day32 JS note event (Part 1) September 27, 2021
- day39 原型鏈及頁面烟花效果 2021.10.13
- day24 js笔记 2021.09.15
- Day31 JS notes DOM 2021.09.26
- Training notice | special training notice on epidemic prevention and security prevention for overseas Chinese funded enterprises, institutions and personnel in 2022
- 培训通知|2022年境外中资企业机构及人员疫情防控和安全防范专题培训通知
- Making and using of static library
猜你喜欢

day36 js笔记 ECMA6语法 2021.10.09

行业分析| 快对讲,楼宇对讲

携手Cigent:群联为SSD主控固件引入高级网络安全防护特性

Day34 JS notes regular expression 2021.09.29

Making and using of dynamic library (shared library)

智联招聘基于 Nebula Graph 的推荐实践分享

day29 js笔记 2021.09.23

Tidb v6.0.0 (DMR): initial test of cache table - tidb Book rush

TiDB v6.0.0 (DMR) :缓存表初试丨TiDB Book Rush

无法重新声明块范围变量
随机推荐
Redis6 一:Nosql引入、Redis可以解决什么问题?
How to distinguish and define DQL, DML, DDL and DCL in SQL
Day34 JS notes regular expression 2021.09.29
携手Cigent:群联为SSD主控固件引入高级网络安全防护特性
Recommended practice sharing of Zhilian recruitment based on Nebula graph
Day30 JS notes BOM and DOM 2021.09.24
day37 js笔记 运动函数 2021.10.11
Industry analysis - quick intercom, building intercom
JS foundation 4
水果FL Studio/Cubase/Studio one音乐宿主软件对比
元宇宙系统的发展与原理介绍
Day37 JS note motion function 2021.10.11
Graduated
Redis6 1: what problems can be solved by the introduction of NoSQL and redis?
基于验证码识别的机器学习项目captcha_trainer操作实践
QML控件类型:TabBar
Dongyuhui, New Oriental and Phoenix Satellite TV
Day23 JS notes 2021.09.14
一套十万级TPS的IM综合消息系统的架构实践与思考
This Exception was thrown from a job compiled with Burst, which has limited exception support. report errors