不是奇怪,是需要选择更优秀更适合他们的人
出自儿歌《小鸡出壳》
歌词:
奇怪奇怪真奇怪真呀真奇怪
圆圆的蛋壳里长出小脑袋
可爱可爱真可爱
小鸡呀一出壳
就叽叽叽叽唱起来
咦
奇怪奇怪真奇怪真呀真奇怪
圆圆的蛋壳里长出小脑袋
可爱可爱真可爱
小鸡呀一出壳
就叽叽叽叽唱起来
咦 可爱可爱真可爱
小鸡呀一出壳
就叽叽叽叽唱起来
咦...
小鸡出壳 儿歌 奇怪奇怪真奇怪真呀真奇怪 圆圆的蛋壳里长出小脑袋 可爱可爱真可爱 小鸡呀一出壳 就叽叽叽叽唱起来 咦 奇怪奇怪真奇怪真呀真奇怪 圆圆的蛋壳里长出小脑袋 可爱可爱真可爱 小鸡呀一出壳 就叽叽叽叽唱起来 咦 可爱可爱真可爱 小鸡呀一出壳 就叽叽叽叽唱起来 咦...
两只老虎
两只老虎跑的快
跑得快
一只没有耳朵。
一直没有尾巴。
真奇怪。
真奇怪。
两只老虎跑得快。
一只没有尾巴。
一只没有耳朵。
最奇怪
最奇怪
两只老虎。
两只老虎。
跑得快
跑的快
一只没有耳朵。
一只没有尾巴
真奇怪
莫奇怪。
两只老虎。
两只老虎。
跑得快
跑得快
使用雨伞的目的是遮雨挡晒。只不过雨伞得形状和颜色有很多种类。
奇怪奇怪,真呀真奇怪,圆圆的蛋壳里露出一个小脑袋呀喂,奇怪真奇怪呀,真奇怪,露出一个小脑袋呀喂。
可爱可爱,真呀真可爱,小鸡一出壳,叽叽叽叽唱起来呀为,可爱真可爱呀,真可爱,叽叽叽叽唱起来呀喂
在中国广袤的土地上,有许多壮丽而令人惊叹的自然奇观。其中,石林自然景区无疑是令人着迷的一个。这个位于中国云南的地方以其独特的地质景观而闻名于世。这个奇怪而宏伟的景观带给人们无限的遐想和震撼。
石林是由几千年的风化和侵蚀所形成的地质珍宝。它是砂岩和灰岩的产物,经过漫长的岁月,岩石逐渐侵蚀,形成了我所看到的悬崖峭壁和奇特的石柱。这些石柱高耸入云,有的形状奇特,仿佛是大自然的雕塑。
石林的景观极其神秘,每到此地,仿佛置身于一个完全不同的世界。奇形怪状的石头随处可见,有的像是树木,有的又像是人物。周围的河流和瀑布增添了一份清新和灵性。
石林不仅吸引人的是其壮丽的景观,还有其背后蕴藏的美丽传说。相传,很久以前,在这片土地上曾经住着一位美丽的姑娘。她拥有一颗善良纯洁的心灵,乐于助人。然而,她的美貌引起了一位红狐仙的妒忌。于是,狐仙便用魔法把姑娘变成了石头。
姑娘化作的石头成为了石林中最美丽的一块。据说,当人们靠近这块石头时,便能感受到姑娘的美丽与温暖。这个传说在当地人中广为流传,每年都有许多人前来石林寻找这块神奇的石头,希望能得到姑娘的祝福。
石林作为中国的自然景区,为游客提供了丰富多样的游览体验。来到石林,你可以欣赏到自然的力量和创造力。步行在崎岖的小径上,仿佛进入了一个迷宫般的世界。每处景点都充满了独特的美感和惊喜,尤其是那些形状奇特的石头。
石林还有许多传统的活动和节日,吸引着来自世界各地的游客。你可以参加当地人的传统舞蹈和音乐表演,品尝到地道的云南美食。同时,你还有机会了解当地的文化和风俗习惯,感受到独特的人文氛围。
石林奇怪的景观也吸引着众多的摄影师和艺术家。他们希望能够捕捉到这些独特而宏伟的景色,将其展现给整个世界。石林的景观不仅令人叹为观止,还是创作和表现的灵感源泉。
作为一个独特而美丽的自然景区,保护石林变得尤为重要。随着旅游业的兴起,石林面临着日益严重的环境压力。游客的涌入可能会对石林的生态环境造成破坏,而过度的开发也有可能破坏这一独特的地质景观。
因此,当地政府和相关部门采取了一系列的保护措施。限制游客的人数,控制开发的规模,并加强保护意识的教育。只有让更多的人了解到石林的独特价值,并愿意为其保护而努力,才能让这个美丽的地方得以永久保留下去。
无论你是考古学爱好者,自然摄影师还是冒险家,石林奇怪的景观都值得你来探索。在这个神奇的地方,你能够感受到大自然的力量与魅力。放下繁忙的生活,融入到这个独特的世界中去,你会发现一个全新的自己。
石林,带给人们无尽的遐想和震撼,它是中国自然之美的见证。无论你是想寻找灵感,还是享受大自然的美妙,这个奇怪而宏伟的景观都会给你带来意想不到的惊喜。你准备好探索这个美丽的地方了吗?
之前看了Mahout官方示例 20news 的调用实现;于是想根据示例的流程实现其他例子。网上看到了一个关于天气适不适合打羽毛球的例子。
训练数据:
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
检测数据:
sunny,hot,high,weak
结果:
Yes=》 0.007039
No=》 0.027418
于是使用Java代码调用Mahout的工具类实现分类。
基本思想:
1. 构造分类数据。
2. 使用Mahout工具类进行训练,得到训练模型。
3。将要检测数据转换成vector数据。
4. 分类器对vector数据进行分类。
接下来贴下我的代码实现=》
1. 构造分类数据:
在hdfs主要创建一个文件夹路径 /zhoujainfeng/playtennis/input 并将分类文件夹 no 和 yes 的数据传到hdfs上面。
数据文件格式,如D1文件内容: Sunny Hot High Weak
2. 使用Mahout工具类进行训练,得到训练模型。
3。将要检测数据转换成vector数据。
4. 分类器对vector数据进行分类。
这三步,代码我就一次全贴出来;主要是两个类 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) {
//将训练数据转换成 vector数据
makeTrainVector();
//产生训练模型
makeModel(false);
//测试检测数据
BayesCheckData.printResult();
}
public static void makeCheckVector(){
//将测试数据转换成序列化文件
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参数是,是否递归删除的意思
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-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参数是,是否递归删除的意思
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 makeTrainVector(){
//将测试数据转换成序列化文件
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参数是,是否递归删除的意思
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参数是,是否递归删除的意思
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参数是,是否递归删除的意思
fs.delete(out, true);
}
if(fs.exists(label)){
//boolean参数是,是否递归删除的意思
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("生成训练模型失败!");
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("检测数据构造成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时表示总文档数
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的概念和作用,以及在实际应用中的优势和挑战。
WebGIS是一种基于Web技术的地理信息系统,通过将地理数据和功能以可视化的方式呈现在Web浏览器中,实现地理空间数据的共享和分析。它可以用于地图浏览、空间查询、地理分析等多种应用场景。WebGIS的优势包括易于访问、跨平台、实时更新、可定制性强等,但也面临着数据安全性、性能优化、用户体验等挑战。
2. 请谈谈您在WebGIS开发方面的经验和技能。
我在WebGIS开发方面有丰富的经验和技能。我熟悉常用的WebGIS开发框架和工具,如ArcGIS API for JavaScript、Leaflet、OpenLayers等。我能够使用HTML、CSS和JavaScript等前端技术进行地图展示和交互设计,并能够使用后端技术如Python、Java等进行地理数据处理和分析。我还具备数据库管理和地理空间数据建模的能力,能够设计和优化WebGIS系统的架构。
3. 请描述一下您在以往项目中使用WebGIS解决的具体问题和取得的成果。
在以往的项目中,我使用WebGIS解决了许多具体问题并取得了显著的成果。例如,在一次城市规划项目中,我开发了一个基于WebGIS的交通流量分析系统,帮助规划师们评估不同交通方案的效果。另外,在一次环境监测项目中,我使用WebGIS技术实现了实时的空气质量监测和预警系统,提供了准确的空气质量数据和可视化的分析结果,帮助政府和公众做出相应的决策。
4. 请谈谈您对WebGIS未来发展的看法和期望。
我认为WebGIS在未来会继续发展壮大。随着云计算、大数据和人工智能等技术的不断进步,WebGIS将能够处理更大规模的地理数据、提供更丰富的地理分析功能,并与其他领域的技术进行深度融合。我期望未来的WebGIS能够更加智能化、个性化,为用户提供更好的地理信息服务,助力各行各业的决策和发展。
这块您需要了解下stm32等单片机的基本编程和简单的硬件设计,最好能够了解模电和数电相关的知识更好,还有能够会做操作系统,简单的有ucos,freeRTOS等等。最好能够使用PCB画图软件以及keil4等软件。希望对您能够有用。