使用分类器在测试数据集的基础上训练数据集

时间:2018-06-22 14:58:03

标签: r dataset classification training-data test-data

我正在尝试在测试数据集的基础上训练我的数据集,但面临如何执行此操作的困难。我拥有的数据集是:

   text
1 |  @a_siab @sardarbabak999 @BushraGohar @jafarshahmp @Palwasha_Abbas @Khadimhussain4 @Khushal_Khattak @SPOX_ANP @mjdawar @AsgharAchakzaii @AmirHaiderKH @MianIftikharHus @khaistak50 @SangeenKhan 
2 |  @KPKUpdates @ImranKhanPTI @jhagra @Shah_FarmanPTI @AsadQaiserPTI @MushtaqGhaniPTI @PervezKhattakCM @ziataj @AtifKhanpti It's much better than anp and mma time
3 |  Easy load was started by PTI and not ANP #KaptaanFailedInKP
4 |  @Palwasha_Abbas @Gulalai_Ismail This was much needed and people are happy with using it which avoided traffic issues. Your only issue is PTI buried ANP easyload shops forever now it’s obvious you will cry
5 |  @x_anp <U+304A><U+3081><U+3067><U+3068><U+3046>!!
6 |  Tourism &amp; Poor Condition of Swat Roads, Part-2 #Swat #Tourism #Kpk #CareTakerPM #NasarullMuik #MaryamNawaz #PMLN #PTI #ImranKhan #Newsonepk #ANP #Nadia @nadia_a_mirza #Pakistan 
7 |  @Palwasha_Abbas Kuch samjhayein in ko... Articles likhnay say character thek nhe hotay... ANP is history. @BushraGohar
8 |  <U+062F> <U+06A9><U+0644><U+064A> <U+0631><U+0648><U+063A> <U+062A><U+0631><U+06CC><U+0646><U+0647> <U+0686><U+0627><U+067E><U+06D0><U+0631><U+0647> <U+062F><U+064A> <U+0627><U+0648> <U+062E><U+0627><U+0646><U+062F><U+064A> <U+067E><U+0633><U+06D0> <U+06CC><U+0648> <U+0644><U+06CC><U+0648><U+0646><U+06CC> <U+0648><U+0631><U+062A><U+0647> <U+0631><U+069A><U+062A><U+06CC><U+0627> <U+0631><U+069A><U+062A><U+06CC><U+0627> <U+062E><U+0628><U+0631><U+06D0> <U+06A9><U+0648><U+064A> @AbdullahMalikJ @a_baittani @SherazMmd @MianIftikharHus @anp_mohmand @MisbahUtmani @takkar1234 @anp_mohmand
9 |  <U+0648> <U+0644><U+06CC><U+0648><U+0646><U+06CC> <U+0648><U+0631><U+062A><U+0647> <U+0631><U+069A><U+062A><U+06CC><U+0627> <U+0631><U+069A><U+062A><U+06CC><U+0627> <U+062E><U+0628><U+0631><U+06D0> <U+06A9><U+0648><U+064A> @AbdullahMalikJ @a_baittani @SherazMmd @MianIftikharHus @anp_mohmand @MisbahUtmani @takkar1234 @anp_mohmand @AmirHaiderKH @MianIftikharHus @khaistak50 @SangeenKhan ANP is history
10 |  @MianIftikharHus Pti ki govt bilkul bhi ideal nhi ti magar mazrat k sath anp or mma ki pechli govt se pti ki govt kafi behtr ti .hospitals or schools me tabdeeli ayi hy koi mane ya na mane.
11 |  <U+062A><U+06CC><U+0627> <U+0631><U+069A><U+062A><U+06CC><U+0627> <U+062E><U+0628><U+0631><U+06D0> <U+06A9><U+0648><U+064A> @AbdullahMalikJ @a_baittani @SherazMmd @MianIftikharHus @anp_mohmand @MisbahUtmani @takkar1234 @anp_mohmand @AmirHaiderKH @MianIftikharHus @khaistak50 @SangeenKhan ANP ki koi history nahi hai

