Esempio n. 1
0
def commit(notebook_id=None, nb_filename=None):
    """
    sh: jovian clone notebook_id
    :param nb_filename:
    :param notebook_id: 内容覆盖566f95b138a9465aa8d17e0f1836570a -> https://jvn.io/Jie-Yuan/566f95b138a9465aa8d17e0f1836570a
    :return:
    """
    print(
        "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJmcmVzaCI6ZmFsc2UsImlkZW50aXR5Ijp7InVzZXJuYW1lIjoiSmllLVl1YW4iLCJpZCI6Njd9LCJ0eXBlIjoiYWNjZXNzIiwiZXhwIjoxNTUyOTY1NTkzLCJpYXQiOjE1NTIzNjA3OTMsIm5iZiI6MTU1MjM2MDc5MywianRpIjoiNjM1ZTg2MjQtYjA1ZC00NGJmLTljYjAtOGVjOGRmM2ExNmJkIn0.5jglhEGGs12ITl-DWWaFL-BVPhCzaDEeMKIJvEI-bbA"
    )
    print('\n')
    jovian.commit(nb_filename=nb_filename,
                  env_type='pip',
                  notebook_id=notebook_id)
                testinputs, testlabels = testinput.to(device), testlabel.to(
                    device)
                testpredictions = model9(testinputs)
                _, testpredict = torch.max(testpredictions.data, 1)
                tloss = criterion(testpredictions, testlabels)
                testloss += tloss.item()
                testtotal += testlabels.size(0)
                testsuccessful += (testpredict == testlabels).sum().item()
        trainlosses.append(trainloss / len(train_dl))
        testlosses.append(testloss / len(valid_dl))
        print('Epoch: ', e)
        print('Train Accuracy %{:.2f}'.format(100 * trainsuccessful /
                                              traintotal))
        print('Test Accuracy %{:.2f}'.format(100 * testsuccessful / testtotal))

# In[ ]:

# In[ ]:

# In[ ]:

jovian.log_metrics(train_loss=history[-1]['train_loss'],
                   val_loss=history[-1]['val_loss'],
                   val_acc=history[-1]['val_acc'])

# In[80]:

jovian.commit(project=project_name, environment=None)

# In[ ]:
Esempio n. 3
0
for i in range(0,1000):
  if(y[i]==0):
    pos=pos+1
  else:
    neg=neg+1
print(pos)    
print(neg)

"""## Splitting the dataset into the Training set and Test set"""

from sklearn.model_selection import train_test_split
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size = 0.20, random_state = 0)

import jovian

jovian.commit(project='cmpn-100')

"""## Training the Naive Bayes model on the Training set"""

from sklearn.naive_bayes import GaussianNB
classifier = GaussianNB()
classifier.fit(X_train, y_train)

y_pred = classifier.predict(X_test)

from sklearn.metrics import confusion_matrix, accuracy_score
cm = confusion_matrix(y_test, y_pred)
print(cm)
accuracy_score(y_test, y_pred)

"""## Training on Simple Logistic Regression"""
Esempio n. 4
0
import jovian
jovian.commit(message='first commit', files=['Basic Python.ipynb'])
import jovian

jovian.commit(project='jovian-v2-script-test2',
              message='Testing message from script',
              privacy='secret',
              environment='pip',
              git_message='a commit from jovian')
Esempio n. 6
0
# In[3]:

project_name = "SuicideRates"

# In[4]:

get_ipython().system('pip install jovian --upgrade -q')

# In[5]:

import jovian

# In[6]:

jovian.commit(project=project_name)

# ## Loading the Dataset

# We are ready to load and read the dataset, above we used command "read_csv" which is used for read .csv format files. Now, we load the dataset and take a look.

# In[7]:

sr_df

# As we can see the data of dataset rows number and columns names
#

# In[8]:

sr_df.head(2)
The recommended way to run this notebook is to click the "Run" button at the top of this page, and select "Run on Binder". This will run the notebook on [mybinder.org](https://mybinder.org), a free online service for running Jupyter notebooks. 

Before staring the assignment, let's save a snapshot of the assignment to your Jovian.ml profile, so that you can access it later, and continue your work.
"""

# Install the library
!pip install jovian --upgrade --quiet

# Import it
import jovian

project_name='python-practice-assignment'

# Capture and upload a snapshot
jovian.commit(project=project_name, privacy='secret', evironment=None)

"""You'll be asked to provide an API Key, to securely upload the notebook to your Jovian.ml account. You can get the API key from your Jovian.ml profile page after logging in / signing up. See the docs for details: https://jovian.ml/docs/user-guide/upload.html . The privacy of your assignment notebook is set to *Secret*, so that you can the evlauators can access it, but it will not shown on your public profile to other users.

## Problem 1 - Variables and Data Types

**Q: Assign your name to the variable `name`.**
"""

name = 'Purvansh'

"""**Q: Assign your age (real or fake) to the variable `age`.**"""

age = 24

"""**Q: Assign a boolean value to the variable `has_android_phone`.**"""
Esempio n. 8
0
preds=model(inputs)
loss=mse(preds,targets)
print(loss)


# In[27]:


# Predictions
preds


# In[28]:


# Targets
targets


# In[29]:


import jovian


# In[ ]:


jovian.commit()

Esempio n. 9
0
Qs = range(0, 2)
qs = range(0, 3)
Ps = range(0, 3)
ps = range(0, 3)
D=1
d=1
parameters = product(ps, qs, Ps, Qs)
parameters_list = list(parameters)
len(parameters_list)

# Model Selection
results = []
best_aic = float("inf")
warnings.filterwarnings('ignore')
for param in parameters_list:
    try:
        model=sm.tsa.statespace.SARIMAX(df_month.Weighted_Price_box, order=(param[0], d, param[1]), 
                                        seasonal_order=(param[2], D, param[3], 12)).fit(disp=-1)
    except ValueError:
        print('wrong parameters:', param)
        continue
    aic = model.aic
    if aic < best_aic:
        best_model = model
        best_aic = aic
        best_param = param
    results.append([param, model.aic])

jovian.commit(project=project)
# In[1]:


get_ipython().system('pip install jovian --upgrade -q')


# In[2]:


import jovian


# In[3]:


jovian.commit(project='numpy-array-operations')


# Let's begin by importing Numpy and listing out the functions covered in this notebook.

# In[4]:


import numpy as np


# In[5]:


# List of functions explained 
function1 = np.eye()