Skip to content

Instantly share code, notes, and snippets.

View holmesal's full-sized avatar
:bowtie:
makin'

Alonso Holmes holmesal

:bowtie:
makin'
View GitHub Profile
plt.plot(x, y, 'go', label = 'from data', alpha = .5)
plt.legend()
plt.show()
plt.clf()
# stick our data in a dataframe:
df = pd.DataFrame({'x': x, 'y': y});
# use 20% of our data for validation:
valid_idx = random.sample(list(df.index), int(0.2 * len(df)));
# what we're predicting:
dep_var = 'y'
# we don't have any categorical variables:
model = LinearRegressionModel();
print(model);
learn = Learner(data, model);
model = TabularModel(emb_szs={}, n_cont=1, out_sz=1, layers=[10]);
print(model)
preds, targs = learn.get_preds()
x_val = x[valid_idx];
y_val = np.array(targs);
y_hat = np.array(preds.flatten())
plt.plot(x_val, y_val, 'go', label = 'tagets', alpha = .5)
plt.plot(x_val, y_hat, 'ro', label = 'preds', alpha = .5)
plt.legend()
plt.show()
import {
GraphQLBoolean,
GraphQLError,
GraphQLList,
GraphQLNonNull,
GraphQLString
} from 'graphql';
import {
fromGlobalId,
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
extend type Query {
__schema: __Schema!
__type(name: String!): __Type
}
type __Schema {
description: String
types: [__Type!]!
queryType: __Type!
mutationType: __Type
ffadce40-ace0-4547-b248-baf8bf6fa1cf f0154557-bdb7-4c3c-b479-6ea2852a5cac