测试设置为:

         included      |   text
    1 |   True          @a_siab @sardarbabak999 @BushraGohar @jafarshahmp @Palwasha_Abbas @Khadimhussain4 @Khushal_Khattak @SPOX_ANP @mjdawar @AsgharAchakzaii @AmirHaiderKH @MianIftikharHus @khaistak50 @SangeenKhan 
    2 |   True     |   @KPKUpdates @ImranKhanPTI @jhagra @Shah_FarmanPTI @AsadQaiserPTI @MushtaqGhaniPTI @PervezKhattakCM @ziataj @AtifKhanpti It's much better than anp and mma time
    3 |   True     |   Easy load was started by PTI and not ANP #KaptaanFailedInKP
    4 |   True     |    @Palwasha_Abbas @Gulalai_Ismail This was much needed and people are happy with using it which avoided traffic issues. Your only issue is PTI buried ANP easyload shops forever now it’s obvious you will cry
    5 |    False   |   @x_anp <U+304A><U+3081><U+3067><U+3068><U+3046>!!
    6 |    True    |   Tourism &amp; Poor Condition of Swat Roads, Part-2 #Swat #Tourism #Kpk #CareTakerPM #NasarullMuik #MaryamNawaz #PMLN #PTI #ImranKhan #Newsonepk #ANP #Nadia @nadia_a_mirza #Pakistan  
    7 |    False   |  @Palwasha_Abbas Kuch samjhayein in ko... Articles likhnay say character thek nhe hotay... ANP is history. @BushraGohar 
    8 |    True    |   <U+062F> <U+06A9><U+0644><U+064A> <U+0631><U+0648><U+063A> <U+062A><U+0631><U+06CC><U+0646><U+0647> <U+0686><U+0627><U+067E><U+06D0><U+0631><U+0647> <U+062F><U+064A> <U+0627><U+0648> <U+062E><U+0627><U+0646><U+062F><U+064A> <U+067E><U+0633><U+06D0> <U+06CC><U+0648> <U+0644><U+06CC><U+0648><U+0646><U+06CC> <U+0648><U+0631><U+062A><U+0647> <U+0631><U+069A><U+062A><U+06CC><U+0627> <U+0631><U+069A><U+062A><U+06CC><U+0627> <U+062E><U+0628><U+0631><U+06D0> <U+06A9><U+0648><U+064A> @AbdullahMalikJ @a_baittani @SherazMmd @MianIftikharHus @anp_mohmand @MisbahUtmani @takkar1234 @anp_mohmand
    9 |    True    |  <U+0648> <U+0644><U+06CC><U+0648><U+0646><U+06CC> <U+0648><U+0631><U+062A><U+0647> <U+0631><U+069A><U+062A><U+06CC><U+0627> <U+0631><U+069A><U+062A><U+06CC><U+0627> <U+062E><U+0628><U+0631><U+06D0> <U+06A9><U+0648><U+064A> @AbdullahMalikJ @a_baittani @SherazMmd @MianIftikharHus @anp_mohmand @MisbahUtmani @takkar1234 @anp_mohmand @AmirHaiderKH @MianIftikharHus @khaistak50 @SangeenKhan ANP is history
   10 |    False   |  @MianIftikharHus Pti ki govt bilkul bhi ideal nhi ti magar mazrat k sath anp or mma ki pechli govt se pti ki govt kafi behtr ti .hospitals or schools me tabdeeli ayi hy koi mane ya na mane.
   11 |    False   |   <U+062A><U+06CC><U+0627> <U+0631><U+069A><U+062A><U+06CC><U+0627> <U+062E><U+0628><U+0631><U+06D0> <U+06A9><U+0648><U+064A> @AbdullahMalikJ @a_baittani @SherazMmd @MianIftikharHus @anp_mohmand @MisbahUtmani @takkar1234 @anp_mohmand @AmirHaiderKH @MianIftikharHus @khaistak50 @SangeenKhan ANP ki koi history nahi hai

