This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/python | |
| # -*- coding: utf-8 -*- | |
| # | |
| # ============================================================================= | |
| # Version: 2.32 (Apr 26, 2015) | |
| # Author: Giuseppe Attardi (attardi@di.unipi.it), University of Pisa | |
| # | |
| # Contributors: | |
| # Antonio Fuschetto (fuschett@aol.com) | |
| # Leonardo Souza (lsouza@amtera.com.br) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| This example uses Scala. Please see the MLlib documentation for a Java example. | |
| Try running this code in the Spark shell. It may produce different topics each time (since LDA includes some randomization), but it should give topics similar to those listed above. | |
| This example is paired with a blog post on LDA in Spark: http://databricks.com/blog | |
| Spark: http://spark.apache.org/ | |
| */ | |
| import scala.collection.mutable |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import re | |
| def glob2re(pat): | |
| """Translate a shell PATTERN to a regular expression. | |
| There is no way to quote meta-characters. | |
| """ | |
| i, n = 0, len(pat) | |
| res = '' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| alias em="emacs" | |
| alias ll="ls -al" | |
| alias py="python" | |
| alias gwe="grep -rnw . -e" | |
| alias fe="find . -name" | |
| alias c="cd" | |
| alias gits="git status" | |
| alias gitl="git log" | |
| alias gitpull="git pull origin master" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "product": "Live JSON generator", | |
| "version": 3.1, | |
| "releaseDate": "2014-06-25T00:00:00.000Z", | |
| "demo": true, | |
| "person": { | |
| "id": 12345, | |
| "name": "John Doe", | |
| "phones": { | |
| "home": "800-123-4567", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| # This is a simplified implementation of the LSTM language model (by Graham Neubig) | |
| # | |
| # LSTM Neural Networks for Language Modeling | |
| # Martin Sundermeyer, Ralf Schlüter, Hermann Ney | |
| # InterSpeech 2012 | |
| # | |
| # The structure of the model is extremely simple. At every time step we |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| WORK_PATH=/home/yangshuang/hadoop/hadooptestdir #本地文件目录 | |
| HADOOP_CLIENT_PATH=/home/yangshuang/hadoop-client/hadoop #客户端目录 | |
| HADOOP_CLIENT_BIN=${HADOOP_CLIENT_PATH}/bin/hadoop #客户端可执行程序 | |
| HADOOP_CLIENT_CONF=${HADOOP_CLIENT_PATH}/conf/hadoop-site-xxx.xml #客户端配置文件 | |
| HDFS_ROOT=/app/vs/ns-webgis #HDFS目录 | |
| HDFS_IN_PATH=${HDFS_ROOT}/data/ys #HDFS目录 | |
| HDFS_OUT_PATH=${HDFS_IN_PATH}/testdir #HDFS输出位置 | |
| INPUT=${HDFS_IN_PATH}/input #HDFS输入 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $brew --config | |
| HOMEBREW_VERSION: 0.9.5 | |
| ORIGIN: https://github.com/Homebrew/homebrew.git | |
| HEAD: 7cb9a9fa0de88230bbe9b5e3bc61ea30b6e88c84 | |
| HOMEBREW_PREFIX: /usr/local | |
| HOMEBREW_CELLAR: /usr/local/Cellar | |
| CPU: quad-core 64-bit haswell | |
| OS X: 10.9.4-x86_64 | |
| Xcode: 4.6.3 | |
| Clang: 4.2 build 425 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import numpy as np | |
| import pandas as pd | |
| import statsmodels.formula.api as sm #lin reg | |
| import pylab as py | |
| import matplotlib as mp | |
| from sklearn.tree import DecisionTreeRegressor | |
| from sklearn.ensemble import ExtraTreesRegressor | |
| from sklearn.ensemble import RandomForestRegressor |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| (C) Mathieu Blondel - 2010 | |
| License: BSD 3 clause | |
| Implementation of the collapsed Gibbs sampler for | |
| Latent Dirichlet Allocation, as described in | |
| Finding scientifc topics (Griffiths and Steyvers) | |
| """ |