一个色的导航资源精品在线观看|手机看片在线精品视频|伊人亚洲成人电影|亚洲欧美在线男女|无码无码在线观看五月精品视频在线|超碰日韩欧美在线|午夜精品蜜桃一区二区久久久|91欧美动态国产精品女主播|色欲色香天天天综合网在线观看免费|伊人春色在线伊人

延安市花?

時(shí)間:2025-01-30 02:44 人氣:0 編輯:招聘街

一、延安市花?

是太白山報(bào)春,也叫太行山報(bào)春,學(xué)名為Cathcartia villosula,屬于報(bào)春花科。太白山報(bào)春是中國(guó)特有植物,分布在黃土高原地帶的山區(qū),主要生長(zhǎng)在海拔1000 至 3000 米的地方。在延安市,太白山報(bào)春也被廣泛栽培和種植,并被選為延安市的市花。太白山報(bào)春花色艷麗,黃色和紫色的花朵向陽(yáng)而開(kāi),散發(fā)著清香,株高15-50厘米,花期一般在每年的3-4月份,是春天的重要花卉之一。除了延安市,太白山報(bào)春還是河北省、山西省等地的省花,被廣泛用于園林綠化、花卉觀賞等方面。

二、延安市正規(guī)貓舍在哪里?

微博上找

搜“地區(qū)+貓品種”

延安我沒(méi)記得看到過(guò)

但西安應(yīng)該是有的

三、延安市景點(diǎn)

作為陜西省境內(nèi)的一個(gè)美麗城市,延安市擁有眾多令人稱(chēng)贊的景點(diǎn)和豐富多樣的文化遺產(chǎn)。無(wú)論是歷史古跡、自然風(fēng)光還是民俗文化,延安市都將給游客帶來(lái)難以忘懷的體驗(yàn)。

1. 常聞的延安市景點(diǎn)

延安市最著名的景點(diǎn)之一是延安革命紀(jì)念館。這座紀(jì)念館位于延安市中心,以其全方位展示中國(guó)共產(chǎn)黨的革命歷程而聞名。館內(nèi)設(shè)有大量的歷史文物和珍貴展品,讓游客們可以更好地了解中國(guó)革命的英勇歷程。

除此之外,抗日戰(zhàn)爭(zhēng)紀(jì)念館也是延安市的重要景點(diǎn)之一。這個(gè)紀(jì)念館建于抗日戰(zhàn)爭(zhēng)勝利后,為了紀(jì)念那些為國(guó)家獻(xiàn)出生命的革命先烈而創(chuàng)建。館內(nèi)有關(guān)抗日戰(zhàn)爭(zhēng)的歷史圖片、文物以及實(shí)物模型,為游客們呈現(xiàn)了當(dāng)時(shí)的豐衣足食和艱苦奮斗的歷史場(chǎng)景。

值得一提的還有棗園革命舊址景區(qū)。這個(gè)景區(qū)是中國(guó)共產(chǎn)黨和毛澤東先生曾經(jīng)辦公、生活的地方。參觀者可以親身體驗(yàn)到當(dāng)年的革命風(fēng)云狀況,并欣賞到一些珍貴的歷史照片、檔案和文物。

2. 自然風(fēng)光之美

延安市也有許多迷人的自然景觀,給游客們帶來(lái)別樣的感受。

延河是延安市的母親河,其水質(zhì)清澈,河岸景色宜人。沿岸有很多公園和休閑場(chǎng)所,供游客們放松身心,欣賞自然美景。

除了延河,延安市還擁有多個(gè)國(guó)家級(jí)自然保護(hù)區(qū)。這些保護(hù)區(qū)擁有豐富的植被和獨(dú)特的動(dòng)物群落,是生態(tài)旅游者的理想選擇。

3. 民俗文化與藝術(shù)

延安市的民俗文化非常豐富多樣,反映了當(dāng)?shù)厣詈竦臍v史底蘊(yùn)。

