Thoughtworks是一家創(chuàng)辦于1993年的全球性軟件及咨詢(xún)公司,致力于用科技驅(qū)動(dòng)商業(yè)變革,針對(duì)全球客戶(hù)數(shù)字化業(yè)務(wù)提供專(zhuān)業(yè)組織轉(zhuǎn)型咨詢(xún)、創(chuàng)新軟件交付、用戶(hù)體驗(yàn)設(shè)計(jì)、產(chǎn)品及一體化解決方案等服務(wù)。
客戶(hù)遍及全球汽車(chē)、金融保險(xiǎn)、醫(yī)療、旅游、運(yùn)輸、零售、電商、能源、公共事業(yè)等領(lǐng)域。在澳大利亞、中國(guó)、厄瓜多爾、德國(guó)、印度、意大利等17個(gè)國(guó)家設(shè)立48個(gè)辦公室,擁有超過(guò)9000名員工。
thoughtworks是一家創(chuàng)辦于1993年的全球性軟件及咨詢(xún)公司,致力于用科技驅(qū)動(dòng)商業(yè)變革,針對(duì)全球客戶(hù)數(shù)字化業(yè)務(wù)提供專(zhuān)業(yè)組織轉(zhuǎn)型咨詢(xún)、創(chuàng)新軟件交付、用戶(hù)體驗(yàn)設(shè)計(jì)、產(chǎn)品及一體化解決方案等服務(wù)。
客戶(hù)遍及全球汽車(chē)、金融保險(xiǎn)、醫(yī)療、旅游、運(yùn)輸、零售、電商、能源、公共事業(yè)等領(lǐng)域。在澳大利亞、中國(guó)、厄瓜多爾、德國(guó)、印度、意大利等17個(gè)國(guó)家設(shè)立48個(gè)辦公室,擁有超過(guò)9000名員工。
是
是的,思特沃克本質(zhì)上是外包公司。雖然思特沃克的自我定位是高級(jí)外包,但其本質(zhì)上就是外包公司。外包的本質(zhì)就是外包,而思特沃克則是外包公司。在思特沃克的工作中,員工需要接受公司提供的培訓(xùn)和指導(dǎo),但如果員工的能力不達(dá)標(biāo),則需要被拉入各種項(xiàng)目,這些項(xiàng)目可能涉及技術(shù)。
靠譜。
Thoughtworks是一家創(chuàng)辦于1993年的全球性軟件及咨詢(xún)公司,致力于用科技驅(qū)動(dòng)商業(yè)變革,針對(duì)全球客戶(hù)數(shù)字化業(yè)務(wù)提供專(zhuān)業(yè)組織轉(zhuǎn)型咨詢(xún)、創(chuàng)新軟件交付、用戶(hù)體驗(yàn)設(shè)計(jì)、產(chǎn)品及一體化解決方案等服務(wù)??蛻?hù)遍及全球汽車(chē)、金融保險(xiǎn)、醫(yī)療、旅游、運(yùn)輸、零售、電商、能源、公共事業(yè)等領(lǐng)域。
在澳大利亞、中國(guó)、厄瓜多爾、德國(guó)、印度、意大利等17個(gè)國(guó)家設(shè)立48個(gè)辦公室,擁有超過(guò)9000名員工。2004年進(jìn)入中國(guó),已在北京、西安、成都、上海、武漢、深圳及香港等地設(shè)立七個(gè)辦公室,擁有超過(guò)2000名員工。Thoughtworks的業(yè)務(wù)模式主要通過(guò)咨詢(xún)幫助改善企業(yè)的IT組織,改進(jìn)軟件開(kāi)發(fā)方法,以軟件帶動(dòng)企業(yè)業(yè)務(wù)發(fā)展。Thoughtworks為客戶(hù)提供集創(chuàng)意設(shè)計(jì)、開(kāi)發(fā)及交付為一體的定制服務(wù)。而且隨著企業(yè)知識(shí)處理能力發(fā)展需求不斷提升,知識(shí)流程外包(KPO)越來(lái)越成為被行業(yè)認(rèn)可的熱點(diǎn)模式,而Thoughtworks對(duì)于KPO的核心-戰(zhàn)略性的關(guān)鍵IT系統(tǒng)交付同樣經(jīng)驗(yàn)豐富。
工資待遇:¥30000-50000
崗位內(nèi)容:
1.研究并理解軟件工程領(lǐng)域技術(shù)趨勢(shì),挖掘并揭示客戶(hù)的痛點(diǎn)和訴求
2.對(duì)研發(fā)過(guò)程有深刻理解,具備一定高度抽象能力,摒棄細(xì)節(jié)探求本質(zhì)
3.熟悉不同類(lèi)型的研發(fā)體系,例如應(yīng)用系統(tǒng),移動(dòng)端開(kāi)發(fā),數(shù)據(jù)型項(xiàng)目等
4.能夠總結(jié)對(duì)應(yīng)的的工程優(yōu)秀實(shí)踐,結(jié)合工具提供完整的解決方案,幫助客戶(hù)進(jìn)行設(shè)計(jì)規(guī)劃和落地希望是:
1.對(duì)軟件設(shè)計(jì)和架構(gòu)有深刻的思考,如果有數(shù)據(jù)挖掘和分析或者統(tǒng)計(jì)學(xué)背景優(yōu)先。
2.開(kāi)放且樂(lè)于溝通和合作,強(qiáng)調(diào)團(tuán)隊(duì)協(xié)作3.良好的對(duì)內(nèi)對(duì)外溝通能力以及面對(duì)客戶(hù)的能力4接受一定比例的出差5英語(yǔ)具備讀寫(xiě)能力。
是外包公司。
thoutworks是一家專(zhuān)業(yè)的軟件外包公司,提供軟件開(kāi)發(fā)、測(cè)試、維護(hù)等服務(wù)。
他們有專(zhuān)業(yè)的團(tuán)隊(duì)和豐富的項(xiàng)目經(jīng)驗(yàn),通過(guò)與客戶(hù)合作,為他們提供高質(zhì)量的解決方案和定制化的軟件開(kāi)發(fā)服務(wù)。
作為外包公司,thoutworks與客戶(hù)進(jìn)行合作,幫助客戶(hù)實(shí)現(xiàn)各種軟件開(kāi)發(fā)需求。
他們的專(zhuān)業(yè)團(tuán)隊(duì)可以根據(jù)客戶(hù)的要求進(jìn)行定制開(kāi)發(fā),同時(shí)也能提供軟件測(cè)試、項(xiàng)目迭代和維護(hù)等服務(wù)。
thoutworks的目標(biāo)是以高效、專(zhuān)業(yè)的方式滿(mǎn)足客戶(hù)的需求,幫助他們提高業(yè)務(wù)效率
和競(jìng)爭(zhēng)力。
Thoughtworks是?家創(chuàng)辦于1993年的全球性軟件及咨詢(xún)公司。追求技術(shù)卓越,致?于?科技驅(qū)動(dòng)商業(yè)變?,為世界創(chuàng)造?凡影響。針對(duì)全球頂尖客戶(hù)數(shù)字化業(yè)務(wù)提供專(zhuān)業(yè)組織轉(zhuǎn)型咨詢(xún)、創(chuàng)新軟件交付、?戶(hù)體驗(yàn)設(shè)計(jì)、產(chǎn)品及?體化解決?案等服務(wù)??蛻?hù)遍及全球汽?、?融保險(xiǎn)、醫(yī)療、旅游、運(yùn)輸、零售、電商、能源、公共事業(yè)等領(lǐng)域
thoughtworks是世界五百?gòu)?qiáng)企業(yè)。全球軟件設(shè)計(jì)與定制 企業(yè)ThoughtWorks是與谷歌齊名的IT企業(yè),目前在美國(guó)、英國(guó)、澳大利亞、加拿大、德國(guó)、印度、巴西、南非、中國(guó)等十個(gè)國(guó)家成立分公司,聘用超過(guò)2000位行業(yè)精英,員工招聘體系比谷歌更為嚴(yán)苛,主要服務(wù)英特爾、惠普等 企業(yè)。
先說(shuō)明下,這不是廣告,咱也沒(méi)廣告費(fèi),客觀(guān)說(shuō)點(diǎn)觀(guān)察到的優(yōu)勢(shì)。
在thoughtworks工作,能學(xué)到技術(shù)什么的就不多說(shuō)了,作為一家技術(shù)公司,技術(shù)是根本,來(lái)說(shuō)說(shuō)其他亮點(diǎn),尤其是在大多數(shù)普通公司學(xué)不到的。
在大多數(shù)公司,員工比較難找到施展自己才才華的舞臺(tái),在thoughtworks可以。tw鼓勵(lì)員工以多種形式樹(shù)立個(gè)人影響力,項(xiàng)目?jī)?nèi)部帶buddy,積累知識(shí)沉淀,團(tuán)隊(duì)內(nèi)部做各種分享活動(dòng),對(duì)外寫(xiě)書(shū),組織各種豐富的社區(qū)活動(dòng),甚至到各種大會(huì)上公開(kāi)演講,只要你有意愿,發(fā)揚(yáng)自己,發(fā)光發(fā)熱,公司都會(huì)給予各種支持。
大多數(shù)公司,技術(shù)人員都是螺絲釘,在thoughtworks不是。很多公司的技術(shù)團(tuán)隊(duì)是根據(jù)層級(jí)劃分,有部門(mén)墻,在tw的各種項(xiàng)目里,不論你是開(kāi)發(fā),還是設(shè)計(jì)師,還是ba,都可以從一開(kāi)始需求分析到產(chǎn)品開(kāi)發(fā)上線(xiàn)全程參與到各種分析和討論里去,打破層級(jí)和部門(mén)墻,在客戶(hù)現(xiàn)場(chǎng)和客戶(hù)團(tuán)隊(duì)的各種領(lǐng)導(dǎo)們一起開(kāi)會(huì)、討論需求是家常便飯。
大多數(shù)公司,人才培養(yǎng)十分薄弱,有的公司只希望員工產(chǎn)出,有的公司只有少數(shù)領(lǐng)導(dǎo)層或者混到高級(jí)別才有機(jī)會(huì)參與一些培訓(xùn)。在tw全年,全國(guó)各地office不知道發(fā)生過(guò)多少場(chǎng)培訓(xùn),而且培訓(xùn)內(nèi)容多種多樣,可以說(shuō)是發(fā)自肺腑的希望幫助每一個(gè)員工健康成長(zhǎng)。除此之外,tw的一項(xiàng)福利是每年提供幾千元的培訓(xùn)經(jīng)費(fèi),福利大家采購(gòu)書(shū)籍,學(xué)習(xí)和提升自己。業(yè)界各種大型conference也都會(huì)有人參加,并且把內(nèi)容帶回tw內(nèi)部,轉(zhuǎn)化為知識(shí)沉淀和分享。
先寫(xiě)到這吧,嘻嘻。
之前看了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("文件序列化失??!");
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)練模型失?。?#34;);
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());
}
}