"Bi thing" Microsoft decision Tree algorithm--Find out the characteristics of the Three Kingdoms, dedicated to the broad three enthusiasts

Source: Internet
Author: User

According to the data of the Kingdoms 11, this paper uses decision tree analysis to find out the distribution of the three generals ' characteristics. Variables include command, force, intelligence, politics, charisma, identity.
Variable Description:
Command: The defensive force of a military commander in the army. The higher the commander, the less the attack and the war of War are.
Force: The attacking force of a military commander in the army, the higher the Force is, the higher the damage to the local forces in the war of art or ordinary attack, and the higher the success rate, the less the difference between the two generals when they are singled out, and the greater the power of military commanders when they are singled out.
Intelligence: The effectiveness and success rate of military commanders when they are used, and when the generals have high intelligence, they can reduce their chances of being counted;
Politics: The ability of the generals to develop their internal affairs, the higher the internal affairs of the Interior, the production of weapons, the sale of fodder, construction time and other internal affairs departments have advantages. And politics has a vital role to play when it comes to searching for talent and dealing with hostile forces.
Charm: The higher the charisma, the higher the chance of success when the generals are able to use the opposition or other powerful generals. And when the generals recruit, the charm will also affect its effect.

Kingdoms each character has a certain identity, in addition to the monarch, there are waiters, advisers, generals, military attaches and civilian.

The general needs the Commander to increase the force in 150 to seal;
The adviser requires more than 90 of intelligence and adds more than 160 to politics.
The waiter needs political 85, and the sum of the intellect should be no less than 150 (often becoming the Prime Minister);
To simplify verification: we set three identities: Generals, advisers, others;

Other

TD valign= "Top" width= "101" >

Serial number

identity

Require

number

1

General

The general needs a commanding force to be more than 150 to seal

2

Advisers

Advisers require more than 90 intelligence and add more than 160 to politics ;

3

 

538

Prepare the data:

ALTER TABLEFactSanguo11ADD [Identity] NVARCHAR(255)NULL--General, generals need to be armed to the 150 to seal .SELECT  * fromFactSanguo11WHERE   [Command] + [Armed Forces] >  MaxORDER  by [Command] + [Armed Forces] DESCUPDATEFactSanguo11SET     [Identity] =N'General'WHERE   [Command] + [Armed Forces] >  MaxSELECT  * fromFactSanguo11WHERE   [Identity] =N'General'ORDER  by [Command] + [Armed Forces] DESC--The strategists demanded more than 90 of their intelligence and increased their politicalSELECT  * fromFactSanguo11WHERE([Intelligence] + [political] >  the )         and([Intelligence] >=  - )ORDER  by [Intelligence] + [political] DESCUPDATEFactSanguo11SET     [Identity] =N'adviser'WHERE([Intelligence] + [political] >  the )         and([Intelligence] >=  - )        SELECT  * fromFactSanguo11WHERE   [Identity] =N'adviser'ORDER  by [Intelligence] + [political] DESC        UPDATEFactSanguo11SET     [Identity] =N'other'WHERE   [Identity]  is NULL        SELECT  [Identity] ,        COUNT(*) fromFactSanguo11GROUP  by [Identity]     SELECT  * fromFactSanguo11

Analyze data:

-- Top 10: Sima Yi, Zhou Yu, Cao, Lu Xun, Guan Yu, Deng Ai, Sun Jian, Zhangliao, Sun Ce, Zhuge Liang SELECT TOP Ten        *  from     FactSanguo11ORDERbyDESC



-- Armed Forces before 10: BU, Zhang Fei, Guan Yu, Ma Chao, Zhao Yun, Xu Yu, Wei, Wuchou, Pound, ganning SELECT TOP Ten        *  from     FactSanguo11ORDERbyDESC



-- Top 10: Zhuge Liang, Guo Jia, brag, Pang Tong, Zhou Yu, Sima Yi, Xunyu, Lu Xun, zhow, Fa Zheng SELECT TOP Ten        *  from     FactSanguo11ORDERbyDESC



-- political pre 10: Xunyu, Zhang Zhao, agronomy, Zhang Yi, Zhuge Liang, Caocao, Sima Yi, after, Yi , Xiahou SELECT TOP Ten        *  from     FactSanguo11ORDERbyDESC



-- charm before 10: Liu Bei, Zhang Xue, Cao, Sun Quan, Marten cicada, Lanbo, Guan Yu, Xunyu, Zhou Yu, Liu Yan SELECT TOP Ten        *  from     FactSanguo11ORDERbyDESC



--command of force 10: Guan Yu, Lu Bu, Zhao Yun, Zhangliao, Ma Chao, Sun Ce, Sun Jian, Zhang Fei, Deng Ai, ganningSELECT TOP Ten        * fromFactSanguo11WHERE   [Command] + [Armed Forces] >  MaxORDER  by [Command] + [Armed Forces] DESC



--intellectual politics Top 10: Zhuge Liang, Xunyu, Sima Yi, Cao, Zhou Yu, Lu Su, Guo Jia, brag, Zhow, Pang TongSELECT TOP Ten        * fromFactSanguo11WHERE([Intelligence] + [political] >  the )         and([Intelligence] >=  - )ORDER  by [Intelligence] + [political] DESC

Analysis Process:












"Bi thing" Microsoft decision Tree algorithm--Find out the characteristics of the Three Kingdoms, dedicated to the broad three enthusiasts

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.