顯示具有 AI 標籤的文章。 顯示所有文章
顯示具有 AI 標籤的文章。 顯示所有文章

2018年11月30日 星期五

My machine learning course history (updating)

1. Udacity ud120
2. Andrew Ng youtube Videos
3. kaggle learning (including python ,SQL ,Pandas, Deep learning and Data Visualization)
4. Google AI education
5. pyimagesearch website held by  which has loads of opencv intros and object detection demo codes and detail applications sample codes. YOLO3. Must take a peek if you are interest in computer visions.

2018年6月15日 星期五

Feature optimize for machine learning-One-Hot Encoder

Recently begin study MLCC from google.
Besides complex mathematics underneath all kinds of optimizers, over 80% of work time will be spent on data collecting/processing/cleaning and define useful features to feed to optimizer.
Linear regressor  requires numeric features. So for some of the data columns which contains characters/string(categorical), we can use so call "One hot encoding" method to convert these kind of data. skikit-learn offer module to easily get these done 
LabelEncoder
OneHotEncoder


from numpy import array
from numpy import argmax
from sklearn.preprocessing import LabelEncoder
from sklearn.preprocessing import OneHotEncoder
input_data = ['happy','sad','cry','happy','blank','blank','sad','cry','happy','sad']
#need to convert to array structure
values = array(input_data)
# integer encode
label_encoder = LabelEncoder()
encoded_output_list = label_encoder.fit_transform(values)
print(encoded_output_list)

Output:
[2 3 1 2 0 0 3 1 2 3]

output is the transformed integer list from input list, but still not yet an one-hot list.
You still need to User OneHotEncoder to encode integer list to one-hot formateed list with below code


# binary encode
onehot_encoder = OneHotEncoder(sparse=False)
#need to reshape integer list shape from 1xn to nx1 since it fits 
#feature columns more for later Machine learning usage
integer_encoded = integer_encoded.reshape(len(integer_encoded), 1)  
onehot_encoded = onehot_encoder.fit_transform(integer_encoded)
print(onehot_encoded)

Output:
[[0. 0. 1. 0.]
 [0. 0. 0. 1.]
 [0. 1. 0. 0.]
 [0. 0. 1. 0.]
 [1. 0. 0. 0.]
 [1. 0. 0. 0.]
 [0. 0. 0. 1.]
 [0. 1. 0. 0.]
 [0. 0. 1. 0.]
 [0. 0. 0. 1.]]

This discrete feature to numeric feature transformation is frequently used in ML. Noted Here.

2018年3月7日 星期三

AI study note

AI is getting more and more real life applications recent couple years. By realize this, i think it is time to know more detail of it. There's more resources on the web then before.
The most famous online course in this field is opened by Andres Ng on coursera. He is the icon of current AI industry.
Andrew Ng Stanford University

There's also a simple introduction to AI learning by Shival Grupta
Shiva Gupta blog

Albeit there's no pre-request of programming language, but i decide to cut in follow Shival's path with Python and google's tensorflow.