不是奇怪,是需要選擇更優(yōu)秀更適合他們的人
出自兒歌《小雞出殼》
歌詞:
奇怪奇怪真奇怪真呀真奇怪
圓圓的蛋殼里長出小腦袋
可愛可愛真可愛
小雞呀一出殼
就嘰嘰嘰嘰唱起來
咦
奇怪奇怪真奇怪真呀真奇怪
圓圓的蛋殼里長出小腦袋
可愛可愛真可愛
小雞呀一出殼
就嘰嘰嘰嘰唱起來
咦 可愛可愛真可愛
小雞呀一出殼
就嘰嘰嘰嘰唱起來
咦...
小雞出殼 兒歌 奇怪奇怪真奇怪真呀真奇怪 圓圓的蛋殼里長出小腦袋 可愛可愛真可愛 小雞呀一出殼 就嘰嘰嘰嘰唱起來 咦 奇怪奇怪真奇怪真呀真奇怪 圓圓的蛋殼里長出小腦袋 可愛可愛真可愛 小雞呀一出殼 就嘰嘰嘰嘰唱起來 咦 可愛可愛真可愛 小雞呀一出殼 就嘰嘰嘰嘰唱起來 咦...
兩只老虎
兩只老虎跑的快
跑得快
一只沒有耳朵。
一直沒有尾巴。
真奇怪。
真奇怪。
兩只老虎跑得快。
一只沒有尾巴。
一只沒有耳朵。
最奇怪
最奇怪
兩只老虎。
兩只老虎。
跑得快
跑的快
一只沒有耳朵。
一只沒有尾巴
真奇怪
莫奇怪。
兩只老虎。
兩只老虎。
跑得快
跑得快
使用雨傘的目的是遮雨擋曬。只不過雨傘得形狀和顏色有很多種類。
奇怪奇怪,真呀真奇怪,圓圓的蛋殼里露出一個小腦袋呀喂,奇怪真奇怪呀,真奇怪,露出一個小腦袋呀喂。
可愛可愛,真呀真可愛,小雞一出殼,嘰嘰嘰嘰唱起來呀為,可愛真可愛呀,真可愛,嘰嘰嘰嘰唱起來呀喂
在中國廣袤的土地上,有許多壯麗而令人驚嘆的自然奇觀。其中,石林自然景區(qū)無疑是令人著迷的一個。這個位于中國云南的地方以其獨(dú)特的地質(zhì)景觀而聞名于世。這個奇怪而宏偉的景觀帶給人們無限的遐想和震撼。
石林是由幾千年的風(fēng)化和侵蝕所形成的地質(zhì)珍寶。它是砂巖和灰?guī)r的產(chǎn)物,經(jīng)過漫長的歲月,巖石逐漸侵蝕,形成了我所看到的懸崖峭壁和奇特的石柱。這些石柱高聳入云,有的形狀奇特,仿佛是大自然的雕塑。
石林的景觀極其神秘,每到此地,仿佛置身于一個完全不同的世界。奇形怪狀的石頭隨處可見,有的像是樹木,有的又像是人物。周圍的河流和瀑布增添了一份清新和靈性。
石林不僅吸引人的是其壯麗的景觀,還有其背后蘊(yùn)藏的美麗傳說。相傳,很久以前,在這片土地上曾經(jīng)住著一位美麗的姑娘。她擁有一顆善良純潔的心靈,樂于助人。然而,她的美貌引起了一位紅狐仙的妒忌。于是,狐仙便用魔法把姑娘變成了石頭。
姑娘化作的石頭成為了石林中最美麗的一塊。據(jù)說,當(dāng)人們靠近這塊石頭時,便能感受到姑娘的美麗與溫暖。這個傳說在當(dāng)?shù)厝酥袕V為流傳,每年都有許多人前來石林尋找這塊神奇的石頭,希望能得到姑娘的祝福。
石林作為中國的自然景區(qū),為游客提供了豐富多樣的游覽體驗。來到石林,你可以欣賞到自然的力量和創(chuàng)造力。步行在崎嶇的小徑上,仿佛進(jìn)入了一個迷宮般的世界。每處景點都充滿了獨(dú)特的美感和驚喜,尤其是那些形狀奇特的石頭。
石林還有許多傳統(tǒng)的活動和節(jié)日,吸引著來自世界各地的游客。你可以參加當(dāng)?shù)厝说膫鹘y(tǒng)舞蹈和音樂表演,品嘗到地道的云南美食。同時,你還有機(jī)會了解當(dāng)?shù)氐奈幕惋L(fēng)俗習(xí)慣,感受到獨(dú)特的人文氛圍。
石林奇怪的景觀也吸引著眾多的攝影師和藝術(shù)家。他們希望能夠捕捉到這些獨(dú)特而宏偉的景色,將其展現(xiàn)給整個世界。石林的景觀不僅令人嘆為觀止,還是創(chuàng)作和表現(xiàn)的靈感源泉。
作為一個獨(dú)特而美麗的自然景區(qū),保護(hù)石林變得尤為重要。隨著旅游業(yè)的興起,石林面臨著日益嚴(yán)重的環(huán)境壓力。游客的涌入可能會對石林的生態(tài)環(huán)境造成破壞,而過度的開發(fā)也有可能破壞這一獨(dú)特的地質(zhì)景觀。
因此,當(dāng)?shù)卣拖嚓P(guān)部門采取了一系列的保護(hù)措施。限制游客的人數(shù),控制開發(fā)的規(guī)模,并加強(qiáng)保護(hù)意識的教育。只有讓更多的人了解到石林的獨(dú)特價值,并愿意為其保護(hù)而努力,才能讓這個美麗的地方得以永久保留下去。
無論你是考古學(xué)愛好者,自然攝影師還是冒險家,石林奇怪的景觀都值得你來探索。在這個神奇的地方,你能夠感受到大自然的力量與魅力。放下繁忙的生活,融入到這個獨(dú)特的世界中去,你會發(fā)現(xiàn)一個全新的自己。
石林,帶給人們無盡的遐想和震撼,它是中國自然之美的見證。無論你是想尋找靈感,還是享受大自然的美妙,這個奇怪而宏偉的景觀都會給你帶來意想不到的驚喜。你準(zhǔn)備好探索這個美麗的地方了嗎?
之前看了Mahout官方示例 20news 的調(diào)用實現(xiàn);于是想根據(jù)示例的流程實現(xiàn)其他例子。網(wǎng)上看到了一個關(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的工具類實現(xiàn)分類。
基本思想:
1. 構(gòu)造分類數(shù)據(jù)。
2. 使用Mahout工具類進(jìn)行訓(xùn)練,得到訓(xùn)練模型。
3。將要檢測數(shù)據(jù)轉(zhuǎn)換成vector數(shù)據(jù)。
4. 分類器對vector數(shù)據(jù)進(jìn)行分類。
接下來貼下我的代碼實現(xiàn)=》
1. 構(gòu)造分類數(shù)據(jù):
在hdfs主要創(chuàng)建一個文件夾路徑 /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. 分類器對vector數(shù)據(jù)進(jìn)行分類。
這三步,代碼我就一次全貼出來;主要是兩個類 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)換成向量失??!");
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("文件序列化失?。?#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("檢測數(shù)據(jù)構(gòu)造成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());
}
}
1. 請介紹一下WebGIS的概念和作用,以及在實際應(yīng)用中的優(yōu)勢和挑戰(zhàn)。
WebGIS是一種基于Web技術(shù)的地理信息系統(tǒng),通過將地理數(shù)據(jù)和功能以可視化的方式呈現(xiàn)在Web瀏覽器中,實現(xiàn)地理空間數(shù)據(jù)的共享和分析。它可以用于地圖瀏覽、空間查詢、地理分析等多種應(yīng)用場景。WebGIS的優(yōu)勢包括易于訪問、跨平臺、實時更新、可定制性強(qiáng)等,但也面臨著數(shù)據(jù)安全性、性能優(yōu)化、用戶體驗等挑戰(zhàn)。
2. 請談?wù)勀赪ebGIS開發(fā)方面的經(jīng)驗和技能。
我在WebGIS開發(fā)方面有豐富的經(jīng)驗和技能。我熟悉常用的WebGIS開發(fā)框架和工具,如ArcGIS API for JavaScript、Leaflet、OpenLayers等。我能夠使用HTML、CSS和JavaScript等前端技術(shù)進(jìn)行地圖展示和交互設(shè)計,并能夠使用后端技術(shù)如Python、Java等進(jìn)行地理數(shù)據(jù)處理和分析。我還具備數(shù)據(jù)庫管理和地理空間數(shù)據(jù)建模的能力,能夠設(shè)計和優(yōu)化WebGIS系統(tǒng)的架構(gòu)。
3. 請描述一下您在以往項目中使用WebGIS解決的具體問題和取得的成果。
在以往的項目中,我使用WebGIS解決了許多具體問題并取得了顯著的成果。例如,在一次城市規(guī)劃項目中,我開發(fā)了一個基于WebGIS的交通流量分析系統(tǒng),幫助規(guī)劃師們評估不同交通方案的效果。另外,在一次環(huán)境監(jiān)測項目中,我使用WebGIS技術(shù)實現(xiàn)了實時的空氣質(zhì)量監(jiān)測和預(yù)警系統(tǒng),提供了準(zhǔn)確的空氣質(zhì)量數(shù)據(jù)和可視化的分析結(jié)果,幫助政府和公眾做出相應(yīng)的決策。
4. 請談?wù)勀鷮ebGIS未來發(fā)展的看法和期望。
我認(rèn)為WebGIS在未來會繼續(xù)發(fā)展壯大。隨著云計算、大數(shù)據(jù)和人工智能等技術(shù)的不斷進(jìn)步,WebGIS將能夠處理更大規(guī)模的地理數(shù)據(jù)、提供更豐富的地理分析功能,并與其他領(lǐng)域的技術(shù)進(jìn)行深度融合。我期望未來的WebGIS能夠更加智能化、個性化,為用戶提供更好的地理信息服務(wù),助力各行各業(yè)的決策和發(fā)展。
這塊您需要了解下stm32等單片機(jī)的基本編程和簡單的硬件設(shè)計,最好能夠了解模電和數(shù)電相關(guān)的知識更好,還有能夠會做操作系統(tǒng),簡單的有ucos,freeRTOS等等。最好能夠使用PCB畫圖軟件以及keil4等軟件。希望對您能夠有用。