中國(guó)剪紙藝術(shù)是延安市重要的傳統(tǒng)藝術(shù)形式之一。延安市的剪紙作品以其精致的手工藝和寓意深遠(yuǎn)的圖案而聞名。參觀者可以在當(dāng)?shù)氐募艏埞ぷ魇覍W(xué)習(xí)和體驗(yàn)這一古老而精湛的技藝。

此外,延安市還保留著豐富的傳統(tǒng)民俗活動(dòng),如舞龍舞獅、踩高蹺等。這些活動(dòng)不僅展示了延安市人民的生活方式,也讓游客們更好地了解中國(guó)傳統(tǒng)文化。

4. 延安市美食

延安市的美食也是吸引游客們的一大亮點(diǎn)。

延安手扒肉是當(dāng)?shù)赜忻奶厣穗?。這道菜以豬肘子為主料,烹制過(guò)程繁瑣,口感酥軟,肉質(zhì)鮮美,備受游客們的喜愛(ài)。

另外,延安的面食也非常有特色,如涼皮、油茶和豆皮等。這些美食以其獨(dú)特的味道和制作工藝,成為延安市的風(fēng)味招牌。

結(jié)語(yǔ)

作為一個(gè)歷史悠久、文化底蘊(yùn)深厚的城市,延安市以其獨(dú)特的景點(diǎn)、自然風(fēng)光和民俗文化吸引了眾多游客。無(wú)論是對(duì)歷史感興趣的游客,還是熱愛(ài)自然風(fēng)光和傳統(tǒng)文化的人士,延安市都能滿(mǎn)足他們的需求。

如果你計(jì)劃前往中國(guó)陜西省旅行,不妨考慮一下延安市作為你的旅游目的地。你將在這個(gè)美麗的城市中領(lǐng)略到獨(dú)特的魅力,感受到濃厚的歷史氛圍。

四、延安市簡(jiǎn)介?

延安,簡(jiǎn)稱(chēng)“延”,古稱(chēng)膚施、高奴、延州,原陜甘寧邊區(qū)政府首府。首批國(guó)家歷史文化名城。延安位于陜北南半部,地處北緯35°21′~37°31′,東經(jīng)107°41′~110°31′之間,屬高原大陸性季風(fēng)氣候。北接榆林市,南連咸陽(yáng)市、銅川市、渭南市,東隔黃河與山西省臨汾市、呂梁市相望,西依子午嶺與甘肅省慶陽(yáng)市為鄰。延安市域面積37037平方公里,共轄2區(qū)11縣,196個(gè)鄉(xiāng)鎮(zhèn),3426個(gè)行政村,全市總?cè)丝?36萬(wàn)(2012年),常住人口225.28萬(wàn)(2016年),平均海拔1000米左右,年均無(wú)霜期170天,年均氣溫9.2℃,年均降水量500多毫米。延安地處陜北金三角經(jīng)濟(jì)協(xié)作區(qū)腹地。歷來(lái)是陜北地區(qū)政治、經(jīng)濟(jì)、文化和軍事中心。城區(qū)處于寶塔山、清涼山、鳳凰山三山鼎峙,延河、汾川河二水交匯之處的位置,成為兵家必爭(zhēng)之地,有“塞上咽喉”、“軍事重鎮(zhèn)”之稱(chēng),被譽(yù)為“三秦鎖鑰,五路襟喉”。

五、延安市面積?

延安市總面積37037平方千米。

六、延安市區(qū)面積?

延安市區(qū)的面積五十平方公里。

