This file contains 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.model_selection import train_test_split | |
from sklearn.linear_model import Ridge | |
from sklearn.metrics import mean_squared_error | |
import numpy as np | |
import matplotlib.pyplot as plt | |
# generate data | |
X, y, w = make_regression(n_samples=1000, n_features=200, coef=True, | |
random_state=1, bias=0, noise=3, tail_strength=0.9, effective_rank=10) |
This file contains 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
require "active_record" | |
namespace :db do | |
db_config = YAML::load(File.open('config/database.yml')) | |
db_config_admin = db_config.merge({'database' => 'postgres', 'schema_search_path' => 'public'}) | |
desc "Create the database" | |
task :create do | |
ActiveRecord::Base.establish_connection(db_config_admin) |