def test_fetch_datasets():
    """Test fetching datasets."""
    datasets.fetch_community_crime_data()
# Author: Vinicius Marques <*****@*****.**>
# License: MIT

########################################################
# Imports

import numpy as np
import matplotlib.pyplot as plt
from sklearn.cross_validation import train_test_split
from pyglmnet import GLM, datasets

########################################################
# Download and preprocess data files

X, y = datasets.fetch_community_crime_data('/tmp/glm-tools')
n_samples, n_features = X.shape

########################################################
# Split the data into training and test sets

X_train, X_test, y_train, y_test = \
    train_test_split(X, y, test_size=0.33, random_state=0)

########################################################
# Fit a gaussian distributed GLM with elastic net regularization

# use the default value for reg_lambda
glm = GLM(distr='gaussian', alpha=0.05, score_metric='pseudo_R2')

# fit model
Exemple #3
0
########################################################

# Author: Vinicius Marques <*****@*****.**>
# License: MIT

########################################################
# Imports

import matplotlib.pyplot as plt
from sklearn.model_selection import train_test_split
from pyglmnet import GLM, GLMCV, datasets

########################################################
# Download and preprocess data files

X, y = datasets.fetch_community_crime_data()
n_samples, n_features = X.shape

########################################################
# Split the data into training and test sets

X_train, X_test, y_train, y_test = \
    train_test_split(X, y, test_size=0.33, random_state=0)

########################################################
# Fit a binomial distributed GLM with elastic net regularization

# use the default value for reg_lambda
glm = GLMCV(distr='binomial',
            alpha=0.05,
            score_metric='pseudo_R2',
########################################################

# Author: Vinicius Marques <*****@*****.**>
# License: MIT

########################################################
# Imports

import matplotlib.pyplot as plt
from sklearn.cross_validation import train_test_split
from pyglmnet import GLMCV, datasets

########################################################
# Download and preprocess data files

X, y = datasets.fetch_community_crime_data('/tmp/glm-tools')
n_samples, n_features = X.shape

########################################################
# Split the data into training and test sets

X_train, X_test, y_train, y_test = \
    train_test_split(X, y, test_size=0.33, random_state=0)

########################################################
# Fit a gaussian distributed GLM with elastic net regularization

# use the default value for reg_lambda
glm = GLMCV(distr='gaussian', alpha=0.05, score_metric='pseudo_R2')

# fit model
Exemple #5
0
def test_fetch_datasets():
    """Test fetching datasets."""
    datasets.fetch_community_crime_data('/tmp/glm-tools')