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
    
  
  
    
  | from sklearn.datasets import make_regression | |
| from sklearn.linear_model import Lasso | |
| import numpy as np | |
| from scipy.optimize import approx_fprime, check_grad, minimize | |
| X, y, w_true = make_regression(n_samples=200, n_features=500, random_state=0, coef=True) | |
| w_init = np.ones_like(w_true) | |
| lam = 10 | |
| def l(w, X, y, lam=10): | 
  
    
      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
    
  
  
    
  | def _lambdifygenerated(_Dummy_169, _Dummy_168): | |
| [[beta_0_0, beta_0_1, beta_0_2, beta_0_3, beta_0_4, beta_0_5, beta_0_6, beta_0_7, beta_0_8, beta_0_9, beta_0_10, beta_0_11, beta_0_12, beta_0_13, beta_0_14, beta_0_15, beta_0_16, beta_0_17, beta_0_18, beta_0_19, beta_0_20], [beta_1_0, beta_1_1, beta_1_2, beta_1_3, beta_1_4, beta_1_5, beta_1_6, beta_1_7, beta_1_8, beta_1_9, beta_1_10, beta_1_11, beta_1_12, beta_1_13, beta_1_14, beta_1_15, beta_1_16, beta_1_17, beta_1_18, beta_1_19, beta_1_20], [beta_2_0, beta_2_1, beta_2_2, beta_2_3, beta_2_4, beta_2_5, beta_2_6, beta_2_7, beta_2_8, beta_2_9, beta_2_10, beta_2_11, beta_2_12, beta_2_13, beta_2_14, beta_2_15, beta_2_16, beta_2_17, beta_2_18, beta_2_19, beta_2_20], [beta_3_0, beta_3_1, beta_3_2, beta_3_3, beta_3_4, beta_3_5, beta_3_6, beta_3_7, beta_3_8, beta_3_9, beta_3_10, beta_3_11, beta_3_12, beta_3_13, beta_3_14, beta_3_15, beta_3_16, beta_3_17, beta_3_18, beta_3_19, beta_3_20], [beta_4_0, beta_4_1, beta_4_2, beta_4_3, beta_4_4, beta_4_5, beta_4_6, beta_4_7 | 
  
    
      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
    
  
  
    
  | feature_hierarchies: Optional[Union[hierarchy_type], List[hierarchy_type]] | |
| if feature_hierarchies: | |
| if not isinstance(feature_hierarchies, list): | |
| graph_hierarchies = [graph_from_hierarchy(feature_hierarchies)] | |
| else: | |
| graph_hierarchies = [graph_from_hierarchy(h) for h in feature_hierarchies] | 
  
    
      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
    
  
  
    
  | 186590d34d15:FBA_Analytics_Utils vaggi$ pyre --debug check | |
| 2018-05-14 15:13:57,354 DEBUG No configuration found at `/Users/vaggi/Code_Libraries/FBA_Analytics_Utils/.pyre_configuration.local`. | |
| 2018-05-14 15:13:57,354 DEBUG No configuration found at `.pyre_configuration.local`. | |
| 2018-05-14 15:13:57,354 DEBUG Reading configuration `.pyre_configuration`... | |
| 2018-05-14 15:13:57,355 DEBUG Found source directories `.` | |
| 2018-05-14 15:13:57,356 DEBUG Running `/Users/vaggi/anaconda3/bin/pyre.bin check -debug -sequential -project-root /Users/vaggi/Code_Libraries/FBA_Analytics_Utils -workers 1 -search-path /Users/vaggi/anaconda3/lib/pyre_check/typeshed/stdlib/ .` | |
| 2018-05-14 15:13:57,728 ERROR Client exited with error code -5: | |
  
    
      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
    
  
  
    
  | vol*(0.00577622650467*Ydj1*kb - (Ydj1*kb + kd*vol)*(kd + kr + 0.00577622650467))*(Ydj1*kb + 0.069314718056*vol)**2*(Ydj1*kb + kd*vol)*((YC*kr + 0.069314718056*YC + YP*kd + YP*kr - 0.00577622650467*Ydj1 + 2*Ys*vol)/vol - (-Ydj1*cln3*kb - Ydj1*kb*prot + vol*(YC*kr + 0.069314718056*YC + YP*kd + YP*kr - 0.00577622650467*Ydj1 + Ys*vol))/vol**2)*(Ydj1*cln3*kb**2/(vol**2*(-Ydj1*kb/vol - 0.069314718056)) + cln3*kb/vol)/(Ydj1*cln3*kb**2*(0.00577622650467*Ydj1*kb - (kr + 0.07509094456067)*(Ydj1*kb + 0.069314718056*vol))*(0.00577622650467*Ydj1*kb - (Ydj1*kb + kd*vol)*(kd + kr + 0.00577622650467))*(Ydj1*kb + kd*vol) + Ydj1*kb**2*prot*(0.00577622650467*Ydj1*kb - (kr + 0.07509094456067)*(Ydj1*kb + 0.069314718056*vol))*(0.00577622650467*Ydj1*kb - (Ydj1*kb + kd*vol)*(kd + kr + 0.00577622650467))*(Ydj1*kb + 0.069314718056*vol) - 0.069314718056*cln3*kb*vol*(-0.00577622650467*Ydj1*kb + (kr + 0.069314718056)*(Ydj1*kb + 0.069314718056*vol))*(0.00577622650467*Ydj1*kb - (Ydj1*kb + kd*vol)*(kd + kr + 0.00577622650467))*(Ydj1*kb + kd | 
  
    
      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
    
  
  
    
  | for train_idx, test_idx in cv: | |
| X_train, y_train = X[train_idx], y[train_idx] | |
| X_test, y_test = X[test_idx], y[test_idx] | |
| pip.fit(X_train, y_train) | |
| y_pred = pip.predict(X_test) | |
| print (roc_auc_score(y_test, y_pred)) | |
| 0.70326179109 | 
  
    
      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
    
  
  
    
  | """ Trains an agent with (stochastic) Policy Gradients on Pong. Uses OpenAI Gym. """ | |
| import numpy as np | |
| import cPickle as pickle | |
| import gym | |
| # hyperparameters | |
| H = 200 # number of hidden layer neurons | |
| batch_size = 10 # every how many episodes to do a param update? | |
| learning_rate = 1e-4 | |
| gamma = 0.99 # discount factor for reward | 
  
    
      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
    
  
  
    
  | conv_model = Sequential() | |
| conv_model.add(Embedding(max_features, embedding_size, input_length=maxlen)) | |
| conv_model.add(Dropout(0.25)) | |
| conv_model.add(Convolution1D(nb_filter=nb_filter, | |
| filter_length=filter_length, | |
| border_mode='valid', | |
| activation='relu', | |
| subsample_length=1)) | |
| conv_model.add(MaxPooling1D(pool_length=pool_length)) | |
| conv_model.add(LSTM(lstm_output_size)) | 
  
    
      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
    
  
  
    
  | 2016-03-24T14:28:11.662+0100 connected to: localhost | |
| 2016-03-24T14:28:14.661+0100 yasp_dump.December 290.5 MB | |
| 2016-03-24T14:28:17.661+0100 yasp_dump.December 581.2 MB | |
| 2016-03-24T14:28:20.661+0100 yasp_dump.December 882.1 MB | |
| 2016-03-24T14:28:23.661+0100 yasp_dump.December 1.1 GB | |
| 2016-03-24T14:28:26.661+0100 yasp_dump.December 1.3 GB | |
| 2016-03-24T14:28:29.661+0100 yasp_dump.December 1.6 GB | |
| 2016-03-24T14:28:32.661+0100 yasp_dump.December 1.9 GB | |
| 2016-03-24T14:28:35.661+0100 yasp_dump.December 2.1 GB | |
| 2016-03-24T14:28:38.661+0100 yasp_dump.December 2.3 GB | 
  
    
      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
    
  
  
    
  | { | |
| "worksheets": [ | |
| { | |
| "cells": [ | |
| { | |
| "cell_type": "markdown", | |
| "metadata": {}, | |
| "source": [ | |
| "Julia and its Ecosystem\n", | |
| "-------------------------------------\n", | 
NewerOlder