孜孜不倦——孜孜:勤勉,不懈怠.指工作或?qū)W習(xí)勤奮不知疲倦.孜孜不輟——勤勉從事,努力專一,不肯停息.廢寢忘食——廢:停止.寢:睡覺.忘:忘記,食:吃飯.顧不得睡覺,忘記了吃飯.形容很刻苦,專心致志.宵衣旰食——宵:夜間;衣:穿衣;旰:天已晚.天不亮就穿起衣來,時(shí)間晚了才吃飯.形容為處理國事而辛勤地工作.勤學(xué)不輟——不間斷學(xué)習(xí),形容學(xué)習(xí)努力刻苦.不辭勞苦——辭:推托;勞苦:勞累辛苦.不逃避勞累辛苦.形容人不怕吃苦,毅力強(qiáng).專心致志——致:盡,極;志:意志.把心思全放在上面.形容一心一意,聚精會(huì)神.夜以繼日——晚上連著白天.形容加緊工作或?qū)W習(xí).業(yè)精于勤——業(yè):學(xué)業(yè);精:精通;于:在于;勤:勤奮.學(xué)業(yè)精深是由勤奮得來的.宵衣旰食——宵:夜間;衣:穿衣;旰:天已晚.天不亮就穿起衣來,時(shí)間晚了才吃飯.形容為處理國事而辛勤地工作.枵腹從公——枵腹:空腹,肚饑.指餓著肚子辦公家的事.形容一心為公.專心致志——致:盡,極;志:意志.把心思全放在上面.形容一心一意,聚精會(huì)神.兢兢業(yè)業(yè)——兢兢:形容小心謹(jǐn)慎;業(yè)業(yè):畏懼的樣子.形容做事謹(jǐn)慎、勤懇.夜以繼日——晚上連著白天.形容加緊工作或?qū)W習(xí).孳孳不息——孳孳:同“孜孜”,努力不懈的樣子.形容工作勤奮,努力不懈持之以恒——持:堅(jiān)持;恒:恒心.長久堅(jiān)持下去.
謝謝夸獎(jiǎng),還有很多不足,要更努力才行
1、她工作認(rèn)真,負(fù)責(zé);工作認(rèn)真負(fù)責(zé),愛崗敬業(yè),服從整體安排,形象良好;對(duì)本職工作兢兢業(yè)業(yè),銳意進(jìn)取,樂于助人,關(guān)心同仁,與同仁相處融洽,善于合作,起帶頭作用。
2、該同仁今年工作成績進(jìn)步大,工作認(rèn)真,業(yè)務(wù)知識(shí)扎實(shí),業(yè)績發(fā)展迅速,工作態(tài)度端正,遵守公司規(guī)章制度,能積極完成公司的任務(wù)。
寶劍鋒從磨礪出,梅花香自苦寒來。
踏踏實(shí)實(shí)做事,堂堂正正做人。
天道酬勤?。勵(lì)精圖治,自強(qiáng)不息。
勤奮是成功之本。一分耕耘? 一分收獲。
業(yè)精于勤荒于嬉?,行成于思?xì)в?隨?。
1、從來沒有白費(fèi)的努力,踏實(shí)也沒有成功的機(jī)會(huì),刻苦只要你認(rèn)真對(duì)待工作,工作總有一天,句子你的每一次努力都會(huì)是華麗的。
2.生活總是公平的,心態(tài)你未來的樣子,正能量藏在你現(xiàn)在的努力中。有計(jì)劃的生活真的會(huì)比稀里糊涂精彩一萬倍。每一個(gè)新的一天,文案請(qǐng)勇敢去嘗試,踏實(shí)拼命去追求。
踏實(shí)刻苦工作的句子 工作心態(tài)正能
3.和什么樣的人在一起,刻苦就會(huì)有什么樣的生活。與勤奮的人在一起,工作你不會(huì)懶惰;與積極的人在一起,句子你不會(huì)沮喪;與優(yōu)越的人在一起,心態(tài)你可以達(dá)到頂峰。
4.不是每個(gè)貝殼都有珍珠,正能量但是珍珠一定要出現(xiàn)在貝殼里,文案不是每個(gè)努力的人都會(huì)成功,踏實(shí)但是成功的人一定要努力!
為君聊賦今日詩,努力請(qǐng)從今日始
《今日詩》
明 · 文嘉
努力盡今夕,少年猶可夸
《守歲》
宋 · 蘇軾
勿為新婚念,努力事戎行
《新婚別》
唐 · 杜甫
他工作非常勤奮,每天都是第一個(gè)來工廠,然后最后一個(gè)走,非常積極上進(jìn)
愛國的句子大全
1、祖國在中是崇高美麗祖國像一顆閃耀的明珠屹立在世界東方。我為祖我為祖國祝福,您永遠(yuǎn)在我心中!
2、愛國首先要時(shí)刻維護(hù)祖國的尊嚴(yán),不是空口號(hào),而是要從自己的一點(diǎn)一滴做起。愛國不是排外,而是要睜眼觀世界。
3、青少年要為建設(shè)祖國,為中華崛起而努力。愛國要繼承中華民族優(yōu)秀傳統(tǒng),弘揚(yáng)中華文化。
4、歷朝歷代,許多仁人志士都具有強(qiáng)烈的憂國憂民思想,以國事為己任,前仆后繼,臨難不屈,保衛(wèi)祖國,關(guān)懷民生,這種可貴的精神,使中華民族歷經(jīng)劫難而不衰。熱愛祖國的山河,熱愛民族的歷史,關(guān)心祖國的命運(yùn),在危難之時(shí)英勇戰(zhàn)斗,為祖國捐軀,都是愛國主義的表現(xiàn)。
5、愛國,什么是愛國?愛國是用心說的,愛國又是一種崇高的感情。
6、在爬滿金文的鐘鼎之上,讀祖國童年的靈性;在布滿烽火的長城之上,讀祖國青春的豪放;在綴滿詩歌與科學(xué)的大地之上,讀祖國壯年的成熟……
7、給我自信的祖國,給我智慧與膽略的祖國。
8、唯有民族魂是值得寶貴的,唯有他發(fā)揚(yáng)起來,中國才有真進(jìn)步。
9、升旗儀式結(jié)束了,我深深感到祖國與我們貼得很近。我鼓足了勁頭,大步向教室跑去,又開始了一天新的“長征”……
10、五星紅旗是祖國的象征,不管風(fēng)云怎樣變幻,我們對(duì)祖國的眷戀矢志不移,如果對(duì)著千百種選擇,我們會(huì)毫不猶豫地?fù)淙四愕膽驯А?/p>
用你的風(fēng)雨之聲做語言,用你的自然之形做文字,以你的土地做膚色,以你的五岳做骨骼,選擇你的辛勞當(dāng)痛苦,選擇你的幸福當(dāng)快樂。國旗,我們永遠(yuǎn)的信念!
工作勤奮是人生成功的基石,也是實(shí)現(xiàn)夢想的關(guān)鍵。歷代名人學(xué)者都曾對(duì)此有過深刻的闡述和總結(jié),為我們提供了寶貴的人生智慧。讓我們一起來欣賞一些關(guān)于工作勤奮的名言警句,從中汲取前進(jìn)的動(dòng)力和力量。
勤奮是一種積極向上的工作態(tài)度和生活狀態(tài),是通往成功的必由之路。正如富蘭克林所說:"沒有什么可以代替勤奮,勤奮是成功的唯一保證。"勤奮工作不僅能提高工作效率,增加收入,還能培養(yǎng)良好的品德,增強(qiáng)自信心,實(shí)現(xiàn)人生價(jià)值。
著名企業(yè)家馬云曾說:"成功沒有捷徑,唯有勤奮工作才能實(shí)現(xiàn)夢想。"他強(qiáng)調(diào),只有通過不懈的努力和奮斗,才能在激烈的競爭中脫穎而出,獲得應(yīng)有的成就。
對(duì)于工作,我們應(yīng)該保持積極樂觀、主動(dòng)進(jìn)取的態(tài)度。愛因斯坦說過:"我沒有特殊的才能,我只是對(duì)工作充滿熱情而已。"這句話告訴我們,只要對(duì)工作充滿熱情,即使沒有特殊的天賦,也一樣能取得出色的成就。
同時(shí),我們還要保持恒心和毅力。正如羅斯福所說:"成功往往需要耐心和毅力,而不是天賦。"只有堅(jiān)持不懈地努力,即使遇到挫折和困難,也能最終戰(zhàn)勝它們,實(shí)現(xiàn)自己的目標(biāo)。
對(duì)于工作,我們不僅要付出辛勤的汗水,更要追求精益求精的境界。孔子說過:"知之者不如好之者,好之者不如樂之者。"這說明,我們不僅要熱愛自己的工作,更要樂在其中,將工作視為生活的一部分,從而獲得更大的成就感和幸福感。
同時(shí),我們還要保持謙遜的態(tài)度。正如牛頓所說:"如果我看得更遠(yuǎn),那是因?yàn)槲艺驹诰奕说募绨蛏稀?這說明,我們的成就離不開他人的幫助和支持,應(yīng)該保持謙遜的態(tài)度,虛心向他人學(xué)習(xí)。
總之,勤奮工作是通往成功的必由之路,是實(shí)現(xiàn)人生價(jià)值的關(guān)鍵所在。讓我們以這些名人的智慧為指引,以積極進(jìn)取、恒心毅力、精益求精的態(tài)度,在工作中不斷進(jìn)取,在人生中不斷成長。
感謝您閱讀這篇文章,希望這些名人的名言警句能為您的工作和生活帶來啟發(fā)和動(dòng)力,助
之前看了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
檢測數(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。將要檢測數(shù)據(jù)轉(zhuǎn)換成vector數(shù)據(jù)。
4. 分類器對(duì)vector數(shù)據(jù)進(jìn)行分類。
接下來貼下我的代碼實(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。將要檢測數(shù)據(jù)轉(zhuǎn)換成vector數(shù)據(jù)。
4. 分類器對(duì)vector數(shù)據(jù)進(jìn)行分類。
這三步,代碼我就一次全貼出來;主要是兩個(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";
/*
* 測試代碼
*/
public static void main(String[] args) {
//將訓(xùn)練數(shù)據(jù)轉(zhuǎn)換成 vector數(shù)據(jù)
makeTrainVector();
//產(chǎn)生訓(xùn)練模型
makeModel(false);
//測試檢測數(shù)據(jù)
BayesCheckData.printResult();
}
public static void makeCheckVector(){
//將測試數(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(){
//將測試數(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("檢測數(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);
}
// 利用貝葉斯算法開始分類,并提取得分最好的分類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());
}
}