First post.
When I was in college, I made a program to determine the positive and negative of travel site reviews using SVM (Support Vector Machine). At that time, I was using Python, but are there many languages that are different from other machine learning methods? Is anything other than Python popular now? I thought, so I considered it by collecting Qiita tag information.
First, extract 100 articles tagged with machine learning methods (SVM, Logistic regression, etc.) using the API, and check the other tags of the articles to see which language they are written in. (It's a nori to tag the language together.)
It's a practice of QiitaAPI, so it doesn't matter if it's correct or not. By the way, the search name is ↓.
Method | Search name |
---|---|
Linear regression | Linearregression |
Logistic regression | Logisticregression |
Support vector machine | SVM |
Decision tree | decisiontree |
Random forest | randomforest |
neural network | NeuralNetwork |
Naive bayes | NaiveBayes |
k-means | k-means |
Principal component analysis | PCA |
Deep learning | DeepLearning |
QiitaAPItest.js
//Load the axios module
const axios = require('axios');
//MLName:Machine learning method
//MLSearchName:Name to search
//Get tags from 100 articles tagged with MLSearchName[Tag name: number]Returns in the list of.
async function taglist(MLName, MLSearchName) {
var rtList={};
let response = await axios.get('https://qiita.com/api/v2/items?per_page=100&page=1&query=tag:'+MLSearchName);
for (let i = 0; i < response.data.length; i++) {
for (let j = 0; j < response.data[i].tags.length; j++) {
if(rtList[response.data[i].tags[j].name]){
rtList[response.data[i].tags[j].name] +=1;
}
else{
rtList[response.data[i].tags[j].name] =1;
}
}
}
//Sort in descending order
var keys=[];
for(var key in rtList)keys.push(key);
function Compare(a,b){
return rtList[b]-rtList[a];
}
keys.sort(Compare);
console.log('\n' + MLName);
//Top 5 items displayed
for(let i = 0; i < 6; i++){
console.log(keys[i] + ':' + rtList[keys[i]]);
}
}
taglist('Linear regression','Linearregression');
taglist('Logistic regression','Logisticregression');
taglist('Support vector machine','svm');
taglist('Decision tree','decisiontree');
taglist('Random forest','randomforest');
taglist('neural network','NeuralNetwork');
taglist('Naive bayes','NaiveBayes');
taglist('k-means','k-means');
taglist('Principal component analysis','PCA');
taglist('Deep learning','DeepLearning');
Extracted tags, 5 in descending order of number
Method | Tag 1 | Tag 2 | Tag 3 | Tag 4 | Tag 5 |
---|---|---|---|---|---|
Linear regression | MachineLearning | Python | Machine learning | memo | coursera |
Logistic regression | Python | MachineLearning | scikit-learn | classification | Marketing |
Support vector machine | Machine learning | Python | scikit-learn | MachineLearning | Machine learning入門 |
Decision tree | Python | MachineLearning | Machine learning | Decision tree | randomForest |
Random forest | Python | Machine learning | MachineLearning | scikit-learn | Kaggle |
neural network | DeepLearning | Python | Machine learning | AI | MachineLearning |
Naive bayes | Python | MachineLearning | Machine learning | scikit-learn | svm |
k-means | Python | Machine learning | Clustering | scikit-learn | MachineLearning |
Principal component analysis | Python | Machine learning | Principal component analysis | Python3 | K-means:6 |
Deep learning | Python | Machine learning | PyTorch | TensorFlow | Keras |
** All Python! ** ** I was wondering if R would come out, but Python seems to be popular. Python is easy, isn't it? After learning C and Java, using Python was too easy and trembled. I also googled why Python is so popular.
Discussion on the advantages and disadvantages of Python
I was wondering if I could put a link other than Qiita, so I didn't put it. If you google for "Reason for Python popularity", you will find many.
Summary ** ・ Easy to write code ・ Many platforms are available ・ Abundant library ** Seems to be the reason.
Is it the reason why many libraries are chosen especially in machine learning? However, machine learning inevitably becomes a large process in the learning process. In that respect, Python is an interpreted type, so it's a groaning machine power. Is it the same with the compiled type?
After spending a day learning, I often get errors with shit-like code mistakes. The interpreter type is not bad. I'm bad.
There are still issues with how to search for API articles. ・ Cannot search including spaces (eg Deep Learning) ・ Cannot search in Japanese Qiita API https://qiita.com/api/v2/items?per_page=100&page=1&query=tag: It is necessary to study the following description method a little more.