北京市公安局部分單位因工作需要
搬遷至新的辦公地點(diǎn)
具體如下
石景山分局戶(hù)政辦公大廳
搬遷至石景山區(qū)政務(wù)服務(wù)中心
二、辦公地址:
石景山區(qū)實(shí)興大街30號(hào)院17號(hào)樓1層政務(wù)服務(wù)
三、辦公時(shí)間:
工作日:9:00-12:00 14:00-17:00
四、交通方式:
(一)地鐵路線(xiàn):
1、六號(hào)線(xiàn)楊莊站 步行至 蘋(píng)果園北站(663或958路)至西井路 公交站,下車(chē)步行474米
2、六號(hào)線(xiàn)楊莊站 步行至 蘋(píng)果園小區(qū) 公交站,乘坐972路,至西井路 公交站,下車(chē)步行474米
3、六號(hào)線(xiàn)楊莊站 步行至 蘋(píng)果園東 公交站,乘坐932路 至西黃村北站 公交站,下車(chē)步行732米
(二)公交路線(xiàn):
1、399路(外環(huán))實(shí)興大街 公交站 步行174米
2、663或958路 西井路 公交站,下車(chē)步行474米
3、318路 西黃村北站 公交站,下車(chē)步行732米
咨詢(xún)電話(huà):010-88788336
作為求職者,參加面試是我們找工作過(guò)程中最重要的一環(huán)。面試是與用人單位接觸的第一次機(jī)會(huì),而且是展示個(gè)人能力和技能的最佳舞臺(tái)。對(duì)于計(jì)算機(jī)行業(yè)的求職者來(lái)說(shuō),參加北京開(kāi)科唯識(shí)的面試尤為重要。在本篇文章中,我們將深入解析北京開(kāi)科唯識(shí)面試中的一些常見(jiàn)面試題,希望能夠幫助大家更好地應(yīng)對(duì)面試的挑戰(zhàn)。
開(kāi)科唯識(shí)是一家北京知名的科技公司,專(zhuān)注于人工智能和機(jī)器學(xué)習(xí)領(lǐng)域的研發(fā)與應(yīng)用。該公司以其高效的團(tuán)隊(duì)和創(chuàng)新的技術(shù)聞名于業(yè)界。在面試中,被問(wèn)到這個(gè)問(wèn)題時(shí),我們應(yīng)該簡(jiǎn)要介紹開(kāi)科唯識(shí)的核心業(yè)務(wù)和技術(shù)特點(diǎn),并強(qiáng)調(diào)其在人工智能領(lǐng)域的領(lǐng)先地位。
在回答這個(gè)問(wèn)題時(shí),我們應(yīng)該突出自己在人工智能領(lǐng)域的實(shí)際項(xiàng)目經(jīng)驗(yàn)和相關(guān)的技術(shù)技能??梢灾v述自己針對(duì)某一具體問(wèn)題所設(shè)計(jì)的智能算法、深度學(xué)習(xí)模型或者應(yīng)用程序,并且重點(diǎn)強(qiáng)調(diào)這些經(jīng)驗(yàn)和技能如何與開(kāi)科唯識(shí)的需求相互匹配。
機(jī)器學(xué)習(xí)是人工智能的一個(gè)分支,它通過(guò)計(jì)算機(jī)對(duì)大量數(shù)據(jù)進(jìn)行分析和學(xué)習(xí),從而讓機(jī)器可以自主的進(jìn)行決策和預(yù)測(cè)。機(jī)器學(xué)習(xí)的核心在于構(gòu)建模型,通過(guò)對(duì)已有數(shù)據(jù)的學(xué)習(xí),實(shí)現(xiàn)對(duì)未知數(shù)據(jù)的預(yù)測(cè)。面試官可能會(huì)進(jìn)一步提問(wèn)機(jī)器學(xué)習(xí)的常見(jiàn)算法和技術(shù)應(yīng)用,所以我們需要對(duì)機(jī)器學(xué)習(xí)的基本原理和常見(jiàn)算法有一定的了解。
神經(jīng)網(wǎng)絡(luò)是一種模擬人腦神經(jīng)元網(wǎng)絡(luò)結(jié)構(gòu)的計(jì)算模型。它由大量的人工神經(jīng)元節(jié)點(diǎn)組成,并通過(guò)節(jié)點(diǎn)之間的連接和權(quán)重來(lái)模擬信息的傳遞和處理過(guò)程。神經(jīng)網(wǎng)絡(luò)可以通過(guò)對(duì)大量樣本的學(xué)習(xí),自動(dòng)提取特征并完成分類(lèi)、預(yù)測(cè)等任務(wù)。在解釋神經(jīng)網(wǎng)絡(luò)時(shí),我們可以舉一些實(shí)際應(yīng)用的例子,以便更好地展示自己的理解和應(yīng)用能力。
在面試中,面試官通常會(huì)關(guān)注我們?cè)趯?shí)際項(xiàng)目中遇到的挑戰(zhàn)和困難,以及我們是如何解決問(wèn)題的。我們可以從技術(shù)、團(tuán)隊(duì)協(xié)作和時(shí)間管理等方面,結(jié)合具體項(xiàng)目,詳細(xì)闡述遇到的問(wèn)題和解決方案。同時(shí),我們還需要強(qiáng)調(diào)自己的思考過(guò)程和創(chuàng)新能力,以展現(xiàn)出自己的優(yōu)勢(shì)。
在回答這個(gè)問(wèn)題時(shí),我們可以結(jié)合開(kāi)科唯識(shí)在人工智能領(lǐng)域的技術(shù)積累、團(tuán)隊(duì)實(shí)力和市場(chǎng)前景等方面,給出個(gè)人的觀點(diǎn)和評(píng)價(jià)??梢詮氖袌?chǎng)需求不斷增加、技術(shù)持續(xù)創(chuàng)新、公司潛力巨大等方面進(jìn)行評(píng)價(jià),以展現(xiàn)自己對(duì)開(kāi)科唯識(shí)的充分了解和專(zhuān)業(yè)見(jiàn)解。
在機(jī)器學(xué)習(xí)項(xiàng)目中,我們的工作職責(zé)可能包括數(shù)據(jù)清洗和預(yù)處理、特征工程、模型選擇和調(diào)優(yōu)等多個(gè)方面。面試官想要了解我們?cè)陧?xiàng)目中具體承擔(dān)的角色和工作內(nèi)容,所以我們需要詳細(xì)描述自己在每個(gè)階段所做的工作,并強(qiáng)調(diào)自己的貢獻(xiàn)和成果。
北京開(kāi)科唯識(shí)是一家在人工智能領(lǐng)域頗有影響力的公司,參加其面試是一次很好的機(jī)會(huì)。通過(guò)深入了解常見(jiàn)的面試題,我們可以更好地準(zhǔn)備自己,提高面試的成功率。在面試過(guò)程中,我們要保持自信、冷靜并清晰地表達(dá)自己的觀點(diǎn)。相信通過(guò)良好的準(zhǔn)備和積極的心態(tài),我們一定能夠在北京開(kāi)科唯識(shí)的面試中脫穎而出!
東奧志愿者的面試主要是包括奧運(yùn)的基本知識(shí),還有一些賽場(chǎng)李杰方面的知識(shí)的面試。
A:經(jīng)公安機(jī)關(guān)審批
一、離休、退休人員夫妻投靠進(jìn)京入非農(nóng)業(yè)戶(hù)口
(一)受理?xiàng)l件
1.干部男滿(mǎn)60周歲,女滿(mǎn)55周歲;
工人男滿(mǎn)55周歲,女滿(mǎn)50周歲;
2.特殊工種,男滿(mǎn)50周歲,女滿(mǎn)45周歲;
3.在外省市工作,且已達(dá)到離、退休年齡,并辦理了離、退休手續(xù);
4.隨遷子女應(yīng)系18周歲以下未成年子女,且符合本市計(jì)劃生育政策;系獨(dú)生子女的年齡不能超過(guò)25周歲,且未婚、未就業(yè)(獨(dú)生子女指原配夫妻婚后生育的子女)。
大家好,我是博客作者王小明。今天我為大家?guī)?lái)了關(guān)于北京環(huán)球影城官網(wǎng)面試題目的詳細(xì)介紹。
北京環(huán)球影城官網(wǎng)面試題目是指在申請(qǐng)北京環(huán)球影城官方網(wǎng)站工作崗位時(shí),面試官會(huì)提出的問(wèn)題。這些問(wèn)題旨在了解應(yīng)聘者的專(zhuān)業(yè)知識(shí)、工作經(jīng)驗(yàn)和解決問(wèn)題的能力。不同崗位的面試題目會(huì)有所不同,但都是為了評(píng)估應(yīng)聘者的能力和適應(yīng)性。
下面是一些常見(jiàn)的北京環(huán)球影城官網(wǎng)面試題目,供大家參考:
準(zhǔn)備北京環(huán)球影城官網(wǎng)面試題目非常重要,可以幫助應(yīng)聘者在面試中展現(xiàn)出優(yōu)秀的能力和素質(zhì)。以下是一些建議:
在北京環(huán)球影城官網(wǎng)的面試中,脫穎而出的關(guān)鍵在于展示出自己的獨(dú)特優(yōu)勢(shì)和能力。
以下是一些建議:
總之,準(zhǔn)備充分、展示自己的專(zhuān)業(yè)能力和積極態(tài)度,是成功應(yīng)對(duì)北京環(huán)球影城官網(wǎng)面試的關(guān)鍵。希望以上的建議對(duì)你有所幫助!祝你面試成功!
副科級(jí)。河北省公安廳廳長(zhǎng)和保定市市長(zhǎng)是正廳級(jí)(如果不兼任省委常委的話(huà))。北市區(qū)區(qū)長(zhǎng)和保定市公安局局長(zhǎng),是正處級(jí)。北市區(qū)公安局局長(zhǎng),是正科級(jí)。北市區(qū)公安局副科長(zhǎng),是副科級(jí)。
北京夫妻投靠落戶(hù)公安局要審核投靠人符不符合北京夫妻投靠的相關(guān)規(guī)定,各種條件都符合了才能投靠。
答:一般由主任科員擔(dān)任??崎L(zhǎng)屬正科級(jí)領(lǐng)導(dǎo),在公務(wù)員中泛指主任科員。
公安網(wǎng)分為內(nèi)網(wǎng)和外網(wǎng)。內(nèi)網(wǎng)只有公安機(jī)關(guān)工作人員可以瀏覽。
普通公民只能瀏覽公安部及其下屬公安局網(wǎng)站。如,公安部的官方網(wǎng)站為http://www.mps.gov.cn。在公安系統(tǒng)查詢(xún)個(gè)人信息:1,支付寶首頁(yè)打開(kāi)市民中心。2在市民中心辦事大廳里,選擇公安交管,然后點(diǎn)擊個(gè)人信息查詢(xún)。3仔細(xì)閱讀公安系統(tǒng)的查詢(xún)須知,然后點(diǎn)擊同意。4.輸入個(gè)人信息查詢(xún)的申請(qǐng)信息,點(diǎn)擊提交就可以了,結(jié)果會(huì)在幾個(gè)工作日內(nèi)發(fā)到你的郵箱。
之前看了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的工具類(lèi)實(shí)現(xiàn)分類(lèi)。
基本思想:
1. 構(gòu)造分類(lèi)數(shù)據(jù)。
2. 使用Mahout工具類(lèi)進(jìn)行訓(xùn)練,得到訓(xùn)練模型。
3。將要檢測(cè)數(shù)據(jù)轉(zhuǎn)換成vector數(shù)據(jù)。
4. 分類(lèi)器對(duì)vector數(shù)據(jù)進(jìn)行分類(lèi)。
接下來(lái)貼下我的代碼實(shí)現(xiàn)=》
1. 構(gòu)造分類(lèi)數(shù)據(jù):
在hdfs主要?jiǎng)?chuàng)建一個(gè)文件夾路徑 /zhoujainfeng/playtennis/input 并將分類(lèi)文件夾 no 和 yes 的數(shù)據(jù)傳到hdfs上面。
數(shù)據(jù)文件格式,如D1文件內(nèi)容: Sunny Hot High Weak
2. 使用Mahout工具類(lèi)進(jìn)行訓(xùn)練,得到訓(xùn)練模型。
3。將要檢測(cè)數(shù)據(jù)轉(zhuǎn)換成vector數(shù)據(jù)。
4. 分類(lèi)器對(duì)vector數(shù)據(jù)進(jìn)行分類(lèi)。
這三步,代碼我就一次全貼出來(lái);主要是兩個(gè)類(lèi) 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)換成向量失?。?#34;);
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("文件序列化失?。?#34;);
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)始分類(lèi),并提取得分最好的分類(lè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è)所屬類(lèi)別是:"+getCheckResult());
}
}