当前位置:网站首页>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 !
边栏推荐
- day25 js中的预解析、递归函数、事件 2021.09.16
- 使用ssm项目对Mysql8进行访问的时候,出现连接失败和一些错误的解决办法
- Adding a new user in MySQL 5.7
- Web page tips this site is unsafe solution
- It is safer for individuals to choose which securities company to open an account for buying floor funds
- 合约量化交易系统开发 | 合约量化APP开发(现成案例)
- Day32 JS note event (Part 1) September 27, 2021
- Blue Bridge Cup Maze (dfs+ backtracking)
- Dongyuhui, New Oriental and Phoenix Satellite TV
- day32 js笔记 事件(上)2021.09.27
猜你喜欢
For example, the visual appeal of the live broadcast of NBA Finals can be seen like this?
js中this的默认指向及如何修改指向 2021.11.09
Blue Bridge Cup Maze (dfs+ backtracking)
赛尔号抽奖模拟求期望
零基础自学SQL课程 | IF函数
String & heap & method area
Zero foundation self-study SQL course | if function
Scientific research - web of science retrieval skills
Packaging and publishing application of jetpack compose desktop version
太阳能无线LED显示屏的特点
随机推荐
[sciter]:sciter如何使用i18实现桌面应用多语言切换及其利弊
day24 js笔记 2021.09.15
李宏毅《机器学习》丨7. Conclusion(总结)
Solutions to connection failures and errors when accessing mysql8 using the SSM project
Excel导入导出便捷工具类
人人都可以参与开源!龙蜥社区最不容错过的开发者活动来了
day23 js笔记 2021.09.14
太阳能无线LED显示屏的特点
静态库的制作和使用
QML control type: tabbar
一套十万级TPS的IM综合消息系统的架构实践与思考
Word、PDF、TXT文件实现全文内容检索需要用什么方法?
如临现场的视觉感染力,NBA决赛直播还能这样看?
day32 js笔记 事件(上)2021.09.27
Day33 JS note event (Part 2) September 28, 2021
TiDB v6.0.0 (DMR) :缓存表初试丨TiDB Book Rush
Everyone can participate in open source! Here comes the most important developer activity in dragon lizard community
实体转JSON时,值为null的字段的丢失问题
Day37 JS note motion function 2021.10.11
董宇辉,新东方以及凤凰卫视