- Python KeyError if dict[key]: cannot do this have to change to if key in dict:
Your byte size news and commentary from Silicon Valley the land of startup vanities, coding, learn-to-code and unicorn billionaire stories.
Ad
Saturday, March 18, 2017
Commonly seen python error messages - Learn to code Python for Beginners
Pandas Sample Code - Udacity Machine Learning
- .groupby()
- .count()
- pandas.DataFrame.count
- .sum()
- df[df["class"]==1].count()["value"]
- countOfColumn = myDataFrame[conditionColumn["myCondition"]=="myCondValue"].count()["conditionColumn"] get row count by column condition and value
- pandas.Series.map
- pandas.DataFrame.count
- df[(df['A']>0) & (df['B']>0) & (df['C']>0)]
- pandas.DataFrame.sum
- df.groupby('a').count()
- df.first()
Monday, March 13, 2017
Sunday, March 12, 2017
Udacity Machine Learning Nanodegree Bayes Rule Bayesian Analysis Walkthrough
quiz
<xi, di>
di = f(xi) + err
x, d, h(x) = x mod 9, h(x) = x/3, h(x) = 2,
1, 1, 1%9 = 1, 1/3, 2,
3, 0, 3%9 = 3, 1, 2,
6, 5, 6%9 = 6, 2, 2,
10, 2, 10%9= 1, 10/3, 2,
11, 1, 11%9= 2, 11/3, 2,
13, 4, 13%9 = 4, 13/3, 2,
sum of squared errors for each (excel calc)
h(x) = x mod 9
sum of squared errors = 12
h(x) = x/3
sum of squared errors = 19.44
<xi, di>
di = f(xi) + err
x, d, h(x) = x mod 9, h(x) = x/3, h(x) = 2,
1, 1, 1%9 = 1, 1/3, 2,
3, 0, 3%9 = 3, 1, 2,
6, 5, 6%9 = 6, 2, 2,
10, 2, 10%9= 1, 10/3, 2,
11, 1, 11%9= 2, 11/3, 2,
13, 4, 13%9 = 4, 13/3, 2,
sum of squared errors for each (excel calc)
h(x) = x mod 9
sum of squared errors = 12
h(x) = x/3
sum of squared errors = 19.44
h(x) = 2
sum of squared errors = 19
Use the smallest
Or better way: write a python script
sum of squared errors = 19
Use the smallest
Or better way: write a python script
Saturday, March 11, 2017
R Squared Coefficient of Determination - Machine Learning Concept
*coefficient of determination*](http://stattrek.com/statistics/dictionary.aspx?definition=coefficient_of_determination)
R^2
R<sup>2</sup>
coefficient of determination
useful statistics for regression analysis
measures how good the model makes prediction.
R^2 range {0, 1}
can be negative, arbitrarily worse
percentage of square correlection between predicted and actual values of target variable
indicates what percentage of the target variable, using this model, can be explained by the **features**.
r2_score from sklearn.metrics
R^2
R<sup>2</sup>
coefficient of determination
useful statistics for regression analysis
measures how good the model makes prediction.
R^2 range {0, 1}
can be negative, arbitrarily worse
percentage of square correlection between predicted and actual values of target variable
indicates what percentage of the target variable, using this model, can be explained by the **features**.
r2_score from sklearn.metrics
Wednesday, March 8, 2017
Pandas Numpy Data Analysis Tool Kit - Udacity Machine Learning Nanodegree 01
Numpy perfect for statistical analysis, matrix manipulation. Learn to Code Notes.
Numpy Documentation
https://docs.scipy.org/doc/numpy-dev/user/quickstart.html
Code pattern 01 numpy use array().T to get matrix transpose
Example:
X = [1,2,3]
XT = array(X).T
numpy.dot(series1, series2)
Numpy Documentation
https://docs.scipy.org/doc/numpy-dev/user/quickstart.html
Code pattern 01 numpy use array().T to get matrix transpose
Example:
X = [1,2,3]
XT = array(X).T
numpy.dot(series1, series2)
Subscribe to:
Posts (Atom)
React UI, UI UX, Reactstrap React Bootstrap
React UI MATERIAL Install yarn add @material-ui/icons Reactstrap FORMS. Controlled Forms. Uncontrolled Forms. Columns, grid
-
The bogus request from P2PU to hunt for HTML tags in real life has yielded a lot of good thoughts. My first impression was that this is stup...
-
Can hack schools solve Silicon Valley's talent crunch? The truth about coding bootcamps and the students left behind http://t.co/xXNfqN...
-
This review is updated continuously throughout the program. Yay I just joined the Udacity Nanodegree for Digital Marketing! I am such an Uda...