【问题标题】:RNN classifier for generating advices用于生成建议的 RNN 分类器
【发布时间】:2021-03-05 06:09:18
【问题描述】:

我正在尝试制作一个项目,其中根据特定地区的天气状况生成农业建议。我现在有一个示例数据集,如下所示。

state district month rainfall max_temp min_temp max_rh min_rh wind_speed advice
Orissa Kendrapada february 0.0 34.6 19.4 88.2 29.6 12.0 chances of foot rot disease in paddy crop; apply urea at 3 weeks after transplanting at active tillering stage for paddy;......
Jharkhand Saraikela Kharsawan february 0 35.2 16.6 29.4 11.2 3.6 provide straw mulch and go for intercultural operations to avoid moisture losses from soil; chance of leaf blight disease in potato crop; .......

我想使用此数据集根据天气状况为农民提供建议。我已经标记了建议栏,这是预览。 Tokenized advice image

对其进行标记的代码:

tokenizer= Tokenizer()
token_advice=[]
for i in df['advice']:
   tokenizer.fit_on_texts(i)
   sq = tokenizer.texts_to_sequences(i)
   pda=pad_sequences(sq,padding='pre', truncating='post', maxlen=30)
   token_advice.append(pda)
df['token_advice']=token_advice

现在,我想使用数据集训练模型并能够生成建议。我是机器学习的新手。我该怎么做?

【问题讨论】:

标签: python tokenize


【解决方案1】:

您的数据集有多大?你有多少个类别?

如果不大,而且你只有两个类别使用树模型。

【讨论】:

  • 我的数据集将包含大约 37336 条记录,其中仅包含此处显示的列。州列将只有 29 种不同类型的数据,而地区将有大约 715 种类型的数据。其余数据将是连续两年的每周。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2018-11-11
  • 2016-07-10
  • 2017-03-23
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多