延安市,簡(jiǎn)稱(chēng)“延”,陜西省地級(jí)市,是天下第一陵——中華民族始祖黃帝的陵寢:黃帝陵所在地,是民族圣地、中國(guó)革命圣地,國(guó)務(wù)院首批公布的國(guó)家歷史文化名城。延安位于陜西省北部,地處黃河中游,黃土高原的中南地區(qū),省會(huì)西安以北371千米。北連榆林,南接關(guān)中咸陽(yáng)、銅川、渭南三市,東隔黃河與山西臨汾、呂梁相望,西鄰甘肅慶陽(yáng)。介于北緯35°21′-37°31′,東經(jīng)107°41′-110°31′之間,東西寬256千米,南北長(zhǎng)236千米,總面積37037平方千米,被譽(yù)為“三秦鎖鑰,五路襟喉”。截至2022年,延安市轄1市2區(qū)10縣、18個(gè)街道辦事處、84個(gè)鎮(zhèn)、12個(gè)鄉(xiāng)。截至2021年末全市常住人口226.93萬(wàn)人。

七、延安市區(qū)多長(zhǎng)?

東西寬256千米,南北長(zhǎng)236千米,總面積37037平方千米。延安市,簡(jiǎn)稱(chēng)“延”,古稱(chēng)膚施、延州,隸屬于陜西省,是天下第一陵——中華民族始祖黃帝陵寢黃帝陵所在地,是民族圣地、中國(guó)革命圣地,國(guó)務(wù)院首批公布的國(guó)家歷史文化名城。延安位于陜西省北部,地處黃河中游,黃土高原的中南地區(qū),省會(huì)西安以北371千米。北連榆林,南接關(guān)中咸陽(yáng)、銅川、渭南三市,東隔黃河與山西臨汾、呂梁相望,西鄰甘肅慶陽(yáng)。介于北緯35°21′-37°31′,東經(jīng)107°41′-110°31′之間,東西寬256千米,南北長(zhǎng)236千米,總面積37037平方千米。有“塞上咽喉”、“軍事重鎮(zhèn)”之稱(chēng),被譽(yù)為“三秦鎖鑰,五路襟喉”。

八、延安市人口?

延安市的人口數(shù)量為236萬(wàn)人。

根據(jù)第七次全國(guó)人口普查結(jié)果,延安市人口數(shù)量為236萬(wàn)人,位列陜西省各地市人口數(shù)量排行榜第9位,位列全國(guó)各大城市人口數(shù)量排行榜(地級(jí)市及以上)第231位。

2021年5月,延安市上榜2021中國(guó)地級(jí)市百?gòu)?qiáng)品牌城市榜單第40名。2021年4月,延安市入選2021首屆中國(guó)文化百?gòu)?qiáng)市。

九、延安市海拔?

延安平均海拔1200米左右。

延安市位于黃河中游,屬黃土高原丘陵溝壑區(qū)。延安地貌以黃土高原、丘陵為主。地勢(shì)西北高東南低,平均海拔1200米左右。北部的白于山海拔1600-1800米,最高點(diǎn)在吳旗縣五谷城鄉(xiāng)的白于山頂,海拔1809.8米;最低點(diǎn)在宜川縣集義鄉(xiāng)猴兒川,海拔388.8米,相對(duì)高差1421米。

北部以黃土梁峁、溝壑為主,占全區(qū)總面積72%;南部以黃土塬溝壑為主,占總面積19%;全區(qū)石質(zhì)山地占總面積9%。西部子午嶺,南北走向,構(gòu)成洛河與涇河的分水嶺,是高出黃土高原的基巖山地之一,海拔1500-1600米,主峰1687米。

東部黃龍山,大致呈南北方向延伸,海拔1500米,主峰(大嶺)海拔1788.7米;中部勞山,呈西北——東南走向,平均海拔1400米,主峰(大墩梁)海拔1464米。黃龍山和勞山統(tǒng)稱(chēng)為梁山山脈,形成延安地區(qū)地形的骨架。

十、mahout面試題?

之前看了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)換成向量失敗!");

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)練模型失??!");

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());

}

}

相關(guān)資訊
熱門(mén)頻道

Copyright © 2024 招聘街 滇ICP備2024020316號(hào)-38