$ sudo apt-get update
$ sudo apt-get upgrade
apt-get update
- 更新最新的套件資訊
apt-get upgrade
- 更新套件
# Working example for my blog post at: | |
# http://danijar.com/variable-sequence-lengths-in-tensorflow/ | |
import functools | |
import sets | |
import tensorflow as tf | |
from tensorflow.models.rnn import rnn_cell | |
from tensorflow.models.rnn import rnn | |
def lazy_property(function): |
import pandas as pd | |
import numpy as np | |
from sklearn.feature_extraction import DictVectorizer | |
def encode_onehot(df, cols): | |
""" | |
One-hot encoding is applied to columns specified in a pandas DataFrame. | |
Modified from: https://gist.github.com/kljensen/5452382 | |
This collection of files serves as a simple static demonstration of how to post to a google spreadsheet from an external html <form>
following the example by Martin Hawksey
Depreciation Warning: This code is not maintained, and should be seen as reference implementation only. If you're looking to add features or update, fork the code and update as needed.
You should be able to just open index.html
in your browser and test locally.
import numpy as np | |
import marisa_trie | |
from sklearn.feature_extraction.text import CountVectorizer | |
from sklearn.externals import six | |
class MarisaCountVectorizer(CountVectorizer): | |
# ``CountVectorizer.fit`` method calls ``fit_transform`` so | |
# ``fit`` is not provided | |
def fit_transform(self, raw_documents, y=None): |
Codes for Machine Learning Foundations(NTU) | |
台湾国立大学《机器学习基石》(Coursera版)相关的代码、编程作业等。 | |
课程地址:https://class.coursera.org/ntumlone-001/ |
from pyspark import SparkContext | |
import numpy as np | |
from sklearn.cross_validation import train_test_split, Bootstrap | |
from sklearn.datasets import make_classification | |
from sklearn.metrics import accuracy_score | |
from sklearn.tree import DecisionTreeClassifier | |
def run(sc): |
#!/usr/bin/env python | |
#vim: encoding=utf-8 | |
""" | |
拼音分词 | |
""" | |
__author__ = "dreampuf<soddyque@gmail.com>" | |
import unittest |
from unicodedata import * | |
script_data = { | |
"names":['Common', 'Latin', 'Greek', 'Cyrillic', 'Armenian', 'Hebrew', 'Arabic', | |
'Syriac', 'Thaana', 'Devanagari', 'Bengali', 'Gurmukhi', 'Gujarati', 'Oriya', | |
'Tamil', 'Telugu', 'Kannada', 'Malayalam', 'Sinhala', 'Thai', 'Lao', 'Tibetan', | |
'Myanmar', 'Georgian', 'Hangul', 'Ethiopic', 'Cherokee', 'Canadian_Aboriginal', | |
'Ogham', 'Runic', 'Khmer', 'Mongolian', 'Hiragana', 'Katakana', 'Bopomofo', | |
'Han', 'Yi', 'Old_Italic', 'Gothic', 'Deseret', 'Inherited', 'Tagalog', | |
'Hanunoo', 'Buhid', 'Tagbanwa', 'Limbu', 'Tai_Le', 'Linear_B', 'Ugaritic', |