国内精品久久久久_亚洲区手机在线中文无码播放_国内精品久久久久影院一蜜桃_日韩内射激情视频在线播放免费

      人保青島分公司屬于山東人保嗎?

      時(shí)間:2025-05-17 09:21 人氣:0 編輯:招聘街

      一、人保青島分公司屬于山東人保嗎?

      人保青島分公司不屬于山東人保,是直屬于人保集團(tuán)的一級(jí)分公司,與山東人保級(jí)別相當(dāng)

      二、山東達(dá)內(nèi)科技面試題

      山東達(dá)內(nèi)科技面試題

      在求職過(guò)程中,面試是一個(gè)非常關(guān)鍵的環(huán)節(jié)。無(wú)論是求職者還是招聘方,都希望通過(guò)面試了解對(duì)方的能力和潛力。而山東達(dá)內(nèi)科技作為一家領(lǐng)先的科技公司,在招聘過(guò)程中有一套獨(dú)特的面試題目。

      一、編程題

      作為科技公司的一員,編程能力是非常重要的。以下是山東達(dá)內(nèi)科技在面試中常常會(huì)提到的編程題目:

      1. 請(qǐng)編寫(xiě)一個(gè)函數(shù),輸入一個(gè)字符串,返回該字符串的逆序字符串。
      2. 請(qǐng)編寫(xiě)一個(gè)函數(shù),判斷一個(gè)整數(shù)是否為素?cái)?shù)。
      3. 請(qǐng)編寫(xiě)一個(gè)函數(shù),刪除一個(gè)字符串中的所有重復(fù)字符。

      二、技術(shù)問(wèn)題

      技術(shù)問(wèn)題是評(píng)估求職者對(duì)相關(guān)技術(shù)的掌握程度的重要環(huán)節(jié)。以下是山東達(dá)內(nèi)科技經(jīng)常會(huì)問(wèn)到的技術(shù)問(wèn)題:

      • 請(qǐng)?jiān)敿?xì)介紹一下面向?qū)ο缶幊痰母拍詈吞攸c(diǎn)。
      • 請(qǐng)解釋一下 RESTful API 的概念和原則。
      • 請(qǐng)問(wèn)什么是數(shù)據(jù)結(jié)構(gòu)?請(qǐng)列舉幾種常見(jiàn)的數(shù)據(jù)結(jié)構(gòu)。
      • 請(qǐng)談?wù)勀銓?duì)前端開(kāi)發(fā)的理解,以及你在前端開(kāi)發(fā)方面的經(jīng)驗(yàn)。

      三、項(xiàng)目經(jīng)驗(yàn)

      在招聘過(guò)程中,求職者的項(xiàng)目經(jīng)驗(yàn)是一個(gè)非常重要的評(píng)估因素。以下是山東達(dá)內(nèi)科技常常會(huì)詢問(wèn)的項(xiàng)目經(jīng)驗(yàn)相關(guān)問(wèn)題:

      • 請(qǐng)?jiān)敿?xì)介紹一下你在上一家公司的項(xiàng)目經(jīng)驗(yàn)。
      • 請(qǐng)列舉一些你在項(xiàng)目中遇到的挑戰(zhàn),并說(shuō)明你是如何解決的。
      • 請(qǐng)談?wù)勀銓?duì)敏捷開(kāi)發(fā)的理解,以及你在敏捷開(kāi)發(fā)方面的經(jīng)驗(yàn)。

      四、綜合能力

      除了編程能力和技術(shù)問(wèn)題,綜合能力也是一個(gè)不可忽視的因素。以下是山東達(dá)內(nèi)科技會(huì)測(cè)試的綜合能力:

      • 請(qǐng)描述一次你遇到的團(tuán)隊(duì)合作中的沖突,并說(shuō)明你是如何解決的。
      • 請(qǐng)談?wù)勀銓?duì)自我學(xué)習(xí)能力的看法,并舉例說(shuō)明你在過(guò)去如何通過(guò)自學(xué)獲得新知識(shí)。
      • 請(qǐng)說(shuō)明你對(duì)工作中的壓力處理的態(tài)度和方法。

      通過(guò)以上一系列的面試題目,山東達(dá)內(nèi)科技可以全面評(píng)估求職者的能力水平和適應(yīng)能力。對(duì)于求職者來(lái)說(shuō),面試也是一個(gè)展示自己的機(jī)會(huì),通過(guò)準(zhǔn)備和自信地回答這些問(wèn)題,提高獲得工作的機(jī)會(huì)。

      三、人保財(cái)險(xiǎn)山東分公司?

      連續(xù)四年,每月只有150?這種公司要它有何用,早點(diǎn)走吧!而且你可以收集證據(jù)告公司要求賠償?shù)?/p>

      四、山東人保車險(xiǎn)報(bào)價(jià)明細(xì)?

      一、2022人保車險(xiǎn)最新報(bào)價(jià)一覽

      1、交強(qiáng)險(xiǎn):第一年:5座950元,6-8座1100元第二年:5座855元,6-8座990元第三年:5座760元,6-8座880元第四年:5座665元,6-8座770元第五年:5座665元,6-8座770元以上保費(fèi),跟出險(xiǎn)、脫保、過(guò)戶有關(guān)系,其中任意一項(xiàng)改變了,那么保費(fèi)也會(huì)變。

      2、商業(yè)車險(xiǎn):新車上保險(xiǎn),選擇三者險(xiǎn)保額200萬(wàn)+車損險(xiǎn)17.5萬(wàn)+車上人員座位險(xiǎn)1萬(wàn)的情況下:第三者責(zé)任險(xiǎn):200萬(wàn)保額,價(jià)格是2721.7元車損險(xiǎn):175498. 6元保額,價(jià)格是2370. 7元車上人員責(zé)任險(xiǎn)(司機(jī)):1萬(wàn)保額,價(jià)格是21. 27元車上人員責(zé)任險(xiǎn)(乘客):1萬(wàn)*4保額,價(jià)格是53. 99元

      五、山東人保車險(xiǎn)查詢系統(tǒng)?

      登錄人保的app或者登錄人保小程序

      六、山東省殘疾人保障條例?

      (一)對(duì)貧困重度殘疾人,按照有關(guān)規(guī)定發(fā)放生活補(bǔ)貼;

      (二)對(duì)符合條件的殘疾人,給予城鄉(xiāng)最低生活保障或者供養(yǎng);

      (三)對(duì)符合享受最低生活保障待遇的重度殘疾人、一戶有兩個(gè)以上殘疾人和有老年殘疾人的家庭,適當(dāng)提高最低生活保障金的補(bǔ)助標(biāo)準(zhǔn);對(duì)依靠父母或者兄弟姐妹扶養(yǎng)的無(wú)生活自理能力和固定收入的成年殘疾人應(yīng)當(dāng)按照有關(guān)規(guī)定給予最低生活保障待遇;

      (四)對(duì)民政部門(mén)核定為低收入、最低生活保障邊緣戶的殘疾人家庭,或者享受最低生活保障待遇后生活仍有困難的殘疾人家庭,按照有關(guān)規(guī)定給予臨時(shí)性救助;

      (五)在農(nóng)村危房改造中,優(yōu)先改造住房困難的貧困殘疾人家庭房屋;對(duì)符合村鎮(zhèn)規(guī)劃和宅基地申請(qǐng)條件的農(nóng)村殘疾人給予優(yōu)先照顧;

      (六)對(duì)符合條件的城市低收入殘疾人家庭,優(yōu)先納入城市廉租住房或者經(jīng)濟(jì)適用住房保障范圍,按照規(guī)定提供租房補(bǔ)貼、實(shí)物配租或者減免租金,并在樓層分配中給予照顧;

      (七)征收殘疾人房屋的,征收人應(yīng)當(dāng)為殘疾人提供便利,在調(diào)換、回遷房屋的地點(diǎn)、樓層、相關(guān)補(bǔ)償?shù)确矫娼o予照顧;

      (八)對(duì)其他困難殘疾人,按照有關(guān)規(guī)定落實(shí)幫扶措施。

      七、山東人保車輛違章查詢準(zhǔn)確嗎?

      山東人保車輛違章查詢是準(zhǔn)確的,是根據(jù)山東交通官網(wǎng)一起更新的,只會(huì)延遲,但不會(huì)有錯(cuò)誤。

      八、面試題為什么選擇加入人保財(cái)險(xiǎn)的營(yíng)銷隊(duì)伍?

      我以前在平安工作過(guò),希望給您的建議您能得到。

      第一,講人保的各種好處,世界500強(qiáng)企業(yè),是國(guó)企等等對(duì)人保公司的各種崇拜。第二,講自己的企圖心,職業(yè)規(guī)劃,尤其是對(duì)金錢(qián)的期望。第三,可以講講自己對(duì)保險(xiǎn)的理解,可以幫助到其他的人,做保險(xiǎn)其實(shí)就是在做慈善!

      九、山東人保財(cái)險(xiǎn)有哪個(gè)保險(xiǎn)公司

      山東人保財(cái)險(xiǎn)是山東省人民保險(xiǎn)集團(tuán)公司旗下的一家保險(xiǎn)公司。作為山東省最大的財(cái)產(chǎn)保險(xiǎn)公司之一,山東人保財(cái)險(xiǎn)在保險(xiǎn)行業(yè)擁有著領(lǐng)先的地位和豐富的經(jīng)驗(yàn)。

      山東人保財(cái)險(xiǎn)的成立可以追溯到2001年,公司總部位于山東省濟(jì)南市。多年來(lái),公司積極推行創(chuàng)新發(fā)展戰(zhàn)略,為廣大客戶提供多樣化的保險(xiǎn)產(chǎn)品和優(yōu)質(zhì)的服務(wù)。不論是個(gè)人客戶還是企業(yè)客戶,山東人保財(cái)險(xiǎn)都能為他們量身定制最適合的保險(xiǎn)解決方案。

      山東人保財(cái)險(xiǎn)的保險(xiǎn)產(chǎn)品

      山東人保財(cái)險(xiǎn)的保險(xiǎn)產(chǎn)品涵蓋了車險(xiǎn)、住宅保險(xiǎn)、商業(yè)保險(xiǎn)、責(zé)任保險(xiǎn)等多個(gè)領(lǐng)域。以下是該公司的幾個(gè)主要保險(xiǎn)產(chǎn)品:

      • 車險(xiǎn):山東人保財(cái)險(xiǎn)的車險(xiǎn)產(chǎn)品包括交強(qiáng)險(xiǎn)、商業(yè)車險(xiǎn)和車險(xiǎn)擴(kuò)展險(xiǎn)。無(wú)論是平安出行還是遠(yuǎn)行旅游,山東人保財(cái)險(xiǎn)都能為您提供全方位的車輛保障。
      • 住宅保險(xiǎn):該公司的住宅保險(xiǎn)產(chǎn)品包括房屋綜合保險(xiǎn)、家財(cái)綜合保險(xiǎn)等,能夠?yàn)槟姆课菁捌鋬?nèi)部財(cái)產(chǎn)提供全面的保護(hù)。
      • 商業(yè)保險(xiǎn):無(wú)論您是經(jīng)營(yíng)小店還是大型企業(yè),山東人保財(cái)險(xiǎn)的商業(yè)保險(xiǎn)產(chǎn)品都能為您量身打造最合適的保險(xiǎn)方案。
      • 責(zé)任保險(xiǎn):山東人保財(cái)險(xiǎn)的責(zé)任保險(xiǎn)產(chǎn)品包括雇主責(zé)任險(xiǎn)、公眾責(zé)任險(xiǎn)、產(chǎn)品責(zé)任險(xiǎn)等,為個(gè)人和企業(yè)提供全面的責(zé)任保障。

      山東人保財(cái)險(xiǎn)的服務(wù)優(yōu)勢(shì)

      作為一家專業(yè)的保險(xiǎn)公司,山東人保財(cái)險(xiǎn)注重提供優(yōu)質(zhì)的服務(wù)。以下是該公司的服務(wù)優(yōu)勢(shì):

      • 專業(yè)團(tuán)隊(duì):山東人保財(cái)險(xiǎn)擁有一支專業(yè)的團(tuán)隊(duì),包括領(lǐng)域?qū)<液透咚刭|(zhì)員工。他們能夠?yàn)榭蛻籼峁I(yè)的保險(xiǎn)咨詢、理賠指導(dǎo)等服務(wù)。
      • 快捷高效:山東人保財(cái)險(xiǎn)致力于為客戶提供快捷高效的服務(wù)。無(wú)論是購(gòu)買(mǎi)保險(xiǎn)還是理賠,都能夠在最短的時(shí)間內(nèi)得到滿意的處理。
      • 全面保障:山東人保財(cái)險(xiǎn)的保險(xiǎn)產(chǎn)品具有全面保障的特點(diǎn)。無(wú)論是財(cái)產(chǎn)保險(xiǎn)還是責(zé)任保險(xiǎn),都能夠?yàn)榭蛻籼峁┤轿坏谋Wo(hù)。
      • 全國(guó)服務(wù)網(wǎng)點(diǎn):山東人保財(cái)險(xiǎn)在全國(guó)范圍內(nèi)建立了廣泛的服務(wù)網(wǎng)點(diǎn),無(wú)論您身處何地,都能夠享受到便捷的服務(wù)。

      選擇山東人保財(cái)險(xiǎn)的理由

      選擇山東人保財(cái)險(xiǎn)作為您的保險(xiǎn)合作伙伴有以下幾個(gè)理由:

      1. 信譽(yù)可靠:山東人保財(cái)險(xiǎn)作為山東省人民保險(xiǎn)集團(tuán)公司旗下的品牌,具有良好的信譽(yù)和聲譽(yù)。您可以放心選擇該公司作為您的保險(xiǎn)提供商。
      2. 豐富經(jīng)驗(yàn):山東人保財(cái)險(xiǎn)在保險(xiǎn)行業(yè)擁有多年的經(jīng)驗(yàn),對(duì)市場(chǎng)有著準(zhǔn)確的把握和獨(dú)到的見(jiàn)解,能夠?yàn)榭蛻籼峁I(yè)的保險(xiǎn)解決方案。
      3. 綜合保障:山東人保財(cái)險(xiǎn)的保險(xiǎn)產(chǎn)品涵蓋了多個(gè)領(lǐng)域,無(wú)論您的保險(xiǎn)需求是什么,該公司都能夠?yàn)槟峁┤娴谋U稀?/li>
      4. 優(yōu)質(zhì)服務(wù):山東人保財(cái)險(xiǎn)注重為客戶提供優(yōu)質(zhì)的服務(wù),無(wú)論是購(gòu)買(mǎi)保險(xiǎn)還是理賠,都能夠得到及時(shí)、專業(yè)的幫助。

      總的來(lái)說(shuō),山東人保財(cái)險(xiǎn)作為山東省最大的財(cái)產(chǎn)保險(xiǎn)公司之一,具有豐富的經(jīng)驗(yàn)和優(yōu)質(zhì)的服務(wù)。無(wú)論您是個(gè)人客戶還是企業(yè)客戶,山東人保財(cái)險(xiǎn)都能夠?yàn)槟峁M意的保險(xiǎn)解決方案。選擇山東人保財(cái)險(xiǎn),選擇更安心的保險(xiǎn)保障。

      十、mahout面試題?

      之前看了Mahout官方示例 20news 的調(diào)用實(shí)現(xiàn);于是想根據(jù)示例的流程實(shí)現(xiàn)其他例子。網(wǎng)上看到了一個(gè)關(guān)于天氣適不適合打羽毛球的例子。

      訓(xùn)練數(shù)據(jù):

      Day Outlook Temperature Humidity Wind PlayTennis

      D1 Sunny Hot High Weak No

      D2 Sunny Hot High Strong No

      D3 Overcast Hot High Weak Yes

      D4 Rain Mild High Weak Yes

      D5 Rain Cool Normal Weak Yes

      D6 Rain Cool Normal Strong No

      D7 Overcast Cool Normal Strong Yes

      D8 Sunny Mild High Weak No

      D9 Sunny Cool Normal Weak Yes

      D10 Rain Mild Normal Weak Yes

      D11 Sunny Mild Normal Strong Yes

      D12 Overcast Mild High Strong Yes

      D13 Overcast Hot Normal Weak Yes

      D14 Rain Mild High Strong No

      檢測(cè)數(shù)據(jù):

      sunny,hot,high,weak

      結(jié)果:

      Yes=》 0.007039

      No=》 0.027418

      于是使用Java代碼調(diào)用Mahout的工具類實(shí)現(xiàn)分類。

      基本思想:

      1. 構(gòu)造分類數(shù)據(jù)。

      2. 使用Mahout工具類進(jìn)行訓(xùn)練,得到訓(xùn)練模型。

      3。將要檢測(cè)數(shù)據(jù)轉(zhuǎn)換成vector數(shù)據(jù)。

      4. 分類器對(duì)vector數(shù)據(jù)進(jìn)行分類。

      接下來(lái)貼下我的代碼實(shí)現(xiàn)=》

      1. 構(gòu)造分類數(shù)據(jù):

      在hdfs主要?jiǎng)?chuàng)建一個(gè)文件夾路徑 /zhoujainfeng/playtennis/input 并將分類文件夾 no 和 yes 的數(shù)據(jù)傳到hdfs上面。

      數(shù)據(jù)文件格式,如D1文件內(nèi)容: Sunny Hot High Weak

      2. 使用Mahout工具類進(jìn)行訓(xùn)練,得到訓(xùn)練模型。

      3。將要檢測(cè)數(shù)據(jù)轉(zhuǎn)換成vector數(shù)據(jù)。

      4. 分類器對(duì)vector數(shù)據(jù)進(jìn)行分類。

      這三步,代碼我就一次全貼出來(lái);主要是兩個(gè)類 PlayTennis1 和 BayesCheckData = =》

      package myTesting.bayes;

      import org.apache.hadoop.conf.Configuration;

      import org.apache.hadoop.fs.FileSystem;

      import org.apache.hadoop.fs.Path;

      import org.apache.hadoop.util.ToolRunner;

      import org.apache.mahout.classifier.naivebayes.training.TrainNaiveBayesJob;

      import org.apache.mahout.text.SequenceFilesFromDirectory;

      import org.apache.mahout.vectorizer.SparseVectorsFromSequenceFiles;

      public class PlayTennis1 {

      private static final String WORK_DIR = "hdfs://192.168.9.72:9000/zhoujianfeng/playtennis";

      /*

      * 測(cè)試代碼

      */

      public static void main(String[] args) {

      //將訓(xùn)練數(shù)據(jù)轉(zhuǎn)換成 vector數(shù)據(jù)

      makeTrainVector();

      //產(chǎn)生訓(xùn)練模型

      makeModel(false);

      //測(cè)試檢測(cè)數(shù)據(jù)

      BayesCheckData.printResult();

      }

      public static void makeCheckVector(){

      //將測(cè)試數(shù)據(jù)轉(zhuǎn)換成序列化文件

      try {

      Configuration conf = new Configuration();

      conf.addResource(new Path("/usr/local/hadoop/conf/core-site.xml"));

      String input = WORK_DIR+Path.SEPARATOR+"testinput";

      String output = WORK_DIR+Path.SEPARATOR+"tennis-test-seq";

      Path in = new Path(input);

      Path out = new Path(output);

      FileSystem fs = FileSystem.get(conf);

      if(fs.exists(in)){

      if(fs.exists(out)){

      //boolean參數(shù)是,是否遞歸刪除的意思

      fs.delete(out, true);

      }

      SequenceFilesFromDirectory sffd = new SequenceFilesFromDirectory();

      String[] params = new String[]{"-i",input,"-o",output,"-ow"};

      ToolRunner.run(sffd, params);

      }

      } catch (Exception e) {

      // TODO Auto-generated catch block

      e.printStackTrace();

      System.out.println("文件序列化失敗!");

      System.exit(1);

      }

      //將序列化文件轉(zhuǎn)換成向量文件

      try {

      Configuration conf = new Configuration();

      conf.addResource(new Path("/usr/local/hadoop/conf/core-site.xml"));

      String input = WORK_DIR+Path.SEPARATOR+"tennis-test-seq";

      String output = WORK_DIR+Path.SEPARATOR+"tennis-test-vectors";

      Path in = new Path(input);

      Path out = new Path(output);

      FileSystem fs = FileSystem.get(conf);

      if(fs.exists(in)){

      if(fs.exists(out)){

      //boolean參數(shù)是,是否遞歸刪除的意思

      fs.delete(out, true);

      }

      SparseVectorsFromSequenceFiles svfsf = new SparseVectorsFromSequenceFiles();

      String[] params = new String[]{"-i",input,"-o",output,"-lnorm","-nv","-wt","tfidf"};

      ToolRunner.run(svfsf, params);

      }

      } catch (Exception e) {

      // TODO Auto-generated catch block

      e.printStackTrace();

      System.out.println("序列化文件轉(zhuǎn)換成向量失敗!");

      System.out.println(2);

      }

      }

      public static void makeTrainVector(){

      //將測(cè)試數(shù)據(jù)轉(zhuǎn)換成序列化文件

      try {

      Configuration conf = new Configuration();

      conf.addResource(new Path("/usr/local/hadoop/conf/core-site.xml"));

      String input = WORK_DIR+Path.SEPARATOR+"input";

      String output = WORK_DIR+Path.SEPARATOR+"tennis-seq";

      Path in = new Path(input);

      Path out = new Path(output);

      FileSystem fs = FileSystem.get(conf);

      if(fs.exists(in)){

      if(fs.exists(out)){

      //boolean參數(shù)是,是否遞歸刪除的意思

      fs.delete(out, true);

      }

      SequenceFilesFromDirectory sffd = new SequenceFilesFromDirectory();

      String[] params = new String[]{"-i",input,"-o",output,"-ow"};

      ToolRunner.run(sffd, params);

      }

      } catch (Exception e) {

      // TODO Auto-generated catch block

      e.printStackTrace();

      System.out.println("文件序列化失敗!");

      System.exit(1);

      }

      //將序列化文件轉(zhuǎn)換成向量文件

      try {

      Configuration conf = new Configuration();

      conf.addResource(new Path("/usr/local/hadoop/conf/core-site.xml"));

      String input = WORK_DIR+Path.SEPARATOR+"tennis-seq";

      String output = WORK_DIR+Path.SEPARATOR+"tennis-vectors";

      Path in = new Path(input);

      Path out = new Path(output);

      FileSystem fs = FileSystem.get(conf);

      if(fs.exists(in)){

      if(fs.exists(out)){

      //boolean參數(shù)是,是否遞歸刪除的意思

      fs.delete(out, true);

      }

      SparseVectorsFromSequenceFiles svfsf = new SparseVectorsFromSequenceFiles();

      String[] params = new String[]{"-i",input,"-o",output,"-lnorm","-nv","-wt","tfidf"};

      ToolRunner.run(svfsf, params);

      }

      } catch (Exception e) {

      // TODO Auto-generated catch block

      e.printStackTrace();

      System.out.println("序列化文件轉(zhuǎn)換成向量失敗!");

      System.out.println(2);

      }

      }

      public static void makeModel(boolean completelyNB){

      try {

      Configuration conf = new Configuration();

      conf.addResource(new Path("/usr/local/hadoop/conf/core-site.xml"));

      String input = WORK_DIR+Path.SEPARATOR+"tennis-vectors"+Path.SEPARATOR+"tfidf-vectors";

      String model = WORK_DIR+Path.SEPARATOR+"model";

      String labelindex = WORK_DIR+Path.SEPARATOR+"labelindex";

      Path in = new Path(input);

      Path out = new Path(model);

      Path label = new Path(labelindex);

      FileSystem fs = FileSystem.get(conf);

      if(fs.exists(in)){

      if(fs.exists(out)){

      //boolean參數(shù)是,是否遞歸刪除的意思

      fs.delete(out, true);

      }

      if(fs.exists(label)){

      //boolean參數(shù)是,是否遞歸刪除的意思

      fs.delete(label, true);

      }

      TrainNaiveBayesJob tnbj = new TrainNaiveBayesJob();

      String[] params =null;

      if(completelyNB){

      params = new String[]{"-i",input,"-el","-o",model,"-li",labelindex,"-ow","-c"};

      }else{

      params = new String[]{"-i",input,"-el","-o",model,"-li",labelindex,"-ow"};

      }

      ToolRunner.run(tnbj, params);

      }

      } catch (Exception e) {

      // TODO Auto-generated catch block

      e.printStackTrace();

      System.out.println("生成訓(xùn)練模型失敗!");

      System.exit(3);

      }

      }

      }

      package myTesting.bayes;

      import java.io.IOException;

      import java.util.HashMap;

      import java.util.Map;

      import org.apache.commons.lang.StringUtils;

      import org.apache.hadoop.conf.Configuration;

      import org.apache.hadoop.fs.Path;

      import org.apache.hadoop.fs.PathFilter;

      import org.apache.hadoop.io.IntWritable;

      import org.apache.hadoop.io.LongWritable;

      import org.apache.hadoop.io.Text;

      import org.apache.mahout.classifier.naivebayes.BayesUtils;

      import org.apache.mahout.classifier.naivebayes.NaiveBayesModel;

      import org.apache.mahout.classifier.naivebayes.StandardNaiveBayesClassifier;

      import org.apache.mahout.common.Pair;

      import org.apache.mahout.common.iterator.sequencefile.PathType;

      import org.apache.mahout.common.iterator.sequencefile.SequenceFileDirIterable;

      import org.apache.mahout.math.RandomAccessSparseVector;

      import org.apache.mahout.math.Vector;

      import org.apache.mahout.math.Vector.Element;

      import org.apache.mahout.vectorizer.TFIDF;

      import com.google.common.collect.ConcurrentHashMultiset;

      import com.google.common.collect.Multiset;

      public class BayesCheckData {

      private static StandardNaiveBayesClassifier classifier;

      private static Map<String, Integer> dictionary;

      private static Map<Integer, Long> documentFrequency;

      private static Map<Integer, String> labelIndex;

      public void init(Configuration conf){

      try {

      String modelPath = "/zhoujianfeng/playtennis/model";

      String dictionaryPath = "/zhoujianfeng/playtennis/tennis-vectors/dictionary.file-0";

      String documentFrequencyPath = "/zhoujianfeng/playtennis/tennis-vectors/df-count";

      String labelIndexPath = "/zhoujianfeng/playtennis/labelindex";

      dictionary = readDictionnary(conf, new Path(dictionaryPath));

      documentFrequency = readDocumentFrequency(conf, new Path(documentFrequencyPath));

      labelIndex = BayesUtils.readLabelIndex(conf, new Path(labelIndexPath));

      NaiveBayesModel model = NaiveBayesModel.materialize(new Path(modelPath), conf);

      classifier = new StandardNaiveBayesClassifier(model);

      } catch (IOException e) {

      // TODO Auto-generated catch block

      e.printStackTrace();

      System.out.println("檢測(cè)數(shù)據(jù)構(gòu)造成vectors初始化時(shí)報(bào)錯(cuò)。。。。");

      System.exit(4);

      }

      }

      /**

      * 加載字典文件,Key: TermValue; Value:TermID

      * @param conf

      * @param dictionnaryDir

      * @return

      */

      private static Map<String, Integer> readDictionnary(Configuration conf, Path dictionnaryDir) {

      Map<String, Integer> dictionnary = new HashMap<String, Integer>();

      PathFilter filter = new PathFilter() {

      @Override

      public boolean accept(Path path) {

      String name = path.getName();

      return name.startsWith("dictionary.file");

      }

      };

      for (Pair<Text, IntWritable> pair : new SequenceFileDirIterable<Text, IntWritable>(dictionnaryDir, PathType.LIST, filter, conf)) {

      dictionnary.put(pair.getFirst().toString(), pair.getSecond().get());

      }

      return dictionnary;

      }

      /**

      * 加載df-count目錄下TermDoc頻率文件,Key: TermID; Value:DocFreq

      * @param conf

      * @param dictionnaryDir

      * @return

      */

      private static Map<Integer, Long> readDocumentFrequency(Configuration conf, Path documentFrequencyDir) {

      Map<Integer, Long> documentFrequency = new HashMap<Integer, Long>();

      PathFilter filter = new PathFilter() {

      @Override

      public boolean accept(Path path) {

      return path.getName().startsWith("part-r");

      }

      };

      for (Pair<IntWritable, LongWritable> pair : new SequenceFileDirIterable<IntWritable, LongWritable>(documentFrequencyDir, PathType.LIST, filter, conf)) {

      documentFrequency.put(pair.getFirst().get(), pair.getSecond().get());

      }

      return documentFrequency;

      }

      public static String getCheckResult(){

      Configuration conf = new Configuration();

      conf.addResource(new Path("/usr/local/hadoop/conf/core-site.xml"));

      String classify = "NaN";

      BayesCheckData cdv = new BayesCheckData();

      cdv.init(conf);

      System.out.println("init done...............");

      Vector vector = new RandomAccessSparseVector(10000);

      TFIDF tfidf = new TFIDF();

      //sunny,hot,high,weak

      Multiset<String> words = ConcurrentHashMultiset.create();

      words.add("sunny",1);

      words.add("hot",1);

      words.add("high",1);

      words.add("weak",1);

      int documentCount = documentFrequency.get(-1).intValue(); // key=-1時(shí)表示總文檔數(shù)

      for (Multiset.Entry<String> entry : words.entrySet()) {

      String word = entry.getElement();

      int count = entry.getCount();

      Integer wordId = dictionary.get(word); // 需要從dictionary.file-0文件(tf-vector)下得到wordID,

      if (StringUtils.isEmpty(wordId.toString())){

      continue;

      }

      if (documentFrequency.get(wordId) == null){

      continue;

      }

      Long freq = documentFrequency.get(wordId);

      double tfIdfValue = tfidf.calculate(count, freq.intValue(), 1, documentCount);

      vector.setQuick(wordId, tfIdfValue);

      }

      // 利用貝葉斯算法開(kāi)始分類,并提取得分最好的分類label

      Vector resultVector = classifier.classifyFull(vector);

      double bestScore = -Double.MAX_VALUE;

      int bestCategoryId = -1;

      for(Element element: resultVector.all()) {

      int categoryId = element.index();

      double score = element.get();

      System.out.println("categoryId:"+categoryId+" score:"+score);

      if (score > bestScore) {

      bestScore = score;

      bestCategoryId = categoryId;

      }

      }

      classify = labelIndex.get(bestCategoryId)+"(categoryId="+bestCategoryId+")";

      return classify;

      }

      public static void printResult(){

      System.out.println("檢測(cè)所屬類別是:"+getCheckResult());

      }

      }

      相關(guān)資訊
      熱門(mén)頻道

      Copyright © 2024 招聘街 滇ICP備2024020316號(hào)-38

      国内精品久久久久_亚洲区手机在线中文无码播放_国内精品久久久久影院一蜜桃_日韩内射激情视频在线播放免费

        阿坝县| 金山区| 霞浦县| 凤凰县| 龙口市| 金溪县| 大余县| 荆州市| 咸丰县| 全椒县| 汶上县| 康马县| 靖西县| 昌黎县| 玉田县| 西乌| 报价| 宁波市| 和龙市| 庆城县| 彭水| 毕节市| 富蕴县| 商河县| 方城县| 德安县| 大田县| 东源县| 永胜县| 青冈县| 祁门县| 哈尔滨市| 陇南市| 汶川县| 偃师市| 滨海县| 大足县| 平安县| 江川县| 宣武区| 界首市|