簽約時間通常在體檢后的兩周內(nèi)完成。遼寧農(nóng)行體檢是簽約的一項必須條件,而體檢結果需要時間進行審核,審核通過后才能正式簽約。根據(jù)經(jīng)驗,體檢后通常需要一到兩周的時間進行審核,然后再開始簽約程序。如果等待時間過長,建議向遼寧農(nóng)行相關工作人員進行咨詢了解具體情況,并且可以提前準備好相關資料,以縮短簽約時間。
五年起存是3.85%,國有銀行都一樣
你好,喪葬補助金=統(tǒng)籌地區(qū)上年度職工月平均工資×6個月。
遼寧移動計算機類面試題
隨著信息技術的飛速發(fā)展,移動計算機類的工作崗位日益增多,對人才需求也越來越高。而作為應聘者,要想在眾多競爭者中脫穎而出,面試中的表現(xiàn)尤為重要。遼寧移動計算機類面試題就是應聘者們在求職過程中常會遇到的挑戰(zhàn)。在本文中,我們將會為大家介紹一些常見的遼寧移動計算機類面試題,并提供一些建議性的回答,希望能對正在求職的讀者有所幫助。
操作系統(tǒng)是計算機硬件和軟件的核心,理解操作系統(tǒng)的原理和功能是每個計算機專業(yè)人士的基本要求。在遼寧移動計算機類面試中,與操作系統(tǒng)相關的問題經(jīng)常會被提及。
請你簡要解釋操作系統(tǒng)是什么?
回答:操作系統(tǒng)是一種控制和管理計算機硬件與軟件資源的系統(tǒng)軟件。它通過提供用戶與計算機硬件之間的接口,協(xié)調(diào)各個程序之間的執(zhí)行,實現(xiàn)對計算機系統(tǒng)的高效管理和資源分配。
操作系統(tǒng)的主要功能有哪些?
回答:操作系統(tǒng)的主要功能包括進程管理、內(nèi)存管理、文件系統(tǒng)管理、設備管理和用戶界面等。進程管理負責程序的加載、執(zhí)行和調(diào)度;內(nèi)存管理負責內(nèi)存空間的分配和回收;文件系統(tǒng)管理負責文件的存儲和組織;設備管理負責對硬件設備進行控制和管理;用戶界面提供用戶與計算機系統(tǒng)之間的交互方式。
請你簡要介紹一下常見的操作系統(tǒng)類型。
回答:常見的操作系統(tǒng)類型包括Windows、Linux和iOS等。Windows是微軟開發(fā)的操作系統(tǒng),廣泛應用于個人電腦;Linux是一種開源操作系統(tǒng),具有高度的定制性和擴展性,被廣泛應用于服務器和嵌入式設備;iOS是蘋果公司開發(fā)的操作系統(tǒng),主要運行于iPhone、iPad和iPod等移動設備。
數(shù)據(jù)結構與算法是計算機科學的重要基礎,對于移動計算機類的求職者來說,掌握常見的數(shù)據(jù)結構和算法是必備的能力。
請你解釋一下什么是數(shù)據(jù)結構?
回答:數(shù)據(jù)結構是指一組數(shù)據(jù)元素及其之間的關系,它描述了數(shù)據(jù)元素的組織方式和操作規(guī)則。常見的數(shù)據(jù)結構包括數(shù)組、鏈表、棧、隊列、樹、圖等。
請你介紹一下常見的排序算法。
回答:常見的排序算法包括冒泡排序、插入排序、選擇排序、快速排序和歸并排序等。冒泡排序通過相鄰元素的比較和交換來實現(xiàn)排序;插入排序將數(shù)組分為已排序和未排序兩部分,逐個將未排序元素插入已排序部分;選擇排序每次從未排序部分中選擇最小的元素放到已排序部分的末尾;快速排序采用分治的思想,通過選取基準元素,將數(shù)組不斷劃分為小于基準和大于基準的兩部分;歸并排序采用分治的思想,將數(shù)組遞歸地劃分為小的子數(shù)組,然后合并子數(shù)組得到排序結果。
請你簡要解釋一下樹和圖的區(qū)別。
回答:樹和圖都是常見的非線性數(shù)據(jù)結構,樹是一種特殊的圖。樹是由節(jié)點和邊組成,每個節(jié)點可以有多個子節(jié)點,但只有一個父節(jié)點,而圖是由頂點和邊組成,頂點之間的連線可以是任意的。樹通常用于表示層次關系,如目錄結構,而圖則可以用于表示任意復雜的關系,如社交網(wǎng)絡。
遼寧移動計算機類面試題涵蓋了許多專業(yè)知識和技能,掌握這些知識和技能對于求職者來說至關重要。希望本文提供的遼寧移動計算機類面試題及回答能夠對正在求職的讀者有所幫助。在面試過程中,一定要保持自信、清晰地表達思路,并結合個人經(jīng)驗和實際項目進行回答。祝愿大家都能順利通過遼寧移動計算機類的面試,取得理想的工作!
農(nóng)業(yè)銀行面試后14-30天左右的時間通知體檢,體檢項目一般包括內(nèi)科、外科、血常規(guī)、尿常規(guī)、胸片、腹部彩超、耳鼻喉、腎功能和肝功能等,農(nóng)業(yè)銀行體檢項目及標準參照的是公務員的標準。
目前還沒有明確的信息證明遼寧農(nóng)行招聘簽約是一次性發(fā)放的。
1,雖然一些銀行在招聘時采取批量簽約的方式,但是是否一次發(fā)完需要看具體招聘條件和招聘規(guī)模。
2,遼寧農(nóng)行是否采取一次性發(fā)放的方式需要參考當?shù)卣衅腹婊蛘咦稍兿嚓P人員。
3,但是一般來說,銀行在簽訂勞動合同時都會按照約定的時間逐一發(fā)放給簽約者,因此不是一次性發(fā)放的情況更為普遍。
隨著科技的進步和互聯(lián)網(wǎng)的普及,人們?nèi)粘I钪械慕鹑诮灰滓仓饾u實現(xiàn)了線上操作,其中轉賬就是一項非常常見的金融操作。然而,不同銀行之間的轉賬速度卻有所不同。今天我們來探討一下農(nóng)業(yè)銀行轉農(nóng)業(yè)銀行的轉賬到賬時間以及一些注意事項。
農(nóng)業(yè)銀行,作為我國重要的商業(yè)銀行之一,服務了廣大農(nóng)民和城市居民多年。很多人經(jīng)常會有跨行轉賬的需求,而對于農(nóng)行轉農(nóng)行的到賬時間,很多人都頗有些疑惑。
首先,我們需要明確一點,農(nóng)行轉農(nóng)行的到賬時間受到多種因素的影響,包括但不限于以下幾個方面:
農(nóng)行提供了多種轉賬方式,包括柜面轉賬、網(wǎng)銀轉賬、手機銀行轉賬等。不同的轉賬方式對到賬時間有一定的影響。一般來說,通過柜面轉賬的到賬時間較長,可能需要1-2個工作日;而通過網(wǎng)銀轉賬或手機銀行轉賬,則更加便捷,一般情況下當天即可到賬。
轉賬金額也是影響到賬時間的重要因素之一。較小的金額往往能夠更快地到賬,而較大的金額可能需要更長的時間進行核實和處理。這是因為較大金額的轉賬涉及到風險控制和合規(guī)性審核,需要更多的時間來確保資金安全。
農(nóng)行轉農(nóng)行的到賬時間還與轉賬時間有關。如果您在工作日的工作時間內(nèi)進行轉賬,一般來說到賬會相對較快,可能在同一天或者第二個工作日就能到賬。但如果您在節(jié)假日或非工作時間進行轉賬,那可能需要更長的時間來完成處理。
需要注意的是,以上所提到的轉賬時間只是一般情況下的估計,實際到賬時間還可能受到其他因素的影響,如網(wǎng)絡延遲、節(jié)假日等。如果轉賬時間較長或有其他問題,建議您及時聯(lián)系農(nóng)行客服查詢。
對于大部分轉賬需求來說,農(nóng)行轉農(nóng)行的到賬時間還是相對較短的。農(nóng)業(yè)銀行作為我國的大型銀行之一,擁有完善的網(wǎng)絡系統(tǒng)和專業(yè)的處理團隊,能夠提供快速、安全的轉賬服務。
總而言之,農(nóng)業(yè)銀行轉農(nóng)業(yè)銀行的到賬時間是根據(jù)轉賬方式、轉賬金額和轉賬時間等因素綜合決定的。一般情況下,通過網(wǎng)銀轉賬或手機銀行轉賬的到賬時間較快,可能當天就能到賬。但如果通過柜面轉賬或金額較大的轉賬,則可能需要1-2個工作日的時間。
無論是農(nóng)業(yè)銀行轉農(nóng)業(yè)銀行還是其他銀行之間的轉賬,作為用戶我們都需要提前做好規(guī)劃和安排,選擇合適的轉賬方式,并留出足夠的時間來處理可能出現(xiàn)的延遲。
希望以上對于農(nóng)行轉農(nóng)行到賬時間的解答能夠幫助到您,祝您使用農(nóng)業(yè)銀行的轉賬服務順利愉快!
農(nóng)行對農(nóng)行轉賬多久到賬
農(nóng)行作為國內(nèi)最大的商業(yè)銀行之一,在轉賬業(yè)務方面一直備受用戶關注。尤其是在農(nóng)行對農(nóng)行轉賬到賬時間上,許多用戶關心的問題就是,轉賬多久能夠到賬?在本文中,我們將詳細解答農(nóng)行對農(nóng)行轉賬的到賬時間問題。
1. 農(nóng)行對農(nóng)行轉賬是什么?
農(nóng)行對農(nóng)行轉賬是指在中國農(nóng)業(yè)銀行賬戶之間進行轉賬的操作。這種轉賬方式非常方便,因為農(nóng)行用戶可以通過不同的渠道進行操作,例如柜面、ATM、手機銀行和網(wǎng)銀等。無論是個人用戶還是企業(yè)用戶,都可以選擇這種轉賬方式來完成資金的劃轉。
2. 農(nóng)行對農(nóng)行轉賬的到賬時間
農(nóng)行對農(nóng)行轉賬的到賬時間主要受到以下幾個因素的影響:
在一般情況下,小額轉賬(例如5000元以下)的到賬時間通常較快,一般可以在當日或者最多1個工作日內(nèi)到賬。而大額轉賬(例如5000元以上)的到賬時間會相對較長,可能需要2個工作日或更久的時間才能到賬。
此外,不同的轉賬方式也會對到賬時間產(chǎn)生影響。例如通過柜面辦理的轉賬可能相對較慢,而通過手機銀行或網(wǎng)銀進行操作的轉賬能夠更快到賬。
還有一個重要的因素是轉賬時間。如果您在農(nóng)行規(guī)定的轉賬時間內(nèi)進行操作,通常能夠保證較快的到賬時間。但如果您在非工作時間或者節(jié)假日進行轉賬,那么到賬時間可能會延遲。
最后,農(nóng)行系統(tǒng)的處理時間也是影響到賬時間的重要因素之一。因為銀行需要對轉賬訂單進行審核和處理,所以在高峰期可能會出現(xiàn)一定的延遲。如果您的轉賬與其他用戶較多的同時進行,那么到賬時間可能會稍有延遲。
3. 如何縮短農(nóng)行對農(nóng)行轉賬的到賬時間
如果您希望盡快收到農(nóng)行對農(nóng)行轉賬的款項,我們提供以下幾點建議:
4. 其他注意事項
在進行農(nóng)行對農(nóng)行轉賬時,我們還需要注意一些其他事項:
結論
農(nóng)行對農(nóng)行轉賬的到賬時間與轉賬金額、轉賬方式、轉賬時間和系統(tǒng)處理時間等因素相關。一般情況下,小額轉賬到賬時間較短,大額轉賬到賬時間較長。為了縮短到賬時間,可以選擇合適的轉賬方式,并盡量避開非工作時間和節(jié)假日。此外,注意避開高峰期和確認轉賬信息準確無誤也能夠提高到賬速度。
如果您在使用農(nóng)行對農(nóng)行轉賬過程中遇到問題,建議及時聯(lián)系農(nóng)行客服進行咨詢和解決。
結束了
農(nóng)業(yè)銀行是中國主要的綜合金融服務提供商之一致力于打造經(jīng)營特色鮮明、服務高效便捷、功能齊全、協(xié)同能力強、價值創(chuàng)造能力突出的世界級商業(yè)銀行集團。金融市場業(yè)務和資產(chǎn)管理業(yè)務,業(yè)務范圍還涵蓋投資銀行、基金管理、融資租賃、壽險領域。
之前看了Mahout官方示例 20news 的調(diào)用實現(xiàn);于是想根據(jù)示例的流程實現(xiàn)其他例子。網(wǎng)上看到了一個關于天氣適不適合打羽毛球的例子。
訓練數(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
檢測數(shù)據(jù):
sunny,hot,high,weak
結果:
Yes=》 0.007039
No=》 0.027418
于是使用Java代碼調(diào)用Mahout的工具類實現(xiàn)分類。
基本思想:
1. 構造分類數(shù)據(jù)。
2. 使用Mahout工具類進行訓練,得到訓練模型。
3。將要檢測數(shù)據(jù)轉換成vector數(shù)據(jù)。
4. 分類器對vector數(shù)據(jù)進行分類。
接下來貼下我的代碼實現(xiàn)=》
1. 構造分類數(shù)據(jù):
在hdfs主要創(chuàng)建一個文件夾路徑 /zhoujainfeng/playtennis/input 并將分類文件夾 no 和 yes 的數(shù)據(jù)傳到hdfs上面。
數(shù)據(jù)文件格式,如D1文件內(nèi)容: Sunny Hot High Weak
2. 使用Mahout工具類進行訓練,得到訓練模型。
3。將要檢測數(shù)據(jù)轉換成vector數(shù)據(jù)。
4. 分類器對vector數(shù)據(jù)進行分類。
這三步,代碼我就一次全貼出來;主要是兩個類 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";
/*
* 測試代碼
*/
public static void main(String[] args) {
//將訓練數(shù)據(jù)轉換成 vector數(shù)據(jù)
makeTrainVector();
//產(chǎn)生訓練模型
makeModel(false);
//測試檢測數(shù)據(jù)
BayesCheckData.printResult();
}
public static void makeCheckVector(){
//將測試數(shù)據(jù)轉換成序列化文件
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("文件序列化失?。?#34;);
System.exit(1);
}
//將序列化文件轉換成向量文件
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("序列化文件轉換成向量失?。?#34;);
System.out.println(2);
}
}
public static void makeTrainVector(){
//將測試數(shù)據(jù)轉換成序列化文件
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);
}
//將序列化文件轉換成向量文件
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("序列化文件轉換成向量失??!");
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("生成訓練模型失?。?#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("檢測數(shù)據(jù)構造成vectors初始化時報錯。。。。");
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ù)
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);
}
// 利用貝葉斯算法開始分類,并提取得分最好的分類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("檢測所屬類別是:"+getCheckResult());
}
}