通过该测试集,我想获得训练后的数据集,其中应包括该df $ include。 这是训练有素的数据集。

        included  |   text
    1 |     NA     |    @a_siab @sardarbabak999 @BushraGohar @jafarshahmp @Palwasha_Abbas @Khadimhussain4 @Khushal_Khattak @SPOX_ANP @mjdawar @AsgharAchakzaii @AmirHaiderKH @MianIftikharHus @khaistak50 @SangeenKhan  
                        @khaistak50 @SangeenKhan
    2 |     NA     |    @KPKUpdates @ImranKhanPTI @jhagra @Shah_FarmanPTI @AsadQaiserPTI @MushtaqGhaniPTI @PervezKhattakCM @ziataj @AtifKhanpti It's much better than anp and mma time
    3 |     NA     |    Easy load was started by PTI and not ANP #KaptaanFailedInKP
    4 |     NA     |    @Palwasha_Abbas @Gulalai_Ismail This was much needed and people are happy with using it which avoided traffic issues. Your only issue is PTI buried ANP easyload shops forever now it’s obvious you will cry
    5 |     NA     |   @x_anp <U+304A><U+3081><U+3067><U+3068><U+3046>!!
    6 |     NA     |  Tourism &amp; Poor Condition of Swat Roads, Part-2 #Swat #Tourism #Kpk #CareTakerPM #NasarullMuik #MaryamNawaz #PMLN #PTI #ImranKhan #Newsonepk #ANP #Nadia @nadia_a_mirza #Pakistan 
    7 |     NA     |  @Palwasha_Abbas Kuch samjhayein in ko... Articles likhnay say character thek nhe hotay... ANP is history. @BushraGohar
    8 |     NA     |  <U+062F> <U+06A9><U+0644><U+064A> <U+0631><U+0648><U+063A> <U+062A><U+0631><U+06CC><U+0646><U+0647> <U+0686><U+0627><U+067E><U+06D0><U+0631><U+0647> <U+062F><U+064A> <U+0627><U+0648> <U+062E><U+0627><U+0646><U+062F><U+064A> <U+067E><U+0633><U+06D0> <U+06CC><U+0648> <U+0644><U+06CC><U+0648><U+0646><U+06CC> <U+0648><U+0631><U+062A><U+0647> <U+0631><U+069A><U+062A><U+06CC><U+0627> <U+0631><U+069A><U+062A><U+06CC><U+0627> <U+062E><U+0628><U+0631><U+06D0> <U+06A9><U+0648><U+064A> @AbdullahMalikJ @a_baittani @SherazMmd @MianIftikharHus @anp_mohmand @MisbahUtmani @takkar1234 @anp_mohmand
    9 |    NA     |  <U+0648> <U+0644><U+06CC><U+0648><U+0646><U+06CC> <U+0648><U+0631><U+062A><U+0647> <U+0631><U+069A><U+062A><U+06CC><U+0627> <U+0631><U+069A><U+062A><U+06CC><U+0627> <U+062E><U+0628><U+0631><U+06D0> <U+06A9><U+0648><U+064A> @AbdullahMalikJ @a_baittani @SherazMmd @MianIftikharHus @anp_mohmand @MisbahUtmani @takkar1234 @anp_mohmand @AmirHaiderKH @MianIftikharHus @khaistak50 @SangeenKhan ANP is history
    10 |    NA     | @MianIftikharHus Pti ki govt bilkul bhi ideal nhi ti magar mazrat k sath anp or mma ki pechli govt se pti ki govt kafi behtr ti .hospitals or schools me tabdeeli ayi hy koi mane ya na mane.
    11 |    NA     |  <U+062A><U+06CC><U+0627> <U+0631><U+069A><U+062A><U+06CC><U+0627> <U+062E><U+0628><U+0631><U+06D0> <U+06A9><U+0648><U+064A> @AbdullahMalikJ @a_baittani @SherazMmd @MianIftikharHus @anp_mohmand @MisbahUtmani @takkar1234 @anp_mohmand @AmirHaiderKH @MianIftikharHus @khaistak50 @SangeenKhan ANP ki koi history nahi hai

我应该如何完成所有这些工作?我有一个想法,可以通过分类器完成,但是不知道如何执行。 以及如何仅获取那些具有True值的推文并删除具有False值的推文? 感谢任何帮助!

0 个答案:

